結果

問題 No.26 シャッフルゲーム
ユーザー fal_rndfal_rnd
提出日時 2017-08-08 18:55:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 141 ms / 5,000 ms
コード長 441 bytes
コンパイル時間 2,064 ms
コンパイル使用メモリ 78,192 KB
実行使用メモリ 41,828 KB
最終ジャッジ日時 2024-04-20 05:15:28
合計ジャッジ時間 3,864 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 112 ms
41,168 KB
testcase_01 AC 102 ms
40,124 KB
testcase_02 AC 127 ms
41,516 KB
testcase_03 AC 117 ms
41,480 KB
testcase_04 AC 121 ms
41,804 KB
testcase_05 AC 119 ms
41,816 KB
testcase_06 AC 119 ms
41,252 KB
testcase_07 AC 118 ms
41,084 KB
testcase_08 AC 132 ms
41,828 KB
testcase_09 AC 141 ms
41,620 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.util.stream.IntStream;
class M{
	static Scanner s=new Scanner(System.in);
	static int getInt(){return Integer.parseInt(s.next());}
	public static void main(String[]$){
		ArrayList<Character>l=new ArrayList<>();
		l.add('#');
		int n=getInt(),q=getInt();
		for(int i=1;i<=3;++i)
			l.add(i==n?'o':'x');
		for(int i=0;i<q;++i)
			Collections.swap(l,getInt(),getInt());
		System.out.println(l.indexOf('o'));
	}
}
0