結果
問題 |
No.26 シャッフルゲーム
|
ユーザー |
![]() |
提出日時 | 2016-06-03 15:03:46 |
言語 | Java (openjdk 23) |
結果 |
WA
|
実行時間 | - |
コード長 | 654 bytes |
コンパイル時間 | 3,250 ms |
コンパイル使用メモリ | 74,104 KB |
実行使用メモリ | 54,320 KB |
最終ジャッジ日時 | 2024-10-08 06:18:21 |
合計ジャッジ時間 | 5,792 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 6 WA * 4 |
ソースコード
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); } }