結果

問題 No.627 ランダムウォークの軌跡
ユーザー tentententen
提出日時 2020-11-12 09:14:03
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 449 bytes
コンパイル時間 1,883 ms
コンパイル使用メモリ 71,304 KB
実行使用メモリ 40,056 KB
最終ジャッジ日時 2023-09-30 01:06:26
合計ジャッジ時間 7,576 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 117 ms
39,496 KB
testcase_01 AC 117 ms
39,200 KB
testcase_02 AC 118 ms
39,228 KB
testcase_03 AC 119 ms
39,160 KB
testcase_04 AC 118 ms
39,852 KB
testcase_05 AC 119 ms
39,480 KB
testcase_06 AC 120 ms
39,716 KB
testcase_07 AC 118 ms
39,404 KB
testcase_08 AC 120 ms
39,420 KB
testcase_09 AC 117 ms
39,272 KB
testcase_10 AC 121 ms
39,348 KB
testcase_11 AC 122 ms
39,588 KB
testcase_12 AC 122 ms
39,100 KB
testcase_13 AC 119 ms
39,284 KB
testcase_14 AC 123 ms
40,056 KB
testcase_15 AC 122 ms
39,248 KB
testcase_16 AC 125 ms
39,120 KB
testcase_17 AC 123 ms
39,472 KB
testcase_18 AC 125 ms
39,288 KB
testcase_19 AC 122 ms
39,980 KB
testcase_20 AC 125 ms
39,184 KB
testcase_21 AC 123 ms
39,292 KB
testcase_22 AC 128 ms
39,312 KB
testcase_23 AC 118 ms
39,736 KB
testcase_24 AC 125 ms
39,296 KB
testcase_25 AC 127 ms
39,256 KB
testcase_26 AC 125 ms
39,768 KB
testcase_27 AC 118 ms
39,380 KB
testcase_28 AC 127 ms
39,324 KB
testcase_29 AC 119 ms
39,868 KB
testcase_30 AC 119 ms
39,376 KB
testcase_31 AC 118 ms
39,688 KB
testcase_32 AC 116 ms
39,080 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 prev = 0;
        for (int i = 0; i < n; i++) {
            int x = sc.nextInt();
            if (Math.abs(x - prev) != 1) {
                System.out.println("F");
                return;
            }
            prev = x;
        }
        System.out.println("T");
    }
}
0