結果

問題 No.26 シャッフルゲーム
ユーザー yagi2
提出日時 2017-04-26 11:48:10
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 2,157 ms
コンパイル使用メモリ 74,168 KB
実行使用メモリ 54,804 KB
最終ジャッジ日時 2024-09-13 14:01:07
合計ジャッジ時間 4,237 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 6 WA * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder.No26;

import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);

        int circle = Integer.parseInt(sc.next());
        int M = Integer.parseInt(sc.next());

        for (int i = 0; i < M; i++) {
            int b = Integer.parseInt(sc.next());
            int a = Integer.parseInt(sc.next());

            if (b == circle) {
                circle = a;
            }
        }
        System.out.println(circle);
    }
}
0