QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#564078#1806. Character Gridship2077WA 0ms3696kbC++23572b2024-09-14 19:45:252024-09-14 19:45:25

Judging History

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

  • [2024-09-14 19:45:25]
  • 评测
  • 测评结果:WA
  • 用时:0ms
  • 内存:3696kb
  • [2024-09-14 19:45:25]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
char ans[14][14];
int mp[255][255];
int main(){
	puts("13");
	for (int i=0;i<13;i++) ans[0][i]='a'+i;
	for (int i=1;i<13;i++)
		for (int j=0;j<13;j++)
			for (char ch='a';ch<='z';ch++){
				bool flag=1;
				if (i&&mp[ans[i-1][j]][ch]) flag=0;
				if (j&&mp[ans[i][j-1]][ch]) flag=0;
				if (flag){
					ans[i][j]=ch;
					if (i) mp[ans[i-1][j]][ch]=1;
					if (j) mp[ans[i][j-1]][ch]=1;
					break;
				}
			}
	for (int i=0;i<13;puts(""),i++)
		for (int j=0;j<13;j++)
			putchar(ans[i][j]);
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 3696kb

input:



output:

13
abcdefghijklm
abacbccdadbdd
eefegfgehffhg
aibjajbkakdid
gghclelcmemcj
ijhkfnanboaof
epbiifpcpdqbm
chnhllgqarcrf
imgohjkgsatbq
khpeqinlbuavd
jriresdkscwax
gmogteuklsfya
niprdvbtiqocz

result:

wrong answer wrong answer