結果

問題 No.201 yukicoderじゃんけん
ユーザー swdamdrswdamdr
提出日時 2017-01-26 10:16:26
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 60 ms / 5,000 ms
コード長 1,011 bytes
コンパイル時間 1,962 ms
コンパイル使用メモリ 104,560 KB
実行使用メモリ 22,704 KB
最終ジャッジ日時 2023-08-24 23:18:17
合計ジャッジ時間 4,028 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,720 KB
testcase_01 AC 55 ms
20,596 KB
testcase_02 AC 54 ms
20,560 KB
testcase_03 AC 50 ms
20,532 KB
testcase_04 AC 51 ms
20,656 KB
testcase_05 AC 57 ms
20,736 KB
testcase_06 AC 55 ms
20,692 KB
testcase_07 AC 55 ms
22,704 KB
testcase_08 AC 57 ms
20,728 KB
testcase_09 AC 57 ms
18,684 KB
testcase_10 AC 51 ms
22,508 KB
testcase_11 AC 55 ms
20,464 KB
testcase_12 AC 56 ms
22,508 KB
testcase_13 AC 57 ms
20,668 KB
testcase_14 AC 51 ms
20,432 KB
testcase_15 AC 54 ms
22,560 KB
testcase_16 AC 59 ms
20,656 KB
testcase_17 AC 57 ms
20,640 KB
testcase_18 AC 57 ms
20,440 KB
testcase_19 AC 60 ms
20,644 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;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args)
    {
        string[] a = Console.ReadLine().Split();
        string[] b = Console.ReadLine().Split();

        string pa = a[1];
        string pb = b[1];

        if (pa == pb)
        {
            Console.WriteLine(-1);
            return;
        }

        if (pa.Length > pb.Length)
        {
            Console.WriteLine(a[0]);
            return;
        }
        if(pa.Length < pb.Length)
        {
            Console.WriteLine(b[0]);
            return;
        }

        for (int i = 0; i < pa.Length; i++)
        {
            if (int.Parse(pa[i].ToString()) > int.Parse(pb[i].ToString()))
            {
                Console.WriteLine(a[0]);
                return;
            }

            if (int.Parse(pa[i].ToString()) < int.Parse(pb[i].ToString()))
            {
                Console.WriteLine(b[0]);
                return;
            }
        }

    }
}

0