結果

問題 No.201 yukicoderじゃんけん
ユーザー taktak
提出日時 2018-06-14 00:37:02
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 53 ms / 5,000 ms
コード長 763 bytes
コンパイル時間 2,534 ms
コンパイル使用メモリ 105,528 KB
実行使用メモリ 22,664 KB
最終ジャッジ日時 2023-09-13 04:02:25
合計ジャッジ時間 4,106 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 49 ms
20,628 KB
testcase_01 AC 51 ms
20,632 KB
testcase_02 AC 50 ms
18,552 KB
testcase_03 AC 53 ms
20,704 KB
testcase_04 AC 50 ms
20,564 KB
testcase_05 AC 51 ms
20,588 KB
testcase_06 AC 51 ms
22,636 KB
testcase_07 AC 50 ms
18,516 KB
testcase_08 AC 50 ms
20,520 KB
testcase_09 AC 50 ms
20,620 KB
testcase_10 AC 51 ms
20,632 KB
testcase_11 AC 52 ms
20,676 KB
testcase_12 AC 51 ms
20,588 KB
testcase_13 AC 51 ms
20,504 KB
testcase_14 AC 53 ms
22,572 KB
testcase_15 AC 53 ms
22,664 KB
testcase_16 AC 51 ms
18,560 KB
testcase_17 AC 51 ms
20,692 KB
testcase_18 AC 50 ms
20,568 KB
testcase_19 AC 52 ms
20,600 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using static System.Console;
class Simple {
    public static void Main(string[] args) { new Simple().Solve(); }
    string Sa, Pa, Xa;
    string Sb, Pb, Xb;
    int isAwin(string pa, string pb) {
        if (pa.Length != pb.Length) return pa.Length > pb.Length ? 1 : -1;
        for (var i = 0; i < pa.Length; ++i)
            if (pa[i] != pb[i]) return pa[i] > pb[i] ? 1 : -1;
        return 0;
    }
    void Solve() {
        var line1 = ReadLine().Split();
        var line2 = ReadLine().Split();
        Sa = line1[0];
        Pa = line1[1];
        Xa = line1[2];
        Sb = line2[0];
        Pb = line2[1];
        Xb = line2[2];
        var tmp = isAwin(Pa, Pb);
        var ans = tmp == 1 ? Sa : tmp == -1 ? Sb : "-1";
        WriteLine(ans);
    }
}
0