QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#125172 | #4966. Decimal XOR | Amys4n | WA | 1ms | 3444kb | C++14 | 1.5kb | 2023-07-16 04:04:24 | 2023-07-16 04:04:28 |
Judging History
answer
#include <bits/stdc++.h>
using namespace std;
int main(){
string a, b, r = "";
cin >> a >> b;
if(b.size()>a.size()){
int j= a.size()-1;
for(int i=b.size()-1; i>=0; i--){
if(j!=-1){
if((((b[i]-'0') >= 7) and ((a[j]-'0') >=7)) or (((b[i]-'0') <= 2) and ((a[j]-'0') <=2))){
r = '0'+r;
} else{
r = '9'+r;
}
j--;
} else {
a = '0' + a;
j=0;
if((((b[i]-'0') >= 7) and ((a[j]-'0') >=7)) or (((b[i]-'0') <= 2) and ((a[j]-'0') <=2))){
r = '0'+r;
} else{
r = '9'+r;
}
}
}
} else{
int j= b.size()-1;
for(int i=a.size()-1; i>=0; i--){
if(j!=-1){
if((((a[i]-'0') >= 7) and ((b[j]-'0') >=7)) or (((a[i]-'0') <= 2) and ((b[j]-'0') <=2))){
r = '0'+r;
} else{
r = '9'+r;
}
j--;
} else {
b = '0' + b;
j=0;
cout << b[0] << " uw" << endl;
if((((a[i]-'0') >= 7) and ((b[j]-'0') >=7)) or (((a[i]-'0') <= 2) and ((b[j]-'0') <=2))){
r = '0'+r;
} else{
r = '9'+r;
}
}
}
}
cout << r << endl;
}
詳細信息
Test #1:
score: 100
Accepted
time: 0ms
memory: 3380kb
input:
22776 15954
output:
09099
result:
ok single line: '09099'
Test #2:
score: 0
Accepted
time: 1ms
memory: 3424kb
input:
29 18908
output:
09900
result:
ok single line: '09900'
Test #3:
score: -100
Wrong Answer
time: 0ms
memory: 3444kb
input:
18908 29
output:
0 uw 0 uw 09900
result:
wrong answer 1st lines differ - expected: '09900', found: '0 uw'