結果

問題 No.3032 Unavailability of Inequality Signs
ユーザー keikei
提出日時 2018-04-01 22:29:33
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 1,430 bytes
コンパイル時間 1,715 ms
コンパイル使用メモリ 165,544 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-08 12:43:17
合計ジャッジ時間 3,009 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

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){
            printf("=\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] != '0' && sb[j] == '0'){
                printf("%c\n",(char)(62));
                break;
            }
            if(sa[j] == '0' && sb[j] != '0'){
                printf("%c\n",(char)(60));
                break;
            }
            if(sa[j] !='0' && sb[j] != '0'){
                int ta = sa[j] - '0';
                int tb = sb[j] - '0';
                
                int tta = ta;
                while(tta != tb && (tta != digit)){
                    tta++;
                }
                if(tta == digit){
                    printf("%c\n",(char)(62));
                }else{
                    printf("%c\n",(char)(60));
                }
                break;
            }
        }
    }
}
int main(void) {
    cin.tie(0); ios::sync_with_stdio(false);
    solve();
    return 0;
}
0