結果
| 問題 |
No.26 シャッフルゲーム
|
| コンテスト | |
| ユーザー |
Maeda
|
| 提出日時 | 2025-08-25 14:55:49 |
| 言語 | Java (openjdk 23) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 650 bytes |
| コンパイル時間 | 1,986 ms |
| コンパイル使用メモリ | 77,572 KB |
| 実行使用メモリ | 48,188 KB |
| 最終ジャッジ日時 | 2025-08-25 14:55:54 |
| 合計ジャッジ時間 | 4,111 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | WA * 7 RE * 3 |
ソースコード
import java.util.*;
public class Main {
public static void main(String[] args) {
Scanner scan = new Scanner(System.in);
int now = scan.nextInt();
int changeCount = scan.nextInt();
String[] select = {"","",""};
select[now] = "〇";
for(int i = 0 ; i < changeCount ; i++){
int p = scan.nextInt() -1;
int q = scan.nextInt() -1;
if(select[p].equals("〇") || select[q].equals("〇")){
String nowSelect = select[p];
select[p] = select[q];
select[q] = nowSelect;
}
}
for(int i = 0 ; i < 3 ; i++){
if(select[i].equals("〇")){
System.out.println(i + 1);
break;
}
}
}
}
Maeda