結果
| 問題 | No.26 シャッフルゲーム |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-05-19 03:22:06 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 78 ms / 5,000 ms |
| コード長 | 444 bytes |
| 記録 | |
| コンパイル時間 | 2,708 ms |
| コンパイル使用メモリ | 82,484 KB |
| 実行使用メモリ | 47,360 KB |
| 最終ジャッジ日時 | 2026-03-27 16:44:41 |
| 合計ジャッジ時間 | 4,099 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
import java.util.*;
public class Shaffle{
public static void main(String[] arg){
int n,m,a,b,temp,res=0;
int[] cap={0,0,0};
Scanner sc = new Scanner(System.in);
n = sc.nextInt();
m = sc.nextInt();
cap[n-1]=1;
for(int i = 0;i<m;i++){
a = sc.nextInt();
b = sc.nextInt();
temp = cap[a-1];
cap[a-1] = cap[b-1];
cap[b-1] = temp;
}
for(int i = 0;i<3;i++){
if(cap[i]==1)res=i+1;
}
System.out.println(res);
}
}