結果

問題 No.26 シャッフルゲーム
ユーザー yagi2yagi2
提出日時 2017-04-26 11:48:10
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 523 bytes
コンパイル時間 1,945 ms
コンパイル使用メモリ 72,232 KB
実行使用メモリ 58,220 KB
最終ジャッジ日時 2023-10-11 15:11:21
合計ジャッジ時間 4,211 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 121 ms
55,516 KB
testcase_01 AC 118 ms
55,836 KB
testcase_02 AC 138 ms
55,660 KB
testcase_03 WA -
testcase_04 AC 125 ms
56,376 KB
testcase_05 WA -
testcase_06 AC 132 ms
55,908 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 143 ms
55,488 KB
権限があれば一括ダウンロードができます

ソースコード

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