QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#455861#1261. InvKevin5307AC ✓2ms3716kbC++23981b2024-06-26 22:05:262024-06-26 22:05:26

Judging History

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

  • [2024-06-26 22:05:26]
  • 评测
  • 测评结果:AC
  • 用时:2ms
  • 内存:3716kb
  • [2024-06-26 22:05:26]
  • 提交

answer

//Author: Kevin
#include<bits/stdc++.h>
//#pragma GCC optimize("O2")
using namespace std;
#define ll long long
#define ull unsigned ll
#define pb emplace_back
#define mp make_pair
#define ALL(x) (x).begin(),(x).end()
#define rALL(x) (x).rbegin(),(x).rend()
#define srt(x) sort(ALL(x))
#define rev(x) reverse(ALL(x))
#define rsrt(x) sort(rALL(x))
#define sz(x) (int)(x.size())
#define inf 0x3f3f3f3f
#define pii pair<int,int>
#define lb(v,x) (int)(lower_bound(ALL(v),x)-v.begin())
#define ub(v,x) (int)(upper_bound(ALL(v),x)-v.begin())
#define uni(v) v.resize(unique(ALL(v))-v.begin())
#define longer __int128_t
void die(string S){puts(S.c_str());exit(0);}
bitset<125000> bs;
int main()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	bs[0]=1;
	int n;
	cin>>n;
	for(int i=1;i<=n;i++)
		bs^=(bs<<i);
	int m;
	cin>>m;
	int ans=0;
	for(int i=0;i<=m;i++)
		if(((m-i+n-1)&(n-1))==n-1)
			ans^=bs[i];
	cout<<ans<<endl;
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3704kb

input:

4 1

output:

1

result:

ok answer is '1'

Test #2:

score: 0
Accepted
time: 0ms
memory: 3592kb

input:

10 21

output:

0

result:

ok answer is '0'

Test #3:

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

input:

500 124331

output:

0

result:

ok answer is '0'

Test #4:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

20 122

output:

1

result:

ok answer is '1'

Test #5:

score: 0
Accepted
time: 1ms
memory: 3644kb

input:

100 999

output:

0

result:

ok answer is '0'

Test #6:

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

input:

500 100001

output:

1

result:

ok answer is '1'

Test #7:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

5 0

output:

1

result:

ok answer is '1'

Test #8:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

5 1

output:

0

result:

ok answer is '0'

Test #9:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

5 2

output:

1

result:

ok answer is '1'

Test #10:

score: 0
Accepted
time: 0ms
memory: 3652kb

input:

5 3

output:

1

result:

ok answer is '1'

Test #11:

score: 0
Accepted
time: 0ms
memory: 3660kb

input:

5 4

output:

0

result:

ok answer is '0'

Test #12:

score: 0
Accepted
time: 0ms
memory: 3584kb

input:

5 5

output:

0

result:

ok answer is '0'

Test #13:

score: 0
Accepted
time: 0ms
memory: 3708kb

input:

5 6

output:

0

result:

ok answer is '0'

Test #14:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

5 7

output:

1

result:

ok answer is '1'

Test #15:

score: 0
Accepted
time: 0ms
memory: 3596kb

input:

5 8

output:

1

result:

ok answer is '1'

Test #16:

score: 0
Accepted
time: 0ms
memory: 3588kb

input:

5 9

output:

0

result:

ok answer is '0'

Test #17:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

5 10

output:

1

result:

ok answer is '1'

Test #18:

score: 0
Accepted
time: 1ms
memory: 3636kb

input:

500 73732

output:

1

result:

ok answer is '1'

Test #19:

score: 0
Accepted
time: 1ms
memory: 3560kb

input:

499 21121

output:

1

result:

ok answer is '1'

Test #20:

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

input:

499 100000

output:

0

result:

ok answer is '0'

Test #21:

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

input:

499 62262

output:

1

result:

ok answer is '1'

Test #22:

score: 0
Accepted
time: 0ms
memory: 3712kb

input:

499 23432

output:

1

result:

ok answer is '1'

Test #23:

score: 0
Accepted
time: 1ms
memory: 3488kb

input:

500 12321

output:

0

result:

ok answer is '0'

Test #24:

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

input:

500 60000

output:

1

result:

ok answer is '1'

Test #25:

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

input:

498 7498

output:

1

result:

ok answer is '1'

Test #26:

score: 0
Accepted
time: 1ms
memory: 3644kb

input:

498 76111

output:

1

result:

ok answer is '1'

Test #27:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

414 41414

output:

1

result:

ok answer is '1'

Test #28:

score: 0
Accepted
time: 1ms
memory: 3588kb

input:

422 42224

output:

1

result:

ok answer is '1'

Test #29:

score: 0
Accepted
time: 1ms
memory: 3488kb

input:

333 33333

output:

1

result:

ok answer is '1'

Test #30:

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

input:

500 51515

output:

1

result:

ok answer is '1'

Test #31:

score: 0
Accepted
time: 1ms
memory: 3644kb

input:

393 21222

output:

1

result:

ok answer is '1'

Test #32:

score: 0
Accepted
time: 1ms
memory: 3660kb

input:

500 124750

output:

1

result:

ok answer is '1'

Test #33:

score: 0
Accepted
time: 1ms
memory: 3580kb

input:

500 124749

output:

1

result:

ok answer is '1'

Test #34:

score: 0
Accepted
time: 1ms
memory: 3652kb

input:

500 0

output:

1

result:

ok answer is '1'

Test #35:

score: 0
Accepted
time: 1ms
memory: 3704kb

input:

500 1

output:

1

result:

ok answer is '1'

Test #36:

score: 0
Accepted
time: 0ms
memory: 3640kb

input:

1 0

output:

1

result:

ok answer is '1'