結果
問題 |
No.26 シャッフルゲーム
|
ユーザー |
|
提出日時 | 2018-03-04 16:49:54 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 178 ms / 5,000 ms |
コード長 | 465 bytes |
コンパイル時間 | 3,431 ms |
コンパイル使用メモリ | 74,368 KB |
実行使用メモリ | 54,272 KB |
最終ジャッジ日時 | 2024-07-08 01:56:16 |
合計ジャッジ時間 | 5,742 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
package m.shin; import java.util.Scanner; public class Con26 { public static void main(String[] args) { Scanner s = new Scanner(System.in); int[] cup = new int[3]; int N = s.nextInt() , M = s.nextInt(); cup[N-1] = 1; for(int i = 0;i < M;i++){ int p = s.nextInt() , q = s.nextInt() , d = cup[q-1]; cup[q-1] = cup[p-1]; cup[p-1] = d; } s.close(); for(int i = 0;i < 3;i++){ if(cup[i] == 1){ System.out.println(i+1); } } } }