結果

問題 No.365 ジェンガソート
ユーザー juger_jvjuger_jv
提出日時 2016-05-01 23:49:13
言語 Java21
(openjdk 21)
結果
AC  
実行時間 211 ms / 2,000 ms
コード長 501 bytes
コンパイル時間 1,843 ms
コンパイル使用メモリ 74,344 KB
実行使用メモリ 60,708 KB
最終ジャッジ日時 2024-04-20 07:05:01
合計ジャッジ時間 7,791 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 50 ms
50,328 KB
testcase_01 AC 50 ms
49,896 KB
testcase_02 AC 50 ms
50,020 KB
testcase_03 AC 51 ms
49,896 KB
testcase_04 AC 51 ms
49,916 KB
testcase_05 AC 50 ms
50,332 KB
testcase_06 AC 51 ms
50,300 KB
testcase_07 AC 48 ms
49,864 KB
testcase_08 AC 48 ms
50,336 KB
testcase_09 AC 48 ms
50,312 KB
testcase_10 AC 49 ms
50,324 KB
testcase_11 AC 48 ms
49,864 KB
testcase_12 AC 48 ms
50,216 KB
testcase_13 AC 49 ms
50,260 KB
testcase_14 AC 50 ms
50,300 KB
testcase_15 AC 48 ms
50,044 KB
testcase_16 AC 170 ms
57,872 KB
testcase_17 AC 193 ms
60,708 KB
testcase_18 AC 86 ms
51,880 KB
testcase_19 AC 173 ms
60,236 KB
testcase_20 AC 118 ms
54,244 KB
testcase_21 AC 111 ms
53,924 KB
testcase_22 AC 168 ms
57,860 KB
testcase_23 AC 133 ms
57,400 KB
testcase_24 AC 160 ms
58,120 KB
testcase_25 AC 104 ms
52,068 KB
testcase_26 AC 139 ms
58,048 KB
testcase_27 AC 183 ms
60,656 KB
testcase_28 AC 141 ms
57,148 KB
testcase_29 AC 173 ms
60,196 KB
testcase_30 AC 146 ms
57,996 KB
testcase_31 AC 110 ms
53,940 KB
testcase_32 AC 107 ms
54,176 KB
testcase_33 AC 194 ms
60,276 KB
testcase_34 AC 106 ms
52,184 KB
testcase_35 AC 177 ms
57,980 KB
testcase_36 AC 205 ms
60,624 KB
testcase_37 AC 202 ms
60,412 KB
testcase_38 AC 194 ms
60,416 KB
testcase_39 AC 203 ms
60,392 KB
testcase_40 AC 211 ms
60,332 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;
import java.io.*;
class prob365
{
    public static void main(String args[])throws IOException
    {
	BufferedReader sc=new BufferedReader(new InputStreamReader(System.in));
	int n=Integer.parseInt(sc.readLine());
	String s[]=sc.readLine().split(" ");
	int a[]=new int[n];
	for(int i=0;i<n;i++)a[i]=Integer.parseInt(s[i]);
	int ans=n;
	int target=n;
	for(int i=n-1;i>=0;i--)
	    {
		if(target==a[i])
		    {
			ans--;
			target--;
		    }
	    }
	System.out.println(ans);
    }
}
0