QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#471276 | #9107. Zayin and Count | real_sigma_team# | WA | 2ms | 3508kb | C++23 | 1.2kb | 2024-07-10 20:16:40 | 2024-07-10 20:16:41 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
#ifdef lisie_bimbi
#else
#define endl '\n'
#endif
//#define int long long
#pragma GCC optimize("O2")
void solve(){
int a1 = -1, a2 = -1, b1 = -1, b2 = -1;
string _;
cin >> _;
for(int i = 0; i < 10; i++){
int a = _[i] - '0';
if(a){
a = i;
}
if(a > a1){
a2 = a1;
a1 = a;
}else if(a > a2){
a2 = a;
}
}
cin >> _;
for(int i = 0; i < 10; i++){
int b = _[i] - '0';
if(b){
b = i;
}
if(b > b1){
b2 = b1;
b1 = b;
}else if(b > b2){
b2 = b;
}
}
string s;
cin >> s;
for(auto i : s){
if(i - '0' == a1){
cout << b1;
}else{
cout << b2;
}
}
cout << endl;
}
signed main(){
#ifdef lisie_bimbi
freopen("input.txt", "r", stdin);
freopen("output.txt", "w", stdout);
#else
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
#endif
int t;
cin >> t;
while(t--){
solve();
}
}
詳細信息
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 3508kb
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:
8 8 8 8 8 8 988898988888888888888888888888 8 8 8 8 8 8 88888888888888888888888888 8 8 8 8 8 8 88888888888888888888888888 8 8 8 8 8 8 888888888888888888888888888888 8 8 8 8 8 8 88888888888888888888888888 8 8 8 8 8 8 888888888888888888888888888888 8 8 8 8 8 8 888888888888888888888888888888 8 8 8 8 8 8...
result:
wrong answer 1st lines differ - expected: '52755244567262766742575722', found: '8'