QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#80405#1261. InvOtoriEmuAC ✓166ms6428kbC++14917b2023-02-23 16:42:112023-02-23 16:42:14

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-02-23 16:42:14]
  • 评测
  • 测评结果:AC
  • 用时:166ms
  • 内存:6428kb
  • [2023-02-23 16:42:11]
  • 提交

answer

/*
わんわん……わんだほーいっ☆
Wonderhoy!
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef double DB;
char buf[1<<21],*p1=buf,*p2=buf;
#define getchar() (p1==p2 && (p2=(p1=buf)+fread(buf,1,1<<18,stdin),p1==p2)?EOF:*p1++)
int read()
{
	int x=0;
	char c=getchar();
	while(c<'0' || c>'9')	c=getchar();
	while(c>='0' && c<='9')	x=(x<<1)+(x<<3)+(c^'0'),c=getchar();
	return x;
}
void write(int x)
{
	if(x>9)	write(x/10);
	putchar(x%10+'0');
}
typedef pair<int,int> P;
typedef vector<int> Poly;
typedef vector<P> PolyP;
#define mp make_pair
#define spc putchar(' ')
#define etr putchar('\n')
#define inlp(x,y) putchar(x==y?'\n':' ')
int n,k;
int main(){
	n=read(),k=read();
	bitset<4005*2000> B;
	B.set(0);
	for(int i=1;i<=n;++i)	B^=B<<i;
	int ans=0;
	for(int i=0;i<=k;++i)	ans^=B[k-i]&(((n+i-1)&i)==i);
	putchar(ans^'0'),etr;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 5ms
memory: 6236kb

input:

4 1

output:

1

result:

ok answer is '1'

Test #2:

score: 0
Accepted
time: 7ms
memory: 6264kb

input:

10 21

output:

0

result:

ok answer is '0'

Test #3:

score: 0
Accepted
time: 147ms
memory: 6276kb

input:

500 124331

output:

0

result:

ok answer is '0'

Test #4:

score: 0
Accepted
time: 7ms
memory: 6296kb

input:

20 122

output:

1

result:

ok answer is '1'

Test #5:

score: 0
Accepted
time: 34ms
memory: 6424kb

input:

100 999

output:

0

result:

ok answer is '0'

Test #6:

score: 0
Accepted
time: 141ms
memory: 6400kb

input:

500 100001

output:

1

result:

ok answer is '1'

Test #7:

score: 0
Accepted
time: 6ms
memory: 6424kb

input:

5 0

output:

1

result:

ok answer is '1'

Test #8:

score: 0
Accepted
time: 6ms
memory: 6428kb

input:

5 1

output:

0

result:

ok answer is '0'

Test #9:

score: 0
Accepted
time: 6ms
memory: 6300kb

input:

5 2

output:

1

result:

ok answer is '1'

Test #10:

score: 0
Accepted
time: 2ms
memory: 6284kb

input:

5 3

output:

1

result:

ok answer is '1'

Test #11:

score: 0
Accepted
time: 5ms
memory: 6276kb

input:

5 4

output:

0

result:

ok answer is '0'

Test #12:

score: 0
Accepted
time: 5ms
memory: 6232kb

input:

5 5

output:

0

result:

ok answer is '0'

Test #13:

score: 0
Accepted
time: 2ms
memory: 6180kb

input:

5 6

output:

0

result:

ok answer is '0'

Test #14:

score: 0
Accepted
time: 3ms
memory: 6276kb

input:

5 7

output:

1

result:

ok answer is '1'

Test #15:

score: 0
Accepted
time: 5ms
memory: 6264kb

input:

5 8

output:

1

result:

ok answer is '1'

Test #16:

score: 0
Accepted
time: 5ms
memory: 6232kb

input:

5 9

output:

0

result:

ok answer is '0'

Test #17:

score: 0
Accepted
time: 5ms
memory: 6248kb

input:

5 10

output:

1

result:

ok answer is '1'

Test #18:

score: 0
Accepted
time: 166ms
memory: 6268kb

input:

500 73732

output:

1

result:

ok answer is '1'

Test #19:

score: 0
Accepted
time: 156ms
memory: 6268kb

input:

499 21121

output:

1

result:

ok answer is '1'

Test #20:

score: 0
Accepted
time: 148ms
memory: 6388kb

input:

499 100000

output:

0

result:

ok answer is '0'

Test #21:

score: 0
Accepted
time: 152ms
memory: 6268kb

input:

499 62262

output:

1

result:

ok answer is '1'

Test #22:

score: 0
Accepted
time: 146ms
memory: 6264kb

input:

499 23432

output:

1

result:

ok answer is '1'

Test #23:

score: 0
Accepted
time: 146ms
memory: 6392kb

input:

500 12321

output:

0

result:

ok answer is '0'

Test #24:

score: 0
Accepted
time: 150ms
memory: 6392kb

input:

500 60000

output:

1

result:

ok answer is '1'

Test #25:

score: 0
Accepted
time: 149ms
memory: 6252kb

input:

498 7498

output:

1

result:

ok answer is '1'

Test #26:

score: 0
Accepted
time: 152ms
memory: 6264kb

input:

498 76111

output:

1

result:

ok answer is '1'

Test #27:

score: 0
Accepted
time: 132ms
memory: 6240kb

input:

414 41414

output:

1

result:

ok answer is '1'

Test #28:

score: 0
Accepted
time: 134ms
memory: 6268kb

input:

422 42224

output:

1

result:

ok answer is '1'

Test #29:

score: 0
Accepted
time: 98ms
memory: 6268kb

input:

333 33333

output:

1

result:

ok answer is '1'

Test #30:

score: 0
Accepted
time: 152ms
memory: 6244kb

input:

500 51515

output:

1

result:

ok answer is '1'

Test #31:

score: 0
Accepted
time: 117ms
memory: 6268kb

input:

393 21222

output:

1

result:

ok answer is '1'

Test #32:

score: 0
Accepted
time: 145ms
memory: 6272kb

input:

500 124750

output:

1

result:

ok answer is '1'

Test #33:

score: 0
Accepted
time: 145ms
memory: 6428kb

input:

500 124749

output:

1

result:

ok answer is '1'

Test #34:

score: 0
Accepted
time: 149ms
memory: 6228kb

input:

500 0

output:

1

result:

ok answer is '1'

Test #35:

score: 0
Accepted
time: 145ms
memory: 6272kb

input:

500 1

output:

1

result:

ok answer is '1'

Test #36:

score: 0
Accepted
time: 4ms
memory: 6252kb

input:

1 0

output:

1

result:

ok answer is '1'