結果

問題 No.201 yukicoderじゃんけん
ユーザー kmtrc130kmtrc130
提出日時 2017-05-17 15:06:17
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 26 ms / 5,000 ms
コード長 844 bytes
コンパイル時間 1,744 ms
コンパイル使用メモリ 108,904 KB
実行使用メモリ 24,144 KB
最終ジャッジ日時 2023-10-17 15:03:07
合計ジャッジ時間 3,139 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
24,072 KB
testcase_01 AC 23 ms
24,132 KB
testcase_02 AC 22 ms
24,068 KB
testcase_03 AC 22 ms
23,860 KB
testcase_04 AC 22 ms
23,852 KB
testcase_05 AC 23 ms
24,140 KB
testcase_06 AC 23 ms
24,140 KB
testcase_07 AC 22 ms
24,132 KB
testcase_08 AC 23 ms
24,136 KB
testcase_09 AC 23 ms
24,136 KB
testcase_10 AC 21 ms
23,852 KB
testcase_11 AC 22 ms
24,144 KB
testcase_12 AC 23 ms
24,144 KB
testcase_13 AC 23 ms
24,136 KB
testcase_14 AC 22 ms
23,852 KB
testcase_15 AC 22 ms
23,840 KB
testcase_16 AC 23 ms
24,112 KB
testcase_17 AC 23 ms
24,112 KB
testcase_18 AC 26 ms
24,124 KB
testcase_19 AC 25 ms
24,112 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.Linq;

class Program
{
    static void Main(string[] args)
    {
        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; }
        }
    }
}
0