結果

問題 No.627 ランダムウォークの軌跡
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 02:14:32
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 1,939 ms
コンパイル使用メモリ 74,948 KB
実行使用メモリ 56,000 KB
最終ジャッジ日時 2024-04-09 20:52:55
合計ジャッジ時間 6,606 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
53,872 KB
testcase_01 AC 109 ms
53,872 KB
testcase_02 AC 106 ms
52,964 KB
testcase_03 AC 110 ms
54,040 KB
testcase_04 AC 107 ms
54,064 KB
testcase_05 AC 111 ms
54,012 KB
testcase_06 AC 119 ms
53,784 KB
testcase_07 AC 113 ms
54,056 KB
testcase_08 AC 109 ms
54,124 KB
testcase_09 WA -
testcase_10 AC 99 ms
52,352 KB
testcase_11 AC 107 ms
53,132 KB
testcase_12 AC 110 ms
53,204 KB
testcase_13 AC 115 ms
53,876 KB
testcase_14 AC 114 ms
53,908 KB
testcase_15 AC 116 ms
54,128 KB
testcase_16 AC 107 ms
53,084 KB
testcase_17 AC 112 ms
54,180 KB
testcase_18 AC 105 ms
52,828 KB
testcase_19 AC 104 ms
53,076 KB
testcase_20 AC 115 ms
54,068 KB
testcase_21 AC 119 ms
54,180 KB
testcase_22 AC 123 ms
54,064 KB
testcase_23 WA -
testcase_24 AC 115 ms
54,060 KB
testcase_25 AC 116 ms
53,840 KB
testcase_26 AC 114 ms
53,992 KB
testcase_27 AC 115 ms
53,920 KB
testcase_28 AC 115 ms
53,992 KB
testcase_29 AC 118 ms
54,320 KB
testcase_30 AC 98 ms
52,884 KB
testcase_31 AC 95 ms
52,864 KB
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

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