結果

問題 No.264 じゃんけん
ユーザー syusyu
提出日時 2020-08-25 18:29:24
言語 Java21
(openjdk 21)
結果
AC  
実行時間 114 ms / 5,000 ms
コード長 987 bytes
コンパイル時間 2,156 ms
コンパイル使用メモリ 79,156 KB
実行使用メモリ 41,376 KB
最終ジャッジ日時 2024-04-24 04:44:36
合計ジャッジ時間 3,421 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 111 ms
41,376 KB
testcase_01 AC 109 ms
40,076 KB
testcase_02 AC 107 ms
40,112 KB
testcase_03 AC 109 ms
41,324 KB
testcase_04 AC 110 ms
41,168 KB
testcase_05 AC 114 ms
41,296 KB
testcase_06 AC 107 ms
40,032 KB
testcase_07 AC 108 ms
39,996 KB
testcase_08 AC 111 ms
41,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        int myHand=sc.nextInt();
        int yourHand=sc.nextInt();
        
        String result="";
        //0はグー、1はチョキ、2はパー
        if(myHand==0){
            if(yourHand==0){
                result="Drew";
            }else if(yourHand==1){
                result="Won";
            }else{
                result="Lost";
            }
        }else if(myHand==1){
            if(yourHand==0){
                result="Lost";
            }else if(yourHand==1){
                result="Drew";
            }else{
                result="Won";
            }
        }else{
            if(yourHand==0){
                result="Won";
            }else if(yourHand==1){
                result="Lost";
            }else{
                result="Drew";
            }
        }
        System.out.println(result);
        
        
    }
}
0