QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#181740#6644. Red Black Griducup-team134#WA 0ms3824kbC++14626b2023-09-16 23:13:562023-09-16 23:13:56

Judging History

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

  • [2023-09-16 23:13:56]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3824kb
  • [2023-09-16 23:13:56]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;

const int N=1050;
char ans[N][N];
int main(){
	int t;
	scanf("%i",&t);
	while(t--){
		int n,k;
		scanf("%i %i",&n,&k);
		if(k%2==1){
			printf("Impossible\n");
			continue;
		}
		int now=0;
		ans[1][1]='R';
		char c='R';
		for(int sm=3;sm<=2*n;sm++){
			int z=min(sm-2,2*n-sm+1)*2;
			if(now+z<=k){
				now+=z;
				if(c=='R')c='B';
				else c='R';
			}
			for(int i=max(1,sm-n);i<=n&&sm-i>=1;i++){
				ans[i][sm-i]=c;
			}
		}
		printf("Possible\n");
		for(int i=1;i<=n;i++){
			ans[i][n+1]=0;
			printf("%s\n",ans[i]+1);
		}
	}
	return 0;
}

詳細信息

Test #1:

score: 100
Accepted
time: 0ms
memory: 3824kb

input:

2
3 6
3 1

output:

Possible
RBR
BRR
RRR
Impossible

result:

ok correct! (2 test cases)

Test #2:

score: -100
Wrong Answer
time: 0ms
memory: 3824kb

input:

4424
1 0
2 4
2 3
2 2
2 1
2 0
3 12
3 11
3 10
3 9
3 8
3 7
3 6
3 5
3 4
3 3
3 2
3 1
3 0
4 24
4 23
4 22
4 21
4 20
4 19
4 18
4 17
4 16
4 15
4 14
4 13
4 12
4 11
4 10
4 9
4 8
4 7
4 6
4 5
4 4
4 3
4 2
4 1
4 0
5 40
5 39
5 38
5 37
5 36
5 35
5 34
5 33
5 32
5 31
5 30
5 29
5 28
5 27
5 26
5 25
5 24
5 23
5 22
5 21
5...

output:

Possible
R
Possible
RB
BR
Impossible
Possible
RB
BB
Impossible
Possible
RR
RR
Possible
RBR
BRB
RBR
Impossible
Possible
RBR
BRB
RBB
Impossible
Possible
RBR
BRR
RRB
Impossible
Possible
RBR
BRR
RRR
Impossible
Possible
RBB
BBB
BBR
Impossible
Possible
RBB
BBB
BBB
Impossible
Possible
RRR
RRR
RRR
Possible
...

result:

wrong answer Condition failed: "A == B" (test case 10)