結果
問題 | No.26 シャッフルゲーム |
ユーザー |
![]() |
提出日時 | 2015-02-26 16:17:47 |
言語 | Java (openjdk 23) |
結果 |
AC
|
実行時間 | 166 ms / 5,000 ms |
コード長 | 314 bytes |
コンパイル時間 | 2,051 ms |
コンパイル使用メモリ | 74,068 KB |
実行使用メモリ | 42,276 KB |
最終ジャッジ日時 | 2024-06-23 23:48:34 |
合計ジャッジ時間 | 4,560 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 10 |
ソースコード
import java.util.Scanner;public class Main {public static void main(String[] a) {Scanner s=new Scanner(System.in);int[] C=new int[4];C[s.nextInt()]=1;s.nextInt();while(s.hasNext()){int i=s.nextInt(),j=s.nextInt(),t=C[i];C[i]=C[j];C[j]=t;}System.out.println(C[1]>0?1:C[2]>0?2:3);}}