QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#570050 | #4327. Šeširi | Williamxzh | 0 | 170ms | 122516kb | C++23 | 1.1kb | 2024-09-17 13:29:29 | 2024-09-17 13:29:32 |
Judging History
answer
//translated from Izborne Pripreme 2022 (Croatian IOI/CEOI Team Selection) D1T3. 3s,0.5G
//like little circle!
//ad-hoc
//little circle loves Eulerian circuit
#include <bits/stdc++.h>
#define il inline
using namespace std;
const int N=(1<<23),M=(1<<19)+5;
int n,S,fi[N],in[M];
bitset<N> vis,c;
int head[M],tot=1;
struct node{
int to,nxt;
il node(){to=nxt=0;}
}e[N];
il void add(int x,int y){e[++tot].to=y,e[tot].nxt=head[x],head[x]=tot;}
il void adde(int x,int y){add(x,y),add(y,x);}
void dfs(int x){
int y;
for(int &i=head[x];i;i=e[i].nxt){
y=e[i].to;
if(!vis[i>>1]) vis[i>>1]=1,c[i>>1]=(x>=S),dfs(y);
}
}
int x,y,z,u,v,w;
int main(){
scanf("%d",&n);S=(1<<n);
for(int i=0;i<n;++i){
for(int j=0;j<(S>>1);++j){
x=(j&((1<<i)-1)),y=(j^x),z=(y<<1)+x;
u=z,v=(z|(1<<i))+S,adde(u,v),++in[u],++in[v];
}
}
for(int i=0;i<(S<<1);++i) if(in[i]&1) adde(S<<1,i);
for(int i=0;i<=(S<<1);++i) dfs(i);
for(int i=0;i<n;++i){
for(int j=0;j<(S>>1);++j)putchar('B'+c[++w]);
puts("");
}
return 0;
}
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms
memory: 73076kb
input:
4
output:
CBCBBBCB BCBBCCBB CBCCBBCC BCBBCCCC
result:
wrong answer your plan fails on CCBB
Subtask #2:
score: 0
Wrong Answer
Test #2:
score: 0
Wrong Answer
time: 0ms
memory: 71400kb
input:
5
output:
CBCBBBCBCBCCBBCB BCBBCCBCBCBBCCBB CBCCBBCBCBCCBBCC BCBBCCCCBCBBCCBC CBCCBCCBCCCCCBCC
result:
wrong answer your plan fails on CCCCB
Subtask #3:
score: 0
Wrong Answer
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 72968kb
input:
6
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBBBCB BCBBCCBCBCBBCCBBCCBBCCBBBCBCCCBB CBCCBBCCCBCBBBCBBBCCBBCCCBCBBBCB BCBBCCCBBBBCBCBCCCBBCCCBBBBCBBCC CBCBBBBCCCBBCBCCBBCBBBBCCCBBCCBC BCBCCCCCBBCCBBBBCCCCCCCBCCCCCCCC
result:
wrong answer your plan fails on CCBBBB
Subtask #4:
score: 0
Wrong Answer
Test #4:
score: 0
Wrong Answer
time: 3ms
memory: 72572kb
input:
7
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCB BCBBCCBCBCBBCCBBCCBCCCBBBCBCBCBCBCBBCCBCBCBBCCBBCBCBBCBCCCBBCCBB CBCCBBCBCBCCBBCBBBCBBBCCCBCBBBCBCBCCBBCCCBCBCBCCBCBCCBCBBBCCBBCB BCBBCCCCBBBBBCBCCCBCCBCBBBCCCBCCBCBBCCBBBCBCBCBBCBCBBCCCCBBBBCBC CBCBBBBBCCBCCBCCBBCBBBBCCBBBBCBBCBCCBCCC...
result:
wrong answer your plan fails on CCCCBBB
Subtask #5:
score: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 3ms
memory: 72008kb
input:
8
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCCCBCCBBCBCBCCBBCBBCBBCBCBBBCCBBCB BCBBCCBCBCBBCCBBCCBCCCBBBCBCBCBCBCBBCCBCBCBBCCBBCBCBBCBCCCBBCCBBCCBBCCBCBCBBCCBBCCBCCCBBBCBCBCBBBCBBCCBCBCBBCCBCCBCBBCBCCCBBCCBB CBCCBBCCCBCBBBCBBBCCBBCCCBCBBBCBCBCBBBCBCB...
result:
wrong answer your plan fails on CCBBBBBB
Subtask #6:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 73396kb
input:
9
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCB BCBBCCBCBCBBCCBBCCBCCCBBBCBCBCBCBCBBCCBCBCB...
result:
wrong answer your plan fails on CCCCBBBBB
Subtask #7:
score: 0
Wrong Answer
Test #7:
score: 0
Wrong Answer
time: 7ms
memory: 73296kb
input:
10
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCC...
result:
wrong answer your plan fails on CCBBBBBBBB
Subtask #8:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 7ms
memory: 73336kb
input:
11
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCBCCBCCBCBBBCC...
result:
wrong answer your plan fails on CCCCBBBBBBB
Subtask #9:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 4ms
memory: 72004kb
input:
12
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCBCCBCCBCBBBCC...
result:
wrong answer your plan fails on CCBBBBBBBBBB
Subtask #10:
score: 0
Wrong Answer
Test #10:
score: 0
Wrong Answer
time: 6ms
memory: 74420kb
input:
13
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCBCCBCCBCBBBCC...
result:
wrong answer your plan fails on CCCCBBBBBBBBB
Subtask #11:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 8ms
memory: 75872kb
input:
14
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCBCCBCCBCBBBCC...
result:
wrong answer your plan fails on CCBBBBBBBBBBBB
Subtask #12:
score: 0
Wrong Answer
Test #12:
score: 0
Wrong Answer
time: 12ms
memory: 76724kb
input:
15
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCBCCBCCBCBBBCC...
result:
wrong answer your plan fails on CCCCBBBBBBBBBBB
Subtask #13:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 42ms
memory: 84120kb
input:
16
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCBCCBCCBCBBBCC...
result:
wrong answer your plan fails on CCBBBBBBBBBBBBBB
Subtask #14:
score: 0
Wrong Answer
Test #14:
score: 0
Wrong Answer
time: 63ms
memory: 92552kb
input:
17
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCBCCBCCBCBBBCC...
result:
wrong answer your plan fails on CCCCBBBBBBBBBBBBB
Subtask #15:
score: 0
Wrong Answer
Test #15:
score: 0
Wrong Answer
time: 170ms
memory: 122516kb
input:
18
output:
CBCBBBCBCBCCBBCBBBCBBBCCCBCBCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCCCBCCBBCCCBCBBCBBCCBBCBCBBBCCCBCBCBCCBBCBCBCCBBCCBCBBCBCBBBCCCBCBCBCCBBCCCBCBBCBCBCBCCBCBBBCCBBCCBCBBCBCBBBCCBBCBCBCBBBCCCBCBBBCBBBCCBBCBCBCCCBCCBCBBCBCBBBCCBBCBBBCBBBCBCCBCCBCBBCBBCBCBBBCCCBCBCCBCCBCBBBCC...
result:
wrong answer your plan fails on CCBBBBBBBBBBBBBBBB