QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#125172#4966. Decimal XORAmys4nWA 1ms3444kbC++141.5kb2023-07-16 04:04:242023-07-16 04:04:28

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2023-07-16 04:04:28]
  • 评测
  • 测评结果:WA
  • 用时:1ms
  • 内存:3444kb
  • [2023-07-16 04:04:24]
  • 提交

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'