結果
| 問題 | No.26 シャッフルゲーム | 
| コンテスト | |
| ユーザー |  TatsuDX | 
| 提出日時 | 2016-09-08 23:32:02 | 
| 言語 | Java (openjdk 23) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 171 ms / 5,000 ms | 
| コード長 | 455 bytes | 
| コンパイル時間 | 3,261 ms | 
| コンパイル使用メモリ | 74,904 KB | 
| 実行使用メモリ | 54,436 KB | 
| 最終ジャッジ日時 | 2024-11-15 22:26:54 | 
| 合計ジャッジ時間 | 5,468 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 10 | 
ソースコード
import java.util.Scanner;
public class Test {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] t = new int[3];
		t[sc.nextInt() - 1] = 1;
		int n = sc.nextInt(), a, b, tmp;
		for (int i = 0; i < n; i++) {
			a = sc.nextInt() - 1;
			b = sc.nextInt() - 1;
			tmp = t[a];
			t[a] = t[b];
			t[b] = tmp;
		}
		for (int i = 0; i < 3; i++) {
			if (t[i] == 1) {
				System.out.println(i + 1);
				return;
			}
		}
	}
}
            
            
            
        