結果

問題 No.264 じゃんけん
ユーザー 水野嶺水野嶺
提出日時 2020-05-18 10:06:28
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 930 bytes
コンパイル時間 1,813 ms
コンパイル使用メモリ 80,724 KB
実行使用メモリ 54,260 KB
最終ジャッジ日時 2024-04-09 21:26:49
合計ジャッジ時間 3,488 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 116 ms
54,260 KB
testcase_01 AC 117 ms
54,180 KB
testcase_02 AC 120 ms
54,004 KB
testcase_03 AC 120 ms
54,204 KB
testcase_04 AC 120 ms
53,776 KB
testcase_05 AC 120 ms
54,240 KB
testcase_06 AC 119 ms
54,052 KB
testcase_07 AC 117 ms
53,996 KB
testcase_08 AC 108 ms
52,988 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);
				}
				break;
				
			// 自分がちょき
			case 1:
				if( h == 2){
				System.out.println(kati);
				}else if( h == 0){
				System.out.println(make);
				}
				break;
				
			// 自分がぱー
			case 2:
				if( h == 0){
				System.out.println(kati);
				}else if( h == 1){
				System.out.println(make);
				}
				break;
			}
		}
	}
}
0