比赛 |
20190521热身赛 |
评测结果 |
AAAAAAAAATTTTTTTTTTTTTTTA |
题目名称 |
求gcd之和 |
最终得分 |
40 |
用户昵称 |
gsj.cpp |
运行时间 |
45.655 s |
代码语言 |
C++ |
内存使用 |
13.66 MiB |
提交时间 |
2019-05-21 19:22:41 |
显示代码纯文本
#include <algorithm>
#include <bitset>
#include <cctype>
#include <cerrno>
#include <clocale>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <limits>
#include <list>
#include <map>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <utility>
#include <vector>
#include <cwchar>
#include <cwctype>
#define LL long long
using namespace std;
inline LL read()
{
char ch=getchar();LL x=0,f=1;
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-48;ch=getchar();}
return x*f;
}
LL gcd(int a,int b)
{
if(a%b==0)return b;
else return gcd(b,a%b);
}
const LL mod=998244353;
LL a,b,sum;
int main()
{
freopen("hoip.in","r",stdin);
freopen("hoip.out","w",stdout);
a=read(),b=read();
for(int i=1;i<=a;i++)
for(int j=1;j<=b;j++)
{
sum+=gcd(i,j);
sum%=mod;
}
cout<<sum;
return 0;
}