結果

問題 No.293 4>7の世界
ユーザー 👑 CleyLCleyL
提出日時 2020-01-17 13:32:22
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 516 bytes
コンパイル時間 578 ms
コンパイル使用メモリ 64,256 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-25 15:48:48
合計ジャッジ時間 1,420 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3 WA * 1
other AC * 18 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
    string a,b;cin>>a>>b;

    if(a.size() != b.size()){
        cout << (a.size()<b.size()?b:a) << endl;
    }else{
        for(int i = 0; a.size() > i; i++){
            if(a[i] != b[i]){
                if((a[i]=='4' && b[i] == '7') || a[i] > b[i]){
                    cout << a << endl;
                    return 0;
                }else{
                    cout << b << endl;
                    return 0;
                }
            }
        }
    }
}
0