QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#504482 | #9107. Zayin and Count | Xunwuqishi# | WA | 26ms | 3780kb | C++23 | 1.1kb | 2024-08-04 13:24:29 | 2024-08-04 13:24:33 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#define lowbit(x) x&(-x)
#define int long long
const int N = 1e6+10;
int INF = 1e9;
//int mod = 1e9+7;
//int mod = 1e9+7;
//int ways[4][2] = {{1,0},{-1,0},{0,1},{0,-1}};
int n,m;
int a[20],b[20];
map<int,int> ma,mb;
string ta;
void solve() {
ma.clear();
mb.clear();
for(int i = 0;i<=9;i++) cin>>a[i];
int ca = 0;
for(int i = 0;i<=9;i++){
if(a[i]) ma[i] = ca++;
}
for(int i = 0;i<=9;i++) cin>>b[i];
int cb = 0;
for(int i = 0;i<=9;i++){
if(b[i]) mb[i] = cb++;
}
cin>>ta;
int num = 0;
for(int i = 0;i<ta.size();i++){
num = num*ma.size() + ma[ta[i]-'0'];
}
string ans = "";
while(num){
ans = (char)(mb[num%mb.size()]+'0') + ans;
num /= mb.size();
}
cout<<ans<<endl;
return;
}
signed main() {
std::ios::sync_with_stdio(false);
cin.tie(0);
cout.tie(0);
//cout<<fixed<<setprecision(8);
int caset = 1;
cin>>caset;
for(int i = 1;i<=caset;i++){
//cout<<"Case "<<i<<": "<<endl;
solve();
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 0
Wrong Answer
time: 26ms
memory: 3780kb
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:
304041100003000200020 10203052000001003130 10030000040200031210 00000001300010000000 0001010010000000000000 100000110110003000000 1001000001000000000000 00200001101010010000000 001010001200000000000 0402001200010210300 001000000000000000000 10040002241331415565 23000121202000003000 00000100110000001...
result:
wrong answer 1st lines differ - expected: '52755244567262766742575722', found: '304041100003000200020'