QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#504794#9107. Zayin and Countwtn135687#WA 12ms3488kbC++201.0kb2024-08-04 16:01:462024-08-04 16:01:46

Judging History

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

  • [2024-08-04 16:01:46]
  • 评测
  • 测评结果:WA
  • 用时:12ms
  • 内存:3488kb
  • [2024-08-04 16:01:46]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using lll = __int128;
const int N = 1e6+10,mo=1e9+7;
#define int ll
#define endl '\n'
signed main(){
    ios::sync_with_stdio(false),cin.tie(0),cout.tie(0);
	int TT;cin>>TT;
    while(TT--){
        vector<int>a(10),b(10),pa(10),pb(10);
        int ca=0,cb=0;
        for(int i=0;i<10;i++){
            cin>>a[i];
            if(a[i])pa[i]=ca++;
        }
        for(int i=0;i<10;i++){
            cin>>b[i];
            if(b[i])pb[cb++]=i;
        }
        string s;cin>>s;
        lll k=0;
        for(char c:s){
            // cerr<<"c="<<c<<"\n";
            // cerr<<"pa[c]="<<pa[c-'0']<<"\n";
            k=k*ca+pa[c-'0'];
        }
        // cerr<<"k="<<k<<"\n";
        
        string ans;
        if(!k)ans+=(pb[0]+'0');
        while(k){
            int g=k%cb;
            ans+=(char)(pb[g]+'0');
            k/=cb;
        }
        assert(ans.size());
        reverse(ans.begin(),ans.end());
        cout<<ans<<"\n";
    }
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 0
Wrong Answer
time: 12ms
memory: 3488kb

input:

10000
1 0 0 0 1 1 0 0 0 1
0 0 1 0 1 1 1 1 0 0
950595954440050004054505054050
1 0 0 0 1 1 1 1 0 0
1 1 1 0 1 0 0 0 1 1
45467007076660767550460064
1 1 1 1 0 0 0 1 0 0
1 1 0 1 1 0 1 0 0 1
23373171320213300170200722
0 0 0 0 1 1 1 0 1 0
0 0 1 0 0 1 0 1 1 1
558565664666565565558468668484
1 1 0 0 1 0 1 0 1 ...

output:

65266455722475422254727242
41990991999414091249949
101364364636933104003903
57259252998225997772927975
878555885282288227752558252252
610010606760761011770006661017
68888858668556558688868865568855558868
51566165566155616511615666156611165656
505885888775005550558080707878
3333916221911699323366319
...

result:

wrong answer 1st lines differ - expected: '52755244567262766742575722', found: '65266455722475422254727242'