QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#120934#4327. Šeširixtqqwq#14 1ms3712kbC++172.0kb2023-07-07 12:48:182024-07-04 00:29:00

Judging History

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

  • [2024-07-04 00:29:00]
  • 评测
  • 测评结果:14
  • 用时:1ms
  • 内存:3712kb
  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-07 12:48:18]
  • 提交

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');
		}
	}
	else if(n==6){
		for(int i=0;i<6;i++){
			for(int j=0;j<32;j++){
				if(i<4) putchar(a[i][j>>2]?'C':'B');
				else{
					int x=j>>1;
					int num[2]={0},cor[2]={0};
					for(int k=0;k<4;k++){
						num[(x>>(4-k-1))&1]++;
						int mask=0;
						for(int l=0;l<4;l++) if(k!=l) mask=mask<<1|((x>>(4-l-1))&1);
						cor[(x>>(4-k-1))&1]+=a[k][mask]==((x>>(4-k-1))&1);
					}
					if(cor[0]<(num[0]+1)/2){
						if(i==4) putchar('B');
						else putchar(j&1?'B':'C');
					}
					else{
						if(i==4) putchar('C');
						else putchar(j&1?'B':'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: 1ms
memory: 3468kb

input:

4

output:

CCBCBCBB
CBBBCCCB
BBCBCBCC
BCCCBBBC

result:

ok good plan!

Subtask #2:

score: 7
Accepted

Test #2:

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

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: 3456kb

input:

6

output:

CCCCCCCCBBBBCCCCBBBBCCCCBBBBBBBB
CCCCBBBBBBBBBBBBCCCCCCCCCCCCBBBB
BBBBBBBBCCCCBBBBCCCCBBBBCCCCCCCC
BBBBCCCCCCCCCCCCBBBBBBBBBBBBCCCC
CCCCCCCCBBCCCCCCBBCCCCCCCCBBBBCC
CBCBCBCBCBCBCBCBCBCBCBCBCBCBCBCB

result:

wrong answer your plan fails on BBBBBB

Subtask #4:

score: 0
Wrong Answer

Test #4:

score: 0
Wrong Answer
time: 1ms
memory: 3536kb

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: 3452kb

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: 3688kb

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: 3668kb

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: 3696kb

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: 3676kb

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: 3708kb

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: 1ms
memory: 3500kb

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: 3576kb

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: 3516kb

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: 3668kb

input:

18

output:


result:

wrong output format Unexpected end of file - token expected