QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#50771 | #1261. Inv | tricyzhkx | AC ✓ | 58ms | 4700kb | C++14 | 403b | 2022-09-29 11:20:07 | 2022-09-29 11:20:10 |
Judging History
answer
# include <bits/stdc++.h>
using namespace std;
int f[2][250010];
int main()
{
int n,k;
cin>>n>>k;
f[0][0]=1;
for(int i=0;i<n;i++)
{
for(int j=0;j<=i*i/2;j++)
{
f[(i+1)&1][j]^=f[i&1][j];
if(i+j+1<=(i+1)*(i+1)/2) f[(i+1)&1][i+j+1]^=f[i&1][j];
f[i&1][j]=0;
}
for(int j=1;j<=(i+1)*(i+1)/2;j++) f[(i+1)&1][j]^=f[(i+1)&1][j-1];
}
cout<<f[n&1][k]<<endl;
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 3ms
memory: 3576kb
input:
4 1
output:
1
result:
ok answer is '1'
Test #2:
score: 0
Accepted
time: 2ms
memory: 3556kb
input:
10 21
output:
0
result:
ok answer is '0'
Test #3:
score: 0
Accepted
time: 32ms
memory: 4552kb
input:
500 124331
output:
0
result:
ok answer is '0'
Test #4:
score: 0
Accepted
time: 3ms
memory: 3592kb
input:
20 122
output:
1
result:
ok answer is '1'
Test #5:
score: 0
Accepted
time: 2ms
memory: 3632kb
input:
100 999
output:
0
result:
ok answer is '0'
Test #6:
score: 0
Accepted
time: 32ms
memory: 4552kb
input:
500 100001
output:
1
result:
ok answer is '1'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3576kb
input:
5 0
output:
1
result:
ok answer is '1'
Test #8:
score: 0
Accepted
time: 2ms
memory: 3540kb
input:
5 1
output:
0
result:
ok answer is '0'
Test #9:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
5 2
output:
1
result:
ok answer is '1'
Test #10:
score: 0
Accepted
time: 2ms
memory: 3580kb
input:
5 3
output:
1
result:
ok answer is '1'
Test #11:
score: 0
Accepted
time: 2ms
memory: 3584kb
input:
5 4
output:
0
result:
ok answer is '0'
Test #12:
score: 0
Accepted
time: 1ms
memory: 3676kb
input:
5 5
output:
0
result:
ok answer is '0'
Test #13:
score: 0
Accepted
time: 0ms
memory: 3504kb
input:
5 6
output:
0
result:
ok answer is '0'
Test #14:
score: 0
Accepted
time: 2ms
memory: 3508kb
input:
5 7
output:
1
result:
ok answer is '1'
Test #15:
score: 0
Accepted
time: 2ms
memory: 3728kb
input:
5 8
output:
1
result:
ok answer is '1'
Test #16:
score: 0
Accepted
time: 2ms
memory: 3588kb
input:
5 9
output:
0
result:
ok answer is '0'
Test #17:
score: 0
Accepted
time: 0ms
memory: 3448kb
input:
5 10
output:
1
result:
ok answer is '1'
Test #18:
score: 0
Accepted
time: 25ms
memory: 4552kb
input:
500 73732
output:
1
result:
ok answer is '1'
Test #19:
score: 0
Accepted
time: 28ms
memory: 4512kb
input:
499 21121
output:
1
result:
ok answer is '1'
Test #20:
score: 0
Accepted
time: 29ms
memory: 4620kb
input:
499 100000
output:
0
result:
ok answer is '0'
Test #21:
score: 0
Accepted
time: 32ms
memory: 4480kb
input:
499 62262
output:
1
result:
ok answer is '1'
Test #22:
score: 0
Accepted
time: 58ms
memory: 4512kb
input:
499 23432
output:
1
result:
ok answer is '1'
Test #23:
score: 0
Accepted
time: 50ms
memory: 4516kb
input:
500 12321
output:
0
result:
ok answer is '0'
Test #24:
score: 0
Accepted
time: 44ms
memory: 4536kb
input:
500 60000
output:
1
result:
ok answer is '1'
Test #25:
score: 0
Accepted
time: 27ms
memory: 4648kb
input:
498 7498
output:
1
result:
ok answer is '1'
Test #26:
score: 0
Accepted
time: 23ms
memory: 4548kb
input:
498 76111
output:
1
result:
ok answer is '1'
Test #27:
score: 0
Accepted
time: 19ms
memory: 4236kb
input:
414 41414
output:
1
result:
ok answer is '1'
Test #28:
score: 0
Accepted
time: 21ms
memory: 4268kb
input:
422 42224
output:
1
result:
ok answer is '1'
Test #29:
score: 0
Accepted
time: 11ms
memory: 4004kb
input:
333 33333
output:
1
result:
ok answer is '1'
Test #30:
score: 0
Accepted
time: 25ms
memory: 4420kb
input:
500 51515
output:
1
result:
ok answer is '1'
Test #31:
score: 0
Accepted
time: 17ms
memory: 4328kb
input:
393 21222
output:
1
result:
ok answer is '1'
Test #32:
score: 0
Accepted
time: 28ms
memory: 4528kb
input:
500 124750
output:
1
result:
ok answer is '1'
Test #33:
score: 0
Accepted
time: 30ms
memory: 4700kb
input:
500 124749
output:
1
result:
ok answer is '1'
Test #34:
score: 0
Accepted
time: 27ms
memory: 4612kb
input:
500 0
output:
1
result:
ok answer is '1'
Test #35:
score: 0
Accepted
time: 34ms
memory: 4628kb
input:
500 1
output:
1
result:
ok answer is '1'
Test #36:
score: 0
Accepted
time: 2ms
memory: 3508kb
input:
1 0
output:
1
result:
ok answer is '1'