QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#270831#5161. Last Guessucup-team173#WA 1ms3648kbC++201.7kb2023-12-01 16:00:122023-12-01 16:00:12

Judging History

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

  • [2023-12-01 16:00:12]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3648kb
  • [2023-12-01 16:00:12]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#define mpr make_pair
#define pb push_back
#define fi first
#define se second

const int maxn=555;
int g,l;
string wd[maxn],fdb[maxn];
int lim[maxn],ty[maxn];//0:>=,1=
int ban[26][maxn];
char sure[maxn];
signed main(){
    ios::sync_with_stdio(0);
    cin.tie(0),cout.tie(0);
    cin>>g>>l;
    g--;
    for(int i=1;i<=g;i++){
        cin>>wd[i]>>fdb[i];
        vector<int>cnt(26),bk(26);
        for(int j=0;j<l;j++){
            if(fdb[i][j]=='G'){
                sure[j]=wd[i][j];
                cnt[wd[i][j]-'a']++;
            }
        }
        for(int j=0;j<l;j++){
            ban[wd[i][j]-'a'][j]=1;
            if(fdb[i][j]=='Y'){
                cnt[wd[i][j]-'a']++;
            }
            if(fdb[i][j]=='B'){
                ty[wd[i][j]-'a']=1;
                lim[wd[i][j]-'a']=cnt[wd[i][j]-'a'];
                bk[wd[i][j]-'a']=1;
            }
        }
        for(int j=0;j<26;j++){
            if(bk[j]==0){
                if(ty[j]==0){
                    lim[j]=max(lim[j],cnt[j]);
                }
            }
        }
    }
    for(int i=0;i<l;i++){
        if(sure[i])
        lim[sure[i]-'a']--;
    }
    for(int i=0;i<26;i++){
        for(int j=0;j<l;j++){
            if(ban[i][j]==0&&lim[i]&&sure[j]==0){
                sure[j]=i+'a';
                lim[i]--;
            }
        }
    }
    assert(*max_element(lim,lim+26)==0);
    for(int i=0;i<26;i++){
        for(int j=0;j<l;j++){
            if(sure[j]==0&&ban[i][j]==0&&ty[i]==0){
                sure[j]=i+'a';
            }
        }
    }
    cout<<sure<<"\n";
    return 0;
}

详细

Test #1:

score: 100
Accepted
time: 1ms
memory: 3524kb

input:

4 5
reply YYGBB
refer BBBGG
puppy YYGBB

output:

upper

result:

ok 

Test #2:

score: 0
Accepted
time: 0ms
memory: 3456kb

input:

2 12
aabbccddeeff GGGYGBYYYBBB

output:

aabdcbeadaaa

result:

ok 

Test #3:

score: -100
Wrong Answer
time: 1ms
memory: 3648kb

input:

25 500
qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqoqqqqqqqqqqqqqqqqqqqqqqoqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqjq...

output:

abcdefghijklmnoooprstuvwxyzaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

result:

FAIL Condition failed: "answer.size() == n"