結果

問題 No.627 ランダムウォークの軌跡
ユーザー YukimotoPGYukimotoPG
提出日時 2019-02-13 15:15:21
言語 Java21
(openjdk 21)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 358 bytes
コンパイル時間 2,154 ms
コンパイル使用メモリ 72,604 KB
実行使用メモリ 57,824 KB
最終ジャッジ日時 2023-10-11 11:15:48
合計ジャッジ時間 7,961 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
55,860 KB
testcase_01 AC 124 ms
55,972 KB
testcase_02 AC 124 ms
56,252 KB
testcase_03 AC 124 ms
55,756 KB
testcase_04 AC 125 ms
56,160 KB
testcase_05 AC 124 ms
55,828 KB
testcase_06 AC 123 ms
57,824 KB
testcase_07 AC 123 ms
56,144 KB
testcase_08 AC 124 ms
56,364 KB
testcase_09 AC 124 ms
55,700 KB
testcase_10 AC 127 ms
55,896 KB
testcase_11 AC 127 ms
56,044 KB
testcase_12 AC 128 ms
55,860 KB
testcase_13 AC 127 ms
56,012 KB
testcase_14 AC 127 ms
56,300 KB
testcase_15 AC 127 ms
56,196 KB
testcase_16 AC 127 ms
55,784 KB
testcase_17 AC 130 ms
55,560 KB
testcase_18 AC 131 ms
56,112 KB
testcase_19 AC 131 ms
56,240 KB
testcase_20 AC 130 ms
56,484 KB
testcase_21 AC 131 ms
56,004 KB
testcase_22 AC 138 ms
55,848 KB
testcase_23 AC 131 ms
56,180 KB
testcase_24 AC 131 ms
55,976 KB
testcase_25 AC 131 ms
56,272 KB
testcase_26 AC 132 ms
56,044 KB
testcase_27 AC 132 ms
55,868 KB
testcase_28 AC 133 ms
56,364 KB
testcase_29 AC 132 ms
55,588 KB
testcase_30 AC 123 ms
56,124 KB
testcase_31 AC 124 ms
56,096 KB
testcase_32 AC 124 ms
56,152 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

class Main {
	static Scanner sc = new Scanner(System.in);
	public static void main(String[] args) {
		
		int n = sc.nextInt();
		int[] ar = new int[n+1];
		ar[0] = 0;
		boolean F = true;
		for (int i=1; i<n+1; i++) {
			ar[i] = sc.nextInt();
			if (Math.abs(ar[i]-ar[i-1]) != 1) F = false;
		}
		
		System.out.println(F?"T":"F");
		
	}
}
0