結果

問題 No.365 ジェンガソート
ユーザー Daigo HIROOKADaigo HIROOKA
提出日時 2018-07-04 02:27:40
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 450 bytes
コンパイル時間 5,213 ms
コンパイル使用メモリ 72,940 KB
実行使用メモリ 71,640 KB
最終ジャッジ日時 2023-09-13 17:24:55
合計ジャッジ時間 29,798 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 123 ms
55,660 KB
testcase_01 AC 125 ms
56,296 KB
testcase_02 AC 124 ms
55,792 KB
testcase_03 AC 127 ms
55,964 KB
testcase_04 AC 126 ms
55,664 KB
testcase_05 AC 124 ms
55,672 KB
testcase_06 AC 125 ms
53,980 KB
testcase_07 AC 124 ms
56,032 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 126 ms
55,680 KB
testcase_15 AC 137 ms
55,432 KB
testcase_16 TLE -
testcase_17 TLE -
testcase_18 AC 346 ms
60,020 KB
testcase_19 TLE -
testcase_20 AC 417 ms
60,296 KB
testcase_21 WA -
testcase_22 TLE -
testcase_23 WA -
testcase_24 TLE -
testcase_25 WA -
testcase_26 WA -
testcase_27 TLE -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class No365{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		ArrayList<Integer> a = new ArrayList<Integer>();
		for(int i = 0; i < n; i++){
			a.add(sc.nextInt());
		}
		int count = 0;
		int idx = 0;
		for(int i = 0; i < n; i++){
			if(a.get(idx) != i+1){
				a.remove(a.indexOf(i+1));
				count++;
			}else{
				idx++;
			}
		}
		System.out.println(count);
	}
}
0