結果

問題 No.201 yukicoderじゃんけん
ユーザー face4
提出日時 2018-04-22 21:46:02
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 860 bytes
コンパイル時間 500 ms
コンパイル使用メモリ 66,300 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-27 07:04:00
合計ジャッジ時間 1,334 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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" << endl;
        }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