結果

問題 No.627 ランダムウォークの軌跡
ユーザー tentententen
提出日時 2020-11-12 09:12:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 460 bytes
コンパイル時間 2,054 ms
コンパイル使用メモリ 74,820 KB
実行使用メモリ 56,344 KB
最終ジャッジ日時 2023-09-30 01:06:18
合計ジャッジ時間 7,916 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 122 ms
55,972 KB
testcase_01 AC 127 ms
55,860 KB
testcase_02 AC 129 ms
55,772 KB
testcase_03 AC 127 ms
55,708 KB
testcase_04 AC 125 ms
55,568 KB
testcase_05 AC 126 ms
55,796 KB
testcase_06 AC 125 ms
55,636 KB
testcase_07 AC 128 ms
55,776 KB
testcase_08 AC 127 ms
55,772 KB
testcase_09 AC 127 ms
56,080 KB
testcase_10 AC 130 ms
55,444 KB
testcase_11 AC 132 ms
55,960 KB
testcase_12 AC 130 ms
56,104 KB
testcase_13 AC 128 ms
56,020 KB
testcase_14 AC 132 ms
56,032 KB
testcase_15 AC 128 ms
55,804 KB
testcase_16 AC 132 ms
53,900 KB
testcase_17 AC 130 ms
55,924 KB
testcase_18 AC 132 ms
53,480 KB
testcase_19 AC 129 ms
56,008 KB
testcase_20 AC 131 ms
55,952 KB
testcase_21 AC 136 ms
55,892 KB
testcase_22 AC 128 ms
55,852 KB
testcase_23 AC 124 ms
55,744 KB
testcase_24 AC 132 ms
55,696 KB
testcase_25 AC 135 ms
55,908 KB
testcase_26 AC 134 ms
54,056 KB
testcase_27 AC 125 ms
55,996 KB
testcase_28 AC 130 ms
56,168 KB
testcase_29 AC 129 ms
55,952 KB
testcase_30 WA -
testcase_31 AC 122 ms
55,452 KB
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

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 = sc.nextInt();
        for (int i = 1; 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