QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#504506 | #9107. Zayin and Count | Xunwuqishi# | WA | 37ms | 3620kb | C++23 | 1.1kb | 2024-08-04 13:35:20 | 2024-08-04 13:35:20 |
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[cb++] = i;
}
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;
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 37ms
memory: 3620kb
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'