結果

問題 No.201 yukicoderじゃんけん
ユーザー kmtrc130kmtrc130
提出日時 2019-03-18 16:50:46
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 61 ms / 5,000 ms
コード長 962 bytes
コンパイル時間 2,813 ms
コンパイル使用メモリ 102,016 KB
実行使用メモリ 22,880 KB
最終ジャッジ日時 2023-09-25 14:26:57
合計ジャッジ時間 4,761 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,716 KB
testcase_01 AC 56 ms
18,796 KB
testcase_02 AC 57 ms
22,832 KB
testcase_03 AC 52 ms
20,488 KB
testcase_04 AC 52 ms
20,596 KB
testcase_05 AC 57 ms
22,748 KB
testcase_06 AC 56 ms
22,808 KB
testcase_07 AC 56 ms
20,788 KB
testcase_08 AC 57 ms
20,712 KB
testcase_09 AC 57 ms
20,660 KB
testcase_10 AC 52 ms
20,496 KB
testcase_11 AC 59 ms
22,880 KB
testcase_12 AC 59 ms
20,792 KB
testcase_13 AC 57 ms
20,772 KB
testcase_14 AC 51 ms
20,436 KB
testcase_15 AC 51 ms
18,628 KB
testcase_16 AC 56 ms
22,736 KB
testcase_17 AC 56 ms
20,692 KB
testcase_18 AC 61 ms
20,716 KB
testcase_19 AC 57 ms
20,696 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

using System;
using System.Collections.Generic;
using System.Linq;

class Program
{
    public void Solve()
    {
        string[] ASPX = Console.ReadLine().Split(' ');
        string[] BSPX = Console.ReadLine().Split(' ');

        string ap = ASPX[1];
        string bp = BSPX[1];

        if (ap == bp) { Console.WriteLine(-1); }
        if (ap.Length != bp.Length)
        {
            if (ap.Length > bp.Length) { Console.WriteLine(ASPX[0]); return; }
            else { Console.WriteLine(BSPX[0]); return; }
        }
        for (int i = 0; i < ap.Length; i++)
        {
            if (int.Parse(ap.Substring(i, 1)) == int.Parse(bp.Substring(i, 1))) { continue; }

            if (int.Parse(ap.Substring(i, 1)) > int.Parse(bp.Substring(i, 1))) { Console.WriteLine(ASPX[0]); break; }
            else { Console.WriteLine(BSPX[0]); break; }
        }
    }

    static void Main()
    {
        var solver = new Program();
        solver.Solve();
    }
}
0