QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#387361 | #3728. 2016 | wanyurukong | AC ✓ | 4ms | 3724kb | C++14 | 843b | 2024-04-12 14:10:20 | 2024-04-12 14:10:20 |
Judging History
answer
#include<bits/stdc++.h>
#define lowbit(x) (x&(-x))
#define rep(x,a,b) for(int x=a;x<=b;x++)
#define pre(x,a,b) for(int x=a;x>=b;x--)
#define endl "\n"
#define pb push_back
#define ll long long
// #define int long long
#define pii pair<ll,ll>
#define psi pair<string, ll>
#define de cout<<1;
#define mem(a,x) memset(a,x,sizeof a)
#define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
const int mod1=998244353;
const int mod2=1e9+7;
const int N = 2e5 + 60;
int number;
ll n,m, q;
void solve()
{
while(cin >> n >> m)
{
ll ans=0;
rep(i,1,min(2016ll,n))
{
rep(j,1,min(2016ll,m))
{
if((i * j) % 2016 == 0)
{
ans+=((n-i)/2016+1)*((m-j)/2016+1);
}
}
}
cout << ans <<endl;
}
}
int main()
{
IOS;
int _;
//cin >> _;
_ = 1;
while(_--)
{
number++;
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3676kb
input:
1 1
output:
0
result:
ok 1 number(s): "0"
Test #2:
score: 0
Accepted
time: 4ms
memory: 3592kb
input:
3083 3896
output:
86537
result:
ok 1 number(s): "86537"
Test #3:
score: 0
Accepted
time: 4ms
memory: 3724kb
input:
4211 2740
output:
84170
result:
ok 1 number(s): "84170"
Test #4:
score: 0
Accepted
time: 4ms
memory: 3596kb
input:
4931 4288
output:
155486
result:
ok 1 number(s): "155486"
Test #5:
score: 0
Accepted
time: 0ms
memory: 3636kb
input:
1059 429
output:
2723
result:
ok 1 number(s): "2723"
Test #6:
score: 0
Accepted
time: 4ms
memory: 3648kb
input:
2187 4273
output:
68285
result:
ok 1 number(s): "68285"
Test #7:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
612 413
output:
1419
result:
ok 1 number(s): "1419"
Test #8:
score: 0
Accepted
time: 1ms
memory: 3668kb
input:
4036 66
output:
1254
result:
ok 1 number(s): "1254"
Test #9:
score: 0
Accepted
time: 0ms
memory: 3584kb
input:
2460 1614
output:
27671
result:
ok 1 number(s): "27671"
Test #10:
score: 0
Accepted
time: 0ms
memory: 3724kb
input:
2646 289
output:
4832
result:
ok 1 number(s): "4832"
Test #11:
score: 0
Accepted
time: 4ms
memory: 3652kb
input:
3774 4133
output:
113619
result:
ok 1 number(s): "113619"
Test #12:
score: 0
Accepted
time: 4ms
memory: 3652kb
input:
973601506 686821931
output:
5030659601476858
result:
ok 1 number(s): "5030659601476858"
Test #13:
score: 0
Accepted
time: 4ms
memory: 3712kb
input:
856717634 260370775
output:
1678144928906970
result:
ok 1 number(s): "1678144928906970"
Test #14:
score: 0
Accepted
time: 4ms
memory: 3656kb
input:
34801058 128886916
output:
33744272524610
result:
ok 1 number(s): "33744272524610"
Test #15:
score: 0
Accepted
time: 4ms
memory: 3672kb
input:
212884482 262244272
output:
420000053352105
result:
ok 1 number(s): "420000053352105"
Test #16:
score: 0
Accepted
time: 4ms
memory: 3620kb
input:
390967906 835793116
output:
2458325388972916
result:
ok 1 number(s): "2458325388972916"
Test #17:
score: 0
Accepted
time: 4ms
memory: 3712kb
input:
274084034 704309257
output:
1452267515767202
result:
ok 1 number(s): "1452267515767202"
Test #18:
score: 0
Accepted
time: 4ms
memory: 3712kb
input:
452167458 277858101
output:
945195842785264
result:
ok 1 number(s): "945195842785264"
Test #19:
score: 0
Accepted
time: 2ms
memory: 3720kb
input:
630250882 146374241
output:
694028822305947
result:
ok 1 number(s): "694028822305947"
Test #20:
score: 0
Accepted
time: 2ms
memory: 3652kb
input:
413033773 233149132
output:
724467281960284
result:
ok 1 number(s): "724467281960284"
Test #21:
score: 0
Accepted
time: 2ms
memory: 3656kb
input:
886084493 101665272
output:
677715029081962
result:
ok 1 number(s): "677715029081962"