QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#258562 | #1261. Inv | chenxinyang2006 | WA | 211ms | 4004kb | C++14 | 1.1kb | 2023-11-19 20:10:33 | 2023-11-19 20:10:34 |
Judging History
answer
#include <bits/stdc++.h>
#define rep(i,j,k) for(int i=(j);i<=(k);i++)
#define per(i,j,k) for(int i=(j);i>=(k);i--)
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define db double
#define ldb long double
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mkp make_pair
#define eb emplace_back
#define SZ(S) (int)S.size()
//#define mod 998244353
//#define mod 1000000007
#define inf 0x3f3f3f3f
#define linf 0x3f3f3f3f3f3f3f3f
using namespace std;
template <class T>
void chkmax(T &x,T y){
if(x < y) x = y;
}
template <class T>
void chkmin(T &x,T y){
if(x > y) x = y;
}
inline int popcnt(int x){
return __builtin_popcount(x);
}
inline int ctz(int x){
return __builtin_ctz(x);
}
/*ll power(ll p,int k = mod - 2){
ll ans = 1;
while(k){
if(k % 2 == 1) ans = ans * p % mod;
p = p * p % mod;
k /= 2;
}
return ans;
}*/
int n,k;
bitset <125005> f,g;
int main(){
scanf("%d%d",&n,&k);
g.set(0);
rep(i,1,n){
f = g;
rep(j,1,i - 1) f ^= g << (2 * (i - j) - 1);
g = f;
}
printf("%d\n",g.test(k));
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3844kb
input:
4 1
output:
1
result:
ok answer is '1'
Test #2:
score: 0
Accepted
time: 0ms
memory: 3804kb
input:
10 21
output:
0
result:
ok answer is '0'
Test #3:
score: 0
Accepted
time: 211ms
memory: 4004kb
input:
500 124331
output:
0
result:
ok answer is '0'
Test #4:
score: 0
Accepted
time: 1ms
memory: 3844kb
input:
20 122
output:
1
result:
ok answer is '1'
Test #5:
score: 0
Accepted
time: 9ms
memory: 3844kb
input:
100 999
output:
0
result:
ok answer is '0'
Test #6:
score: 0
Accepted
time: 210ms
memory: 3928kb
input:
500 100001
output:
1
result:
ok answer is '1'
Test #7:
score: 0
Accepted
time: 0ms
memory: 3808kb
input:
5 0
output:
1
result:
ok answer is '1'
Test #8:
score: 0
Accepted
time: 0ms
memory: 3916kb
input:
5 1
output:
0
result:
ok answer is '0'
Test #9:
score: -100
Wrong Answer
time: 0ms
memory: 3828kb
input:
5 2
output:
0
result:
wrong answer expected '1', found '0'