結果

問題 No.201 yukicoderじゃんけん
ユーザー face4face4
提出日時 2018-04-22 21:46:02
言語 C++14
(gcc 13.2.0 + boost 1.83.0)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 860 bytes
コンパイル時間 583 ms
コンパイル使用メモリ 65,884 KB
実行使用メモリ 4,388 KB
最終ジャッジ日時 2023-09-09 14:09:13
合計ジャッジ時間 1,723 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 1 ms
4,376 KB
testcase_02 WA -
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 2 ms
4,380 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 2 ms
4,380 KB
testcase_09 AC 1 ms
4,380 KB
testcase_10 AC 2 ms
4,376 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 2 ms
4,376 KB
testcase_14 AC 2 ms
4,376 KB
testcase_15 AC 2 ms
4,376 KB
testcase_16 AC 2 ms
4,376 KB
testcase_17 AC 2 ms
4,376 KB
testcase_18 WA -
testcase_19 AC 2 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

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