結果

問題 No.365 ジェンガソート
ユーザー kohaku_kohakukohaku_kohaku
提出日時 2016-11-16 18:25:30
言語 Java21
(openjdk 21)
結果
AC  
実行時間 564 ms / 2,000 ms
コード長 524 bytes
コンパイル時間 2,045 ms
コンパイル使用メモリ 71,520 KB
実行使用メモリ 61,312 KB
最終ジャッジ日時 2023-08-17 07:31:47
合計ジャッジ時間 17,299 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
56,056 KB
testcase_01 AC 127 ms
55,876 KB
testcase_02 AC 127 ms
55,724 KB
testcase_03 AC 126 ms
55,752 KB
testcase_04 AC 125 ms
55,700 KB
testcase_05 AC 125 ms
55,728 KB
testcase_06 AC 124 ms
55,476 KB
testcase_07 AC 127 ms
55,492 KB
testcase_08 AC 127 ms
55,864 KB
testcase_09 AC 129 ms
55,812 KB
testcase_10 AC 127 ms
55,764 KB
testcase_11 AC 125 ms
56,012 KB
testcase_12 AC 127 ms
55,968 KB
testcase_13 AC 132 ms
56,248 KB
testcase_14 AC 129 ms
55,740 KB
testcase_15 AC 136 ms
55,732 KB
testcase_16 AC 506 ms
60,720 KB
testcase_17 AC 518 ms
60,336 KB
testcase_18 AC 247 ms
59,620 KB
testcase_19 AC 564 ms
61,312 KB
testcase_20 AC 392 ms
60,408 KB
testcase_21 AC 320 ms
60,200 KB
testcase_22 AC 469 ms
60,524 KB
testcase_23 AC 390 ms
60,284 KB
testcase_24 AC 471 ms
60,524 KB
testcase_25 AC 314 ms
60,172 KB
testcase_26 AC 462 ms
60,452 KB
testcase_27 AC 549 ms
60,248 KB
testcase_28 AC 452 ms
60,336 KB
testcase_29 AC 524 ms
60,952 KB
testcase_30 AC 492 ms
61,132 KB
testcase_31 AC 358 ms
58,624 KB
testcase_32 AC 343 ms
60,084 KB
testcase_33 AC 518 ms
60,460 KB
testcase_34 AC 283 ms
60,452 KB
testcase_35 AC 496 ms
60,436 KB
testcase_36 AC 529 ms
60,680 KB
testcase_37 AC 518 ms
60,520 KB
testcase_38 AC 542 ms
60,148 KB
testcase_39 AC 560 ms
61,160 KB
testcase_40 AC 521 ms
60,216 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int [] a = new int [N];
        int [] b = new int [N];
        for(int i=0; i<N; i++){
            a[i] = sc.nextInt();
        }
        int r=N;
        int t=N-1;
        for(int i=t; i>=0; i--){
            if(a[i]==r){
                r--;
                t--;
                continue;
            }
        }
        System.out.println(r);
    }
}
0