結果

問題 No.26 シャッフルゲーム
ユーザー ちよちゃん
提出日時 2016-06-03 15:58:10
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 653 bytes
コンパイル時間 3,091 ms
コンパイル使用メモリ 74,384 KB
実行使用メモリ 56,164 KB
最終ジャッジ日時 2024-10-08 06:19:06
合計ジャッジ時間 5,347 ms
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 2 WA * 8
権限があれば一括ダウンロードができます

ソースコード

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][j] == pastValue ){
					pastValue = changeCupArray[i][j];
				}
			}
		}
		System.out.println(pastValue);
	}
}
0