結果
| 問題 | No.26 シャッフルゲーム |
| コンテスト | |
| ユーザー |
abc
|
| 提出日時 | 2016-10-20 13:24:04 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 74 ms / 5,000 ms |
| コード長 | 628 bytes |
| 記録 | |
| コンパイル時間 | 2,256 ms |
| コンパイル使用メモリ | 81,484 KB |
| 実行使用メモリ | 43,136 KB |
| 最終ジャッジ日時 | 2026-05-17 07:46:11 |
| 合計ジャッジ時間 | 4,123 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
int initialCircle =sc.nextInt();
int numChange = sc.nextInt();
int currentCircle = initialCircle;
for (int i = 0; i < numChange; i++) {
int from = sc.nextInt();
int to = sc.nextInt();
if (from == currentCircle) {
currentCircle = to;
} else if (to == currentCircle) {
currentCircle = from;
}
}
System.out.println(currentCircle);
}
}
abc