結果

問題 No.26 シャッフルゲーム
ユーザー ちよちゃんちよちゃん
提出日時 2016-06-03 15:03:46
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 654 bytes
コンパイル時間 4,367 ms
コンパイル使用メモリ 74,456 KB
実行使用メモリ 42,052 KB
最終ジャッジ日時 2024-04-16 23:31:01
合計ジャッジ時間 5,689 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
41,224 KB
testcase_01 AC 124 ms
41,708 KB
testcase_02 AC 164 ms
41,976 KB
testcase_03 WA -
testcase_04 AC 137 ms
41,520 KB
testcase_05 WA -
testcase_06 AC 152 ms
42,048 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 158 ms
41,780 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;

import java.util.Scanner;

public class Yuki26 {
	
	public static void main(String[] args) {		
		Scanner scan = new Scanner(System.in);
		int num = scan.nextInt();
		int changeCount = scan.nextInt();

		int changeCupArray[][] = new int [changeCount][2];
		
		for (int i = 0; i < changeCount;i++) {
			for(int j = 0; j < 2; j++) {
				changeCupArray[i][j] = scan.nextInt();
			}
		}
		scan.close();		
		
		int pastValue = num;
		for (int i = 0; i < changeCount;i++) {
			for(int j = 0; j < 2; j++) {
				if(changeCupArray[i][0] == pastValue ){
					pastValue = changeCupArray[i][1];
				}
			}
		}
		System.out.println(pastValue);
	}
}
0