結果

問題 No.3032 Unavailability of Inequality Signs
ユーザー keikei
提出日時 2018-04-01 22:35:55
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 1,463 bytes
コンパイル時間 1,555 ms
コンパイル使用メモリ 167,528 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-09-08 12:45:14
合計ジャッジ時間 2,418 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,384 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 1 ms
4,380 KB
testcase_05 AC 1 ms
4,380 KB
testcase_06 AC 1 ms
4,380 KB
testcase_07 AC 2 ms
4,384 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include "bits/stdc++.h"
using namespace std;
typedef long long ll;

void solve(){
    int N; scanf("%d",&N);
    for(int i = 0; i != N;i++){
        int a,b;
        scanf("%d%d",&a,&b);
        if(a==b){
            putchar('=');
            putchar('\n');
            continue;
        }
        string sa = to_string(a), sb = to_string(b);
        int digit = 10;
        while(sa.length()!=digit){
            sa.insert(sa.begin(), '0');
        }
        while(sb.length()!=digit){
            sb.insert(sb.begin(), '0');
        }
        for(int j = 0; j !=digit;j++){
            if(sa[j] == '0' && sb[j] == '0'){ continue; }
            if(sa[j] == sb[j]) continue;
            if(sa[j] != '0' && sb[j] == '0'){
                putchar(62);
                putchar('\n');
            }else if(sa[j] == '0' && sb[j] != '0'){
                putchar(60);
                putchar('\n');
            }else if(sa[j] !='0' && sb[j] != '0'){
                int ta = sa[j] - '0',tb = sb[j] - '0';
                
                int tta = ta;
                while((tta != tb) && (tta != digit)){ tta++; }
                if(tta == digit){
                    putchar(62);
                    putchar('\n');
                }else{
                    putchar(60);
                    putchar('\n');
                }
            }
            break;
        }
    }
}
int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    solve();
    return 0;
}
0