結果

問題 No.26 シャッフルゲーム
ユーザー chiho_miyako
提出日時 2015-04-07 21:03:29
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 496 bytes
コンパイル時間 2,175 ms
コンパイル使用メモリ 74,104 KB
実行使用メモリ 41,884 KB
最終ジャッジ日時 2024-07-04 10:55:09
合計ジャッジ時間 3,940 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 4
権限があれば一括ダウンロードができます

ソースコード

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