QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#465818 | #9107. Zayin and Count | grass8cow# | WA | 15ms | 3768kb | C++17 | 643b | 2024-07-07 10:33:22 | 2024-07-07 10:33:22 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
char c[70];
int t1,t2,r1[13],r2[13],b1[13],b2[13];
void sol(){
t1=t2=0;
for(int i=0,a;i<10;i++){
scanf("%d",&a);
if(a)r1[i]=t1,b1[t1]=i,t1++;
}
for(int i=0,a;i<10;i++){
scanf("%d",&a);
if(a)r2[i]=t2,b2[t2]=i,t2++;
}
scanf("%s",c);__int128 x=0;int L=strlen(c);
for(int i=0;i<L;i++)x=x*t1+r1[c[i]-'0'];
printf("%d\n",(int)x);
L=0;
while(x)
c[L++]='0'+b2[x%t2],x/=t2;
for(int i=L-1;i>=0;i--)putchar(c[i]);
puts("");
}
int main(){
int T;scanf("%d",&T);while(T--)sol();
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 15ms
memory: 3768kb
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:
19276360 65266455722475422254727242 1167380659 41990991999414091249949 -1534438874 101364364636933104003903 1499249356 57259252998225997772927975 -1030655740 878555885282288227752558252252 1173367367 610010606760761011770006661017 -951573871 68888858668556558688868865568855558868 -1311338847 5156616...
result:
wrong answer 1st lines differ - expected: '52755244567262766742575722', found: '19276360'