QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#240444 | #1806. Character Grid | laosong | AC ✓ | 0ms | 3352kb | C++14 | 929b | 2023-11-05 15:30:26 | 2023-11-05 15:30:26 |
Judging History
answer
#include <bits/stdc++.h>
#define IOS ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define INF 0x3f3f3f3f
#define PI acos(-1.0)
#define mm(a,b) memset(a,b,sizeof(a))
//priority_queue<int,vector<int>,greater<int>>q;//升序队列
//priority_queue<int,vector<int>,less<int>>q;//降序队列
using namespace std;
typedef long long ll;
typedef pair<int,int> PII;
const int maxn=300010;
const int mod=1e9+7;
int v[30][30];
int a[15][15];
void solve(){
a[1][1]=1;
for(int i=1;i<=13;i++){
for(int j=1;j<=13;j++){
for(int k=1;k<=26;k++){
if(!v[a[i][j-1]][k]&&!v[a[i-1][j]][k]){
v[a[i][j-1]][k]=v[a[i-1][j]][k]=1;
a[i][j]=k;
break;
}
}
}
}
cout<<"13"<<endl;
for(int i=1;i<=13;i++){
for(int j=1;j<=13;j++){
cout<<(char)(a[i][j]-1+'a');
}
cout<<endl;
}
}
int main(){
IOS;
int _=1;
// cin>>_;while(_--)
{
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 0ms
memory: 3352kb
input:
output:
13 abcdefghijklm naacbbdadbeae ofhcfifjdgcge pakhdhegiaibh qlbjjfkfcmgkg rcleildmjaoap sejlikkcnqbrb tdogminkjcodn ulhlfocphqepd vlnpfnremdqgr woiprfpnbsasg xjqirqjmmhtbq ypksitrkooktf
result:
ok accepted