QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#355205 | #7882. Linguistics Puzzle | BUET_POTATOES# | WA | 1ms | 3544kb | C++20 | 795b | 2024-03-16 14:29:11 | 2024-03-16 14:29:12 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
char getp(int x){
if(x >= 26)return 'A' + x - 26;
return 'a' + x;
}
void solv(int ces){
int n;
cin >> n;
vector<string> v(n * n);
for(auto &x : v)cin >> x;
vector<int> imp(n);
for(auto x : v){
if(x.size() == 1)continue;
if(isupper(x[0]))imp[x[0] - 'A' + 26] = 1;
else imp[x[0] - 'a'] = 1;
}
int x = 0;
while(imp[x] == 1)x++;
cout << getp(x);
for(int i = 0; i < n; i++){
if(i == x)continue;
cout << getp(i);
}
cout << "\n";
}
int main(){
ios::sync_with_stdio(false);
cin.tie(NULL);
int tc = 1;
cin>>tc;
for(int ces=1; ces<=tc; ces++){
solv(ces);
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 1ms
memory: 3544kb
input:
2 3 a b a b b b b c cc 4 d d d d d c b a d b cd cb d a cb bc
output:
abc abcd
result:
wrong answer The product 0*2=0 is not in the output at case #1