結果
| 問題 | No.365 ジェンガソート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-04 02:27:40 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 3,400 ms |
| コンパイル使用メモリ | 83,204 KB |
| 実行使用メモリ | 129,052 KB |
| 最終ジャッジ日時 | 2026-03-21 18:18:25 |
| 合計ジャッジ時間 | 42,544 ms |
|
ジャッジサーバーID (参考情報) |
judge2_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 20 TLE * 7 |
ソースコード
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);
}
}