結果
| 問題 | No.26 シャッフルゲーム |
| コンテスト | |
| ユーザー |
tenten
|
| 提出日時 | 2020-11-10 10:04:54 |
| 言語 | Java (openjdk 26.0.2.1 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 75 ms / 5,000 ms |
| + 551µs | |
| コード長 | 647 bytes |
| 記録 | |
| コンパイル時間 | 1,346 ms |
| コンパイル使用メモリ | 83,740 KB |
| 実行使用メモリ | 46,468 KB |
| 最終ジャッジ日時 | 2026-08-23 10:46:50 |
| 合計ジャッジ時間 | 3,351 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
boolean[] hasBall = new boolean[4];
hasBall[sc.nextInt()] = true;
int m = sc.nextInt();
for (int i = 0; i < m; i++) {
int left = sc.nextInt();
int right = sc.nextInt();
boolean tmp = hasBall[left];
hasBall[left] = hasBall[right];
hasBall[right] = tmp;
}
for (int i = 1; i < 4; i++) {
if (hasBall[i]) {
System.out.println(i);
return;
}
}
}
}
tenten