結果

問題 No.627 ランダムウォークの軌跡
ユーザー shinwisteriashinwisteria
提出日時 2018-02-15 22:48:33
言語 Java21
(openjdk 21)
結果
AC  
実行時間 128 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 3,031 ms
コンパイル使用メモリ 72,048 KB
実行使用メモリ 57,756 KB
最終ジャッジ日時 2023-08-28 15:26:54
合計ジャッジ時間 8,369 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
55,840 KB
testcase_01 AC 119 ms
55,936 KB
testcase_02 AC 119 ms
57,756 KB
testcase_03 AC 120 ms
55,940 KB
testcase_04 AC 121 ms
55,916 KB
testcase_05 AC 120 ms
56,508 KB
testcase_06 AC 119 ms
56,320 KB
testcase_07 AC 119 ms
55,804 KB
testcase_08 AC 121 ms
56,260 KB
testcase_09 AC 121 ms
55,976 KB
testcase_10 AC 121 ms
56,168 KB
testcase_11 AC 124 ms
56,292 KB
testcase_12 AC 124 ms
56,228 KB
testcase_13 AC 124 ms
56,296 KB
testcase_14 AC 123 ms
55,888 KB
testcase_15 AC 124 ms
55,680 KB
testcase_16 AC 127 ms
55,876 KB
testcase_17 AC 126 ms
55,736 KB
testcase_18 AC 127 ms
55,924 KB
testcase_19 AC 127 ms
55,816 KB
testcase_20 AC 127 ms
56,216 KB
testcase_21 AC 126 ms
55,948 KB
testcase_22 AC 126 ms
56,088 KB
testcase_23 AC 128 ms
55,636 KB
testcase_24 AC 127 ms
56,216 KB
testcase_25 AC 127 ms
55,984 KB
testcase_26 AC 127 ms
56,336 KB
testcase_27 AC 128 ms
55,864 KB
testcase_28 AC 126 ms
55,844 KB
testcase_29 AC 127 ms
55,436 KB
testcase_30 AC 118 ms
55,788 KB
testcase_31 AC 117 ms
56,060 KB
testcase_32 AC 118 ms
56,008 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;

public class RandomWalknokiseki {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int T = s.nextInt();
		Boolean ft = true;
		int[] X = new int[T];
		for(int i = 0;i < T;i++){
			X[i] = s.nextInt();
			if(i > 0){
				if(Math.abs(X[i] - X[i-1]) != 1){
					ft = false;
				}
			}else if(i == 0){
				if(Math.abs(X[i]) != 1){
					ft = false;
				}
			}
		}
		s.close();
		if(ft){
			System.out.println("T");
		}else{
			System.out.println("F");
		}
	}

}
0