結果
問題 |
No.26 シャッフルゲーム
|
ユーザー |
![]() |
提出日時 | 2016-11-07 18:16:54 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 144 ms / 5,000 ms |
コード長 | 574 bytes |
コンパイル時間 | 1,934 ms |
コンパイル使用メモリ | 74,572 KB |
実行使用メモリ | 54,160 KB |
最終ジャッジ日時 | 2024-11-25 04:20:27 |
合計ジャッジ時間 | 4,036 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import java.util.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { boolean[] b = new boolean[4]; int n = sc.nextInt(); b[n] = true; int m = sc.nextInt(); for (int i = 0;i < m;i++) { int p = sc.nextInt(); int q = sc.nextInt(); boolean tmp = b[p]; b[p] = b[q]; b[q] = tmp; } for (int i = 1;i <= 3;i++) { if (b[i]) System.out.println(i); } } }