QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#674190#9107. Zayin and Countucup-team5071#WA 10ms3604kbC++20756b2024-10-25 14:27:182024-10-25 14:27:19

Judging History

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

  • [2024-10-25 14:27:19]
  • 评测
  • 测评结果:WA
  • 用时:10ms
  • 内存:3604kb
  • [2024-10-25 14:27:18]
  • 提交

answer

#include <bits/stdc++.h>
using namespace std;
typedef __int128 ll;
string solve()
{
    vector<int>a,b;
    vector<int>ida(10),idb(10);
    for(int i=0,j=0;i<10;i++){
        int x;cin>>x;
        if(x)a.push_back(i),ida[i]=j++;
    }
    for(int i=0,j=0;i<10;i++){
        int x;cin>>x;
        if(x)b.push_back(i),idb[i]=j++;
    }
    string s;cin>>s;
    ll now=0;
    for(auto it:s)now=now*((ll)a.size())+ida[it-'0'];
    string ans;

    do{
        ans.push_back(b[now%((ll)b.size())]+'0');
        now/=(ll)b.size();
    }while(now>0);
    reverse(ans.begin(),ans.end());
    return ans;
}
int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    int T;cin>>T;while(T--)cout<<solve()<<"\n";
    return 0;
}

詳細信息

Test #1:

score: 0
Wrong Answer
time: 10ms
memory: 3604kb

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'