QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#355205#7882. Linguistics PuzzleBUET_POTATOES#WA 1ms3544kbC++20795b2024-03-16 14:29:112024-03-16 14:29:12

Judging History

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

  • [2024-03-16 14:29:12]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3544kb
  • [2024-03-16 14:29:11]
  • 提交

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