QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#120929 | #4327. Šeširi | xtqqwq# | 14 | 0ms | 3808kb | C++17 | 1.4kb | 2023-07-07 12:46:24 | 2024-07-04 00:28:54 |
Judging History
answer
#include<bits/stdc++.h>
#define pb push_back
#define fi first
#define se second
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
template <typename T> bool chkmin(T &x,T y){return x>y?x=y,1:0;}
template <typename T> bool chkmax(T &x,T y){return x<y?x=y,1:0;}
int readint(){
int x=0,f=1; char ch=getchar();
while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
return x*f;
}
int n;
int a[105][105];
int main(){
n=readint();
string t[4];
t[0]="11010100";
t[1]="10001110";
t[2]="00101011";
t[3]="01110001";
for(int i=0;i<4;i++) for(int j=0;j<8;j++) a[i][j]=t[i][j]-'0';
if(n==4){
for(int i=0;i<4;i++){
for(int j=0;j<8;j++) putchar(a[i][j]?'C':'B');
putchar('\n');
}
}
else if(n==5){
for(int i=0;i<5;i++){
for(int j=0;j<16;j++){
if(i<4) putchar(a[i][j>>1]?'C':'B');
else{
int num[2]={0},cor[2]={0};
for(int k=0;k<4;k++){
num[(j>>(4-k-1))&1]++;
int mask=0;
for(int l=0;l<4;l++) if(k!=l) mask=mask<<1|((j>>(4-l-1))&1);
cor[(j>>(4-k-1))&1]+=a[k][mask]==((j>>(4-k-1))&1);
}
if(cor[0]<(num[0]+1)/2) putchar('B');
else putchar('C');
}
}
putchar('\n');
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 7
Accepted
Test #1:
score: 7
Accepted
time: 0ms
memory: 3580kb
input:
4
output:
CCBCBCBB CBBBCCCB BBCBCBCC BCCCBBBC
result:
ok good plan!
Subtask #2:
score: 7
Accepted
Test #2:
score: 7
Accepted
time: 0ms
memory: 3516kb
input:
5
output:
CCCCBBCCBBCCBBBB CCBBBBBBCCCCCCBB BBBBCCBBCCBBCCCC BBCCCCCCBBBBBBCC CCCCBCCCBCCCCBBC
result:
ok good plan!
Subtask #3:
score: 0
Wrong Answer
Test #3:
score: 0
Wrong Answer
time: 0ms
memory: 3576kb
input:
6
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #4:
score: 0
Wrong Answer
Test #4:
score: 0
Wrong Answer
time: 0ms
memory: 3576kb
input:
7
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #5:
score: 0
Wrong Answer
Test #5:
score: 0
Wrong Answer
time: 0ms
memory: 3808kb
input:
8
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #6:
score: 0
Wrong Answer
Test #6:
score: 0
Wrong Answer
time: 0ms
memory: 3572kb
input:
9
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #7:
score: 0
Wrong Answer
Test #7:
score: 0
Wrong Answer
time: 0ms
memory: 3576kb
input:
10
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #8:
score: 0
Wrong Answer
Test #8:
score: 0
Wrong Answer
time: 0ms
memory: 3768kb
input:
11
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #9:
score: 0
Wrong Answer
Test #9:
score: 0
Wrong Answer
time: 0ms
memory: 3512kb
input:
12
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #10:
score: 0
Wrong Answer
Test #10:
score: 0
Wrong Answer
time: 0ms
memory: 3764kb
input:
13
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #11:
score: 0
Wrong Answer
Test #11:
score: 0
Wrong Answer
time: 0ms
memory: 3512kb
input:
14
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #12:
score: 0
Wrong Answer
Test #12:
score: 0
Wrong Answer
time: 0ms
memory: 3568kb
input:
15
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #13:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 0ms
memory: 3592kb
input:
16
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #14:
score: 0
Wrong Answer
Test #14:
score: 0
Wrong Answer
time: 0ms
memory: 3808kb
input:
17
output:
result:
wrong output format Unexpected end of file - token expected
Subtask #15:
score: 0
Wrong Answer
Test #15:
score: 0
Wrong Answer
time: 0ms
memory: 3536kb
input:
18
output:
result:
wrong output format Unexpected end of file - token expected