結果

問題 No.26 シャッフルゲーム
ユーザー fal_rndfal_rnd
提出日時 2017-08-08 18:55:29
言語 Java19
(openjdk 21)
結果
AC  
実行時間 131 ms / 5,000 ms
コード長 441 bytes
コンパイル時間 2,667 ms
コンパイル使用メモリ 82,724 KB
実行使用メモリ 55,996 KB
最終ジャッジ日時 2023-08-02 05:14:53
合計ジャッジ時間 4,623 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 106 ms
55,000 KB
testcase_01 AC 111 ms
55,996 KB
testcase_02 AC 131 ms
55,376 KB
testcase_03 AC 115 ms
55,460 KB
testcase_04 AC 116 ms
55,440 KB
testcase_05 AC 128 ms
55,164 KB
testcase_06 AC 125 ms
55,648 KB
testcase_07 AC 117 ms
55,828 KB
testcase_08 AC 127 ms
55,436 KB
testcase_09 AC 125 ms
55,436 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