結果

問題 No.264 じゃんけん
ユーザー 水野嶺水野嶺
提出日時 2020-05-18 09:58:52
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 897 bytes
コンパイル時間 1,955 ms
コンパイル使用メモリ 74,736 KB
実行使用メモリ 54,360 KB
最終ジャッジ日時 2024-04-09 21:26:44
合計ジャッジ時間 3,679 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
53,080 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 108 ms
52,752 KB
testcase_05 AC 106 ms
52,972 KB
testcase_06 AC 123 ms
54,140 KB
testcase_07 AC 119 ms
54,332 KB
testcase_08 AC 118 ms
54,360 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.lang.*;
import java.io.*;

class Main
{
	public static void main (String[] args) 
	{
		// 出力値の設定
		String kati = "Won";
		String make = "Lost";
		String hikiwake = "Drew";
		
		// 入力値の読み込み
		Scanner sc = new Scanner(System.in);
		int k = sc.nextInt();
		int h = sc.nextInt();
		
		// 引き分け判定
		if( k == h ){
			System.out.println(hikiwake);
		}else{
			// 場合分け
			switch(k){
			// 自分がぐー
			case 0:
				if( h == 1){
				System.out.println(kati);
				}else if( h == 2){
				System.out.println(make);
				}
				
			// 自分がちょき
			case 1:
				if( h == 2){
				System.out.println(kati);
				}else if( h == 0){
				System.out.println(make);
				}
				
			// 自分がぱー
			case 2:
				if( h == 0){
				System.out.println(kati);
				}else if( h == 1){
				System.out.println(make);
				}
			}
		}
	}
}
0