結果

問題 No.26 シャッフルゲーム
ユーザー chiho_miyakochiho_miyako
提出日時 2015-04-07 21:03:29
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 2,076 ms
コンパイル使用メモリ 72,756 KB
実行使用メモリ 57,628 KB
最終ジャッジ日時 2023-09-17 15:57:37
合計ジャッジ時間 4,430 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
56,000 KB
testcase_01 AC 124 ms
56,024 KB
testcase_02 AC 148 ms
57,628 KB
testcase_03 WA -
testcase_04 AC 141 ms
55,468 KB
testcase_05 WA -
testcase_06 AC 146 ms
56,136 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 165 ms
55,720 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        Scanner koko = new Scanner(System.in);
        int m = koko.nextInt();
        int n = koko.nextInt();
        int[] p = new int[n];
        int[] q = new int[n];
        for(int i=0; i<n; i++){
            p[i] = koko.nextInt();
            q[i] = koko.nextInt();
            if(m==p[i]){
                m=q[i];
            }
        }
        System.out.println(m);
        
    }
}
0