結果

問題 No.264 じゃんけん
ユーザー HaleakalaHaleakala
提出日時 2018-02-18 16:51:57
言語 Java21
(openjdk 21)
結果
AC  
実行時間 120 ms / 5,000 ms
コード長 899 bytes
コンパイル時間 3,290 ms
コンパイル使用メモリ 72,544 KB
実行使用メモリ 56,364 KB
最終ジャッジ日時 2023-09-12 16:33:44
合計ジャッジ時間 5,123 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
55,912 KB
testcase_01 AC 120 ms
55,816 KB
testcase_02 AC 116 ms
55,744 KB
testcase_03 AC 115 ms
55,552 KB
testcase_04 AC 116 ms
55,948 KB
testcase_05 AC 115 ms
56,364 KB
testcase_06 AC 114 ms
55,556 KB
testcase_07 AC 115 ms
56,172 KB
testcase_08 AC 118 ms
55,420 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Answer {
	public static void main(String str[]) {
        Scanner sc = new Scanner(System.in);

        //ぐー, ちょき, ぱーをそれぞれ 0, 1, 2とし、1つ目に自分のが2つ目に相手のが与えられます。
        int me = Integer.valueOf(sc.next());
        int you = Integer.valueOf(sc.next());

        if(me == you) {
        	System.out.println("Drew");
        } else if(me == 0 && you == 1){
        	System.out.println("Won");
        } else if(me == 0 && you == 2){
        	System.out.println("Lost");
        } else if(me == 1 && you == 0){
        	System.out.println("Lost");
        } else if(me == 1 && you == 2){
        	System.out.println("Won");
        } else if(me == 2 && you == 0){
        	System.out.println("Won");
        } else if(me == 2 && you == 1){
        	System.out.println("Lost");
        }
	}
}
0