QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#564078 | #1806. Character Grid | ship2077 | WA | 0ms | 3696kb | C++23 | 572b | 2024-09-14 19:45:25 | 2024-09-14 19:45:25 |
Judging History
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