結果

問題 No.365 ジェンガソート
ユーザー 37zigen37zigen
提出日時 2016-04-30 00:00:54
言語 Java21
(openjdk 21)
結果
AC  
実行時間 637 ms / 2,000 ms
コード長 426 bytes
コンパイル時間 2,049 ms
コンパイル使用メモリ 73,908 KB
実行使用メモリ 49,000 KB
最終ジャッジ日時 2024-04-20 06:42:38
合計ジャッジ時間 17,841 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 129 ms
41,352 KB
testcase_01 AC 138 ms
41,488 KB
testcase_02 AC 132 ms
41,380 KB
testcase_03 AC 129 ms
41,220 KB
testcase_04 AC 131 ms
41,352 KB
testcase_05 AC 132 ms
41,384 KB
testcase_06 AC 131 ms
41,552 KB
testcase_07 AC 132 ms
41,232 KB
testcase_08 AC 131 ms
41,720 KB
testcase_09 AC 131 ms
41,056 KB
testcase_10 AC 130 ms
41,384 KB
testcase_11 AC 130 ms
41,588 KB
testcase_12 AC 131 ms
41,452 KB
testcase_13 AC 140 ms
41,372 KB
testcase_14 AC 134 ms
41,284 KB
testcase_15 AC 137 ms
41,436 KB
testcase_16 AC 564 ms
48,616 KB
testcase_17 AC 563 ms
48,536 KB
testcase_18 AC 253 ms
46,804 KB
testcase_19 AC 598 ms
48,800 KB
testcase_20 AC 366 ms
47,716 KB
testcase_21 AC 363 ms
47,880 KB
testcase_22 AC 542 ms
48,340 KB
testcase_23 AC 469 ms
48,132 KB
testcase_24 AC 574 ms
48,584 KB
testcase_25 AC 343 ms
48,124 KB
testcase_26 AC 506 ms
48,224 KB
testcase_27 AC 608 ms
48,448 KB
testcase_28 AC 523 ms
48,376 KB
testcase_29 AC 500 ms
47,360 KB
testcase_30 AC 517 ms
48,180 KB
testcase_31 AC 376 ms
48,104 KB
testcase_32 AC 334 ms
46,764 KB
testcase_33 AC 577 ms
48,580 KB
testcase_34 AC 308 ms
47,900 KB
testcase_35 AC 550 ms
48,372 KB
testcase_36 AC 532 ms
48,224 KB
testcase_37 AC 525 ms
48,096 KB
testcase_38 AC 637 ms
48,696 KB
testcase_39 AC 587 ms
49,000 KB
testcase_40 AC 576 ms
48,172 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package yukicoder;
import java.util.Scanner;
public class Main{
	public static void main(String[] args)throws Exception{
		new Main().solve();
	}
	void solve(){
		Scanner sc=new Scanner (System.in);
		int n=sc.nextInt();
		int[] a=new int[n];
		for(int i=0;i<n;i++){
			a[i]=sc.nextInt();
		}
		int max=n;
		int count=0;
		for(int i=n-1;i>=0;i--){
			if(max==a[i])max--;
			else count++;
		}
		System.out.println(count);
	}
}
0