結果

問題 No.264 じゃんけん
コンテスト
ユーザー yugi0922
提出日時 2020-06-20 14:57:45
言語 Java
(openjdk 25.0.2)
コンパイル:
javac -encoding UTF8 _filename_
実行:
java -ea -Xmx700m -Xss256M -DONLINE_JUDGE=true _class_
結果
AC  
実行時間 54 ms / 5,000 ms
コード長 1,116 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,261 ms
コンパイル使用メモリ 83,144 KB
実行使用メモリ 41,536 KB
最終ジャッジ日時 2026-03-25 01:10:34
合計ジャッジ時間 5,291 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import static java.lang.System.*;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.util.Scanner;

public class JanKen {
	public static void main(String[] args) throws IOException {
        Scanner sc = new Scanner(System.in);
		BufferedReader reader = new BufferedReader(new InputStreamReader(in));
		String[] inputs = reader.readLine().split(" ");
		String myHand = inputs[0];
		String enemyHand = inputs[1];
		String judge = "";
		if(myHand.equals("0")){
			switch(enemyHand){
				case "0":
					judge = "Drew";
					break;
				case "1":
					judge = "Won";
					break;
				case "2":
					judge = "Lost";
					break;

			}
		}
		if(myHand.equals("1")){
			switch(enemyHand){
				case "0":
					judge = "Lost";
					break;
				case "1":
					judge = "Drew";
					break;
				case "2":
					judge = "Won";
					break;

			}
		}
		if(myHand.equals("2")){
			switch(enemyHand){
				case "0":
					judge = "Won";
					break;
				case "1":
					judge = "Lost";
					break;
				case "2":
					judge = "Drew";
					break;

			}
		}
		System.out.println(judge);
	}
}
0