結果

問題 No.264 じゃんけん
ユーザー MaisuMaisu
提出日時 2017-12-15 15:52:30
言語 C#(csc)
(csc 3.9.0)
結果
AC  
実行時間 55 ms / 5,000 ms
コード長 705 bytes
コンパイル時間 1,888 ms
コンパイル使用メモリ 100,800 KB
実行使用メモリ 22,808 KB
最終ジャッジ日時 2023-08-21 06:42:31
合計ジャッジ時間 3,044 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 55 ms
20,804 KB
testcase_01 AC 55 ms
22,788 KB
testcase_02 AC 55 ms
22,724 KB
testcase_03 AC 54 ms
20,788 KB
testcase_04 AC 54 ms
20,692 KB
testcase_05 AC 54 ms
22,808 KB
testcase_06 AC 54 ms
22,740 KB
testcase_07 AC 54 ms
20,644 KB
testcase_08 AC 55 ms
22,732 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
Microsoft (R) Visual C# Compiler version 3.9.0-6.21124.20 (db94f4cc)
Copyright (C) Microsoft Corporation. All rights reserved.

ソースコード

diff #

// ぐー ちょき ぱー をそれぞれ 0 1 2
// Won, Drew, Lost
// 0 0 -> drew = 0
// 0 1 -> won = -1
// 0 2 -> lost = -2
// 1 0 -> lost = 1
// 1 1 -> drew = 0
// 1 2 -> won = -1
// 2 0 -> won = 2
// 2 1 -> lost = 1
// 2 2 -> drew = 0
using System;
public class Program {
  public static void Main() {
    string[] s = Console.ReadLine().Split(' ');
    int N = int.Parse(s[0]);
    int K = int.Parse(s[1]);

    if (N == K) {
      Console.WriteLine("Drew");
    } else if ((N == 0 && K == 1) || (N == 1 && K == 2) || (N == 2 && K == 0))  {
      Console.WriteLine("Won");
    } else if ((N == 0 && K == 2) || (N == 1 && K == 0) || (N == 2 && K == 1))  {
      Console.WriteLine("Lost");
    }
  }
}
0