結果

問題 No.627 ランダムウォークの軌跡
ユーザー matsuyoshi30matsuyoshi30
提出日時 2018-05-28 23:58:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 593 bytes
コンパイル時間 2,229 ms
コンパイル使用メモリ 71,320 KB
実行使用メモリ 56,136 KB
最終ジャッジ日時 2023-09-12 20:17:21
合計ジャッジ時間 7,700 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,448 KB
testcase_01 AC 127 ms
55,584 KB
testcase_02 AC 130 ms
55,620 KB
testcase_03 AC 125 ms
55,652 KB
testcase_04 AC 126 ms
55,712 KB
testcase_05 AC 125 ms
55,728 KB
testcase_06 AC 125 ms
55,852 KB
testcase_07 AC 127 ms
55,928 KB
testcase_08 AC 129 ms
55,632 KB
testcase_09 AC 128 ms
55,728 KB
testcase_10 AC 130 ms
55,688 KB
testcase_11 AC 130 ms
55,724 KB
testcase_12 AC 132 ms
55,776 KB
testcase_13 AC 132 ms
55,728 KB
testcase_14 AC 134 ms
55,640 KB
testcase_15 AC 132 ms
55,744 KB
testcase_16 AC 132 ms
55,672 KB
testcase_17 AC 133 ms
55,964 KB
testcase_18 AC 135 ms
55,724 KB
testcase_19 AC 133 ms
55,404 KB
testcase_20 AC 134 ms
55,848 KB
testcase_21 AC 134 ms
55,820 KB
testcase_22 AC 138 ms
55,600 KB
testcase_23 AC 136 ms
55,824 KB
testcase_24 AC 131 ms
55,868 KB
testcase_25 AC 133 ms
55,972 KB
testcase_26 AC 135 ms
55,440 KB
testcase_27 AC 136 ms
55,456 KB
testcase_28 AC 135 ms
56,136 KB
testcase_29 AC 135 ms
55,816 KB
testcase_30 AC 125 ms
55,372 KB
testcase_31 WA -
testcase_32 AC 125 ms
56,032 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        int t = in.nextInt();

        String ans = "T";
        int[] x = new int[t];

        for(int i=0; i<t; i++) {
            x[i] = in.nextInt();
        }

        if(t == 1 && (x[0] != 1 || x[0] != -1)) ans = "F";
        if(x[0] == 0) ans = "F";
        for(int i=1; i<t; i++) {
            if(Math.abs(x[i-1] - x[i]) > 1 || x[i-1] == x[i]) {
                ans = "F";
                break;
            }
        }

        System.out.println(ans);
    }
}
0