結果

問題 No.26 シャッフルゲーム
ユーザー kazapyon27kazapyon27
提出日時 2017-06-18 22:07:09
言語 Java21
(openjdk 21)
結果
AC  
実行時間 57 ms / 5,000 ms
コード長 747 bytes
コンパイル時間 3,035 ms
コンパイル使用メモリ 76,612 KB
実行使用メモリ 50,608 KB
最終ジャッジ日時 2024-04-09 20:16:40
合計ジャッジ時間 4,185 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
50,504 KB
testcase_01 AC 55 ms
50,448 KB
testcase_02 AC 57 ms
50,508 KB
testcase_03 AC 55 ms
50,572 KB
testcase_04 AC 55 ms
50,604 KB
testcase_05 AC 55 ms
50,496 KB
testcase_06 AC 55 ms
50,400 KB
testcase_07 AC 55 ms
50,432 KB
testcase_08 AC 54 ms
50,440 KB
testcase_09 AC 55 ms
50,608 KB
権限があれば一括ダウンロードができます

ソースコード

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();
			Short counter =Short.parseShort(input.readLine());
			String h_ChageCup[] = new String[2];
			String s_ChageCup;
			for(Short 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