結果
| 問題 | No.26 シャッフルゲーム |
| コンテスト | |
| ユーザー |
ちよちゃん
|
| 提出日時 | 2016-06-04 13:29:09 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
AC
|
| 実行時間 | 72 ms / 5,000 ms |
| コード長 | 1,334 bytes |
| 記録 | |
| コンパイル時間 | 2,291 ms |
| コンパイル使用メモリ | 82,068 KB |
| 実行使用メモリ | 47,280 KB |
| 最終ジャッジ日時 | 2026-04-24 14:14:35 |
| 合計ジャッジ時間 | 3,728 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 10 |
ソースコード
package yukicoder;
import java.util.Scanner;
public class Yuki26 {
public static void main(String[] args) {
Scanner sc = new Scanner(System.in);
// cup
int[] a = new int[3];
a[sc.nextInt()-1] = 1;
//入れ替える回数
int m = sc.nextInt();
for (int i=0; i<m; i++) {
int b = sc.nextInt()-1;
int c = sc.nextInt()-1;
int d = a[b];
a[b] = a[c];
a[c] = d;
}
sc.close();
for (int i =0; i<3; i++) {
if(a[i] == 1){
System.out.println(i+1);
}
}
/*
Scanner scan = new Scanner(System.in);
int num = scan.nextInt();
int changeCount = scan.nextInt();
int changeCupArray[][] = new int [changeCount][2];
for (int i = 0; i < changeCount;i++) {
for(int j = 0; j < 2; j++) {
changeCupArray[i][j] = scan.nextInt();
}
}
scan.close();
int pastValue = num;
for (int i = 0; i < changeCount;i++) {
for(int j = 0; j < 2; j++) {
if(changeCupArray[i][j] == pastValue ){
pastValue = changeCupArray[i][j];
}
}
}
System.out.println(pastValue);
*/
}
}
ちよちゃん