結果

問題 No.201 yukicoderじゃんけん
ユーザー face4
提出日時 2019-09-08 17:00:44
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 3 ms / 5,000 ms
コード長 852 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 64,512 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-06-27 15:04:19
合計ジャッジ時間 1,205 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
using namespace std;

int main(){
    string s1, s2;
    string yf1, yf2;
    char hand1, hand2;
    cin >> s1 >> yf1 >> hand1;
    cin >> s2 >> yf2 >> hand2;
    if(yf1.size() == yf2.size()){
        if(yf1 == yf2){
            cout << "-1";
        }else{
            int one, two;
            for(int i = 0; i < yf1.size(); i++){
                one = (int)(yf1[i] - '0');
                two = (int)(yf2[i] - '0');
                if(one != two){
                    if(one > two){
                        cout << s1;
                    }else{
                        cout << s2;
                    }
                    break;
                }
            }
        }
    }else if(yf1.size() > yf2.size()){
        cout << s1;
    }else if(yf1.size() < yf2.size()){
        cout << s2;
    }
    cout << endl;
    return 0;
}
0