結果

問題 No.365 ジェンガソート
ユーザー yun_appyun_app
提出日時 2016-05-09 19:09:14
言語 Java21
(openjdk 21)
結果
AC  
実行時間 280 ms / 2,000 ms
コード長 896 bytes
コンパイル時間 1,990 ms
コンパイル使用メモリ 74,728 KB
実行使用メモリ 57,472 KB
最終ジャッジ日時 2024-04-20 07:07:20
合計ジャッジ時間 9,253 ms
ジャッジサーバーID
(参考情報)
judge4 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 53 ms
36,976 KB
testcase_01 AC 50 ms
36,868 KB
testcase_02 AC 50 ms
36,864 KB
testcase_03 AC 52 ms
37,260 KB
testcase_04 AC 53 ms
36,848 KB
testcase_05 AC 55 ms
36,684 KB
testcase_06 AC 51 ms
37,180 KB
testcase_07 AC 50 ms
37,152 KB
testcase_08 AC 52 ms
37,260 KB
testcase_09 AC 52 ms
36,904 KB
testcase_10 AC 52 ms
37,120 KB
testcase_11 AC 51 ms
36,948 KB
testcase_12 AC 52 ms
36,976 KB
testcase_13 AC 51 ms
36,952 KB
testcase_14 AC 51 ms
37,072 KB
testcase_15 AC 51 ms
37,268 KB
testcase_16 AC 210 ms
52,856 KB
testcase_17 AC 269 ms
57,024 KB
testcase_18 AC 104 ms
39,860 KB
testcase_19 AC 258 ms
56,632 KB
testcase_20 AC 159 ms
47,044 KB
testcase_21 AC 122 ms
42,400 KB
testcase_22 AC 218 ms
52,724 KB
testcase_23 AC 160 ms
45,244 KB
testcase_24 AC 213 ms
52,564 KB
testcase_25 AC 129 ms
42,296 KB
testcase_26 AC 196 ms
49,636 KB
testcase_27 AC 265 ms
56,824 KB
testcase_28 AC 188 ms
49,740 KB
testcase_29 AC 229 ms
53,208 KB
testcase_30 AC 198 ms
49,588 KB
testcase_31 AC 147 ms
45,428 KB
testcase_32 AC 140 ms
45,192 KB
testcase_33 AC 277 ms
56,644 KB
testcase_34 AC 119 ms
41,748 KB
testcase_35 AC 216 ms
52,648 KB
testcase_36 AC 269 ms
57,472 KB
testcase_37 AC 264 ms
56,504 KB
testcase_38 AC 278 ms
56,712 KB
testcase_39 AC 280 ms
56,272 KB
testcase_40 AC 272 ms
56,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

/* package whatever; // don't place package name! */

import java.util.*;
import java.lang.*;
import java.io.*;

/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
    public static void main (String[] args) throws java.lang.Exception
    {
        // your code goes here
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        String[] lines = br.readLine().split(" ");
        HashMap<Integer,Integer> map = new HashMap<Integer,Integer>();
        int idx = 0;
        for(String st:lines){
            map.put(Integer.parseInt(st),idx++);
        }
        int tmp = n;
        int ans;
        for(ans = n;ans>0;ans--){
            if(map.get(ans) > tmp){
                break;
            }
            tmp = map.get(ans);
        }
        System.out.println(ans);
    }
}
0