QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#571549#1261. Invnullptr_qwqAC ✓64ms5460kbC++201.4kb2024-09-18 00:23:202024-09-18 00:23:20

Judging History

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

  • [2024-09-18 00:23:20]
  • 评测
  • 测评结果:AC
  • 用时:64ms
  • 内存:5460kb
  • [2024-09-18 00:23:20]
  • 提交

answer

// Problem: T402404 星辰
// Contest: Luogu
// URL: https://www.luogu.com.cn/problem/T402404
// Memory Limit: 512 MB
// Time Limit: 1000 ms
// Author: nullptr_qwq
// 
// Powered by CP Editor (https://cpeditor.org)

// 私は猫です

#include<bits/stdc++.h>
#define ull unsigned long long
#define ll long long
#define pb push_back
#define mkp make_pair
#define fi first
#define se second
#define inf 1000000000
#define infll 1000000000000000000ll
#define pii pair<int,int>
#define rep(i,a,b,c) for(int i=(a);i<=(b);i+=(c))
#define per(i,a,b,c) for(int i=(a);i>=(b);i-=(c))
#define F(i,a,b) for(int i=a,i##end=b;i<=i##end;i++)
#define dF(i,a,b) for(int i=a,i##end=b;i>=i##end;i--)
#define cmh(sjy) while(sjy--)
#define lowbit(x) (x&(-x))
#define HH printf("\n")
#define eb emplace_back
#define poly vector<int>
using namespace std;
ll read(){
	ll x=0,f=1;char c=getchar();
	while(c<'0'||c>'9'){if(c=='-') f=-1;c=getchar();}
	while(c>='0'&&c<='9') x=(x<<3)+(x<<1)+(c^48),c=getchar();
	return x*f;
}
template<typename T>inline void chkmax(T &x,const T &y){ x=std::max(x,y); }
template<typename T>inline void chkmin(T &x,const T &y){ x=std::min(x,y); }
const int mod=998244353,maxn=500005;
bitset<4498502>ans;
int n,m,k;
void solve(){
	n=read(),m=(n*(n-1))>>1,k=read();
	F(i,0,m)if(!(i&(n-1)))ans[i]=1;
	F(i,1,n)ans^=(ans<<i);
	printf(ans[k]?"1":"0");
}
signed main(){
	const int zsy=1;
	F(____,1,zsy)solve();
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 5460kb

input:

4 1

output:

1

result:

ok answer is '1'

Test #2:

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

input:

10 21

output:

0

result:

ok answer is '0'

Test #3:

score: 0
Accepted
time: 63ms
memory: 5316kb

input:

500 124331

output:

0

result:

ok answer is '0'

Test #4:

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

input:

20 122

output:

1

result:

ok answer is '1'

Test #5:

score: 0
Accepted
time: 14ms
memory: 5272kb

input:

100 999

output:

0

result:

ok answer is '0'

Test #6:

score: 0
Accepted
time: 63ms
memory: 5352kb

input:

500 100001

output:

1

result:

ok answer is '1'

Test #7:

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

input:

5 0

output:

1

result:

ok answer is '1'

Test #8:

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

input:

5 1

output:

0

result:

ok answer is '0'

Test #9:

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

input:

5 2

output:

1

result:

ok answer is '1'

Test #10:

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

input:

5 3

output:

1

result:

ok answer is '1'

Test #11:

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

input:

5 4

output:

0

result:

ok answer is '0'

Test #12:

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

input:

5 5

output:

0

result:

ok answer is '0'

Test #13:

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

input:

5 6

output:

0

result:

ok answer is '0'

Test #14:

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

input:

5 7

output:

1

result:

ok answer is '1'

Test #15:

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

input:

5 8

output:

1

result:

ok answer is '1'

Test #16:

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

input:

5 9

output:

0

result:

ok answer is '0'

Test #17:

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

input:

5 10

output:

1

result:

ok answer is '1'

Test #18:

score: 0
Accepted
time: 58ms
memory: 5404kb

input:

500 73732

output:

1

result:

ok answer is '1'

Test #19:

score: 0
Accepted
time: 63ms
memory: 5404kb

input:

499 21121

output:

1

result:

ok answer is '1'

Test #20:

score: 0
Accepted
time: 63ms
memory: 5348kb

input:

499 100000

output:

0

result:

ok answer is '0'

Test #21:

score: 0
Accepted
time: 58ms
memory: 5340kb

input:

499 62262

output:

1

result:

ok answer is '1'

Test #22:

score: 0
Accepted
time: 62ms
memory: 5348kb

input:

499 23432

output:

1

result:

ok answer is '1'

Test #23:

score: 0
Accepted
time: 63ms
memory: 5348kb

input:

500 12321

output:

0

result:

ok answer is '0'

Test #24:

score: 0
Accepted
time: 58ms
memory: 5340kb

input:

500 60000

output:

1

result:

ok answer is '1'

Test #25:

score: 0
Accepted
time: 61ms
memory: 5344kb

input:

498 7498

output:

1

result:

ok answer is '1'

Test #26:

score: 0
Accepted
time: 64ms
memory: 5332kb

input:

498 76111

output:

1

result:

ok answer is '1'

Test #27:

score: 0
Accepted
time: 51ms
memory: 5336kb

input:

414 41414

output:

1

result:

ok answer is '1'

Test #28:

score: 0
Accepted
time: 53ms
memory: 5340kb

input:

422 42224

output:

1

result:

ok answer is '1'

Test #29:

score: 0
Accepted
time: 38ms
memory: 5352kb

input:

333 33333

output:

1

result:

ok answer is '1'

Test #30:

score: 0
Accepted
time: 63ms
memory: 5276kb

input:

500 51515

output:

1

result:

ok answer is '1'

Test #31:

score: 0
Accepted
time: 50ms
memory: 5348kb

input:

393 21222

output:

1

result:

ok answer is '1'

Test #32:

score: 0
Accepted
time: 62ms
memory: 5340kb

input:

500 124750

output:

1

result:

ok answer is '1'

Test #33:

score: 0
Accepted
time: 64ms
memory: 5340kb

input:

500 124749

output:

1

result:

ok answer is '1'

Test #34:

score: 0
Accepted
time: 63ms
memory: 5400kb

input:

500 0

output:

1

result:

ok answer is '1'

Test #35:

score: 0
Accepted
time: 62ms
memory: 5404kb

input:

500 1

output:

1

result:

ok answer is '1'

Test #36:

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

input:

1 0

output:

1

result:

ok answer is '1'