結果

問題 No.201 yukicoderじゃんけん
ユーザー aketijyuuzou
提出日時 2024-10-10 23:32:18
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 2,052 bytes
コンパイル時間 886 ms
コンパイル使用メモリ 114,916 KB
実行使用メモリ 27,024 KB
最終ジャッジ日時 2024-10-10 23:32:21
合計ジャッジ時間 2,489 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 20
権限があれば一括ダウンロードができます
コンパイルメッセージ
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;

class Program
{
    static string InputPattern = "InputX";

    static List<string> GetInputList()
    {
        var WillReturn = new List<string>();

        if (InputPattern == "Input1") {
            WillReturn.Add("Alice 114 R");
            WillReturn.Add("Bob 514 S");
            //Bob
            //普通のじゃんけんならば
            //R(グー)を出したAliceがS(チョキ)を出したBobに勝ちますが、
            //これはyukicoderじゃんけんなのでゆるふわポイントの多いBobの勝ちです。
        }
        else if (InputPattern == "Input2") {
            WillReturn.Add("touritsu 99999999999999999999 P");
            WillReturn.Add("Peter 99999999999999999998 R");
            //touritsu
            //ゆるふわガチ勢のtouritsuさんとPeterさんの戦いです。
            //僅差ですがtouritsuさんの勝ちです。
        }
        else if (InputPattern == "Input3") {
            WillReturn.Add("Taro 0 R");
            WillReturn.Add("Hanako 0 S");
            //-1
            //まだ初心者の二人はゆるふわポイントを持っていません。
            //0ポイント同士で引き分けです。 
        }
        else {
            string wkStr;
            while ((wkStr = Console.ReadLine()) != null) WillReturn.Add(wkStr);
        }
        return WillReturn;
    }

    static void Main()
    {
        List<string> InputList = GetInputList();

        string[] wkArr = { };
        Action<string> SplitAct = (pStr) => wkArr = pStr.Split(' ');

        SplitAct(InputList[0]); string SA = wkArr[0], PA = wkArr[1];
        SplitAct(InputList[1]); string SB = wkArr[0], PB = wkArr[1];

        int MaxLen = Math.Max(PA.Length, PB.Length);
        PA = PA.PadLeft(MaxLen, '0');
        PB = PB.PadLeft(MaxLen, '0');

        int Comp = PA.CompareTo(PB);
        if (Comp > 0) Console.WriteLine(SA);
        if (Comp < 0) Console.WriteLine(SB);
        if (Comp == 0) Console.WriteLine(-1);
    }
}

0