結果

問題 No.26 シャッフルゲーム
ユーザー kazapyon27kazapyon27
提出日時 2017-06-18 21:55:44
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 743 bytes
コンパイル時間 3,009 ms
コンパイル使用メモリ 80,380 KB
実行使用メモリ 50,768 KB
最終ジャッジ日時 2024-04-09 20:16:32
合計ジャッジ時間 4,155 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
50,532 KB
testcase_01 AC 53 ms
50,496 KB
testcase_02 WA -
testcase_03 AC 56 ms
50,588 KB
testcase_04 AC 56 ms
50,588 KB
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 54 ms
50,176 KB
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

/*No.26 シャッフルゲーム*/
import java.io.*;
public class No26 {
	public static void main(String[] args) {
		try(BufferedReader input =new BufferedReader(new InputStreamReader(System.in))){
			String place = input.readLine();
			byte counter =Byte.parseByte(input.readLine());
			String h_ChageCup[] = new String[2];
			String s_ChageCup;
			for(byte i=0;i<counter;i++){
				h_ChageCup=input.readLine().split(" ");
				s_ChageCup=h_ChageCup[0]+h_ChageCup[1];
				switch(s_ChageCup.indexOf(place)){
					case 0:
						place=h_ChageCup[1];
						break;
					case 1:
						place=h_ChageCup[0];
						break;						
					case -1:
						break;
				}
			}
			System.out.println(place);
		}catch(Exception e){
			e.printStackTrace();
		}		
	}
}
0