結果

問題 No.26 シャッフルゲーム
ユーザー ちよちゃんちよちゃん
提出日時 2016-06-03 15:58:10
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 653 bytes
コンパイル時間 3,520 ms
コンパイル使用メモリ 78,312 KB
実行使用メモリ 42,004 KB
最終ジャッジ日時 2024-04-16 23:31:18
合計ジャッジ時間 5,841 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 123 ms
39,984 KB
testcase_02 WA -
testcase_03 AC 147 ms
41,576 KB
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
権限があれば一括ダウンロードができます

ソースコード

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