結果
| 問題 | No.365 ジェンガソート |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2018-07-04 02:27:40 |
| 言語 | Java (openjdk 25.0.2) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 450 bytes |
| 記録 | |
| コンパイル時間 | 2,376 ms |
| コンパイル使用メモリ | 84,936 KB |
| 実行使用メモリ | 59,920 KB |
| 最終ジャッジ日時 | 2026-08-02 23:15:45 |
| 合計ジャッジ時間 | 20,860 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 14 WA * 19 TLE * 5 -- * 3 |
ソースコード
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);
}
}