結果

問題 No.26 シャッフルゲーム
ユーザー fal_rndfal_rnd
提出日時 2017-08-08 18:55:29
言語 Java21
(openjdk 21)
結果
AC  
実行時間 163 ms / 5,000 ms
コード長 441 bytes
コンパイル時間 2,370 ms
コンパイル使用メモリ 78,312 KB
実行使用メモリ 41,668 KB
最終ジャッジ日時 2024-10-12 00:15:21
合計ジャッジ時間 4,486 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,004 KB
testcase_01 AC 127 ms
41,496 KB
testcase_02 AC 163 ms
41,280 KB
testcase_03 AC 136 ms
41,600 KB
testcase_04 AC 139 ms
41,668 KB
testcase_05 AC 142 ms
41,088 KB
testcase_06 AC 145 ms
41,628 KB
testcase_07 AC 137 ms
41,364 KB
testcase_08 AC 147 ms
41,560 KB
testcase_09 AC 151 ms
41,580 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