結果

問題 No.627 ランダムウォークの軌跡
ユーザー Tsukasa_TypeTsukasa_Type
提出日時 2018-02-09 02:17:36
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 524 bytes
コンパイル時間 2,176 ms
コンパイル使用メモリ 74,516 KB
実行使用メモリ 54,536 KB
最終ジャッジ日時 2024-04-09 20:53:12
合計ジャッジ時間 7,228 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 125 ms
54,012 KB
testcase_01 AC 126 ms
54,068 KB
testcase_02 AC 125 ms
54,128 KB
testcase_03 AC 127 ms
54,312 KB
testcase_04 AC 130 ms
54,028 KB
testcase_05 AC 128 ms
54,156 KB
testcase_06 AC 125 ms
54,196 KB
testcase_07 AC 125 ms
54,272 KB
testcase_08 AC 111 ms
53,024 KB
testcase_09 WA -
testcase_10 AC 124 ms
54,136 KB
testcase_11 AC 129 ms
54,300 KB
testcase_12 AC 127 ms
54,220 KB
testcase_13 AC 127 ms
54,044 KB
testcase_14 AC 128 ms
54,160 KB
testcase_15 AC 118 ms
53,180 KB
testcase_16 AC 132 ms
53,936 KB
testcase_17 AC 130 ms
54,352 KB
testcase_18 AC 129 ms
54,012 KB
testcase_19 AC 130 ms
54,240 KB
testcase_20 AC 132 ms
54,228 KB
testcase_21 AC 130 ms
54,264 KB
testcase_22 AC 134 ms
54,192 KB
testcase_23 WA -
testcase_24 AC 131 ms
54,128 KB
testcase_25 AC 130 ms
54,112 KB
testcase_26 AC 130 ms
54,072 KB
testcase_27 AC 131 ms
54,104 KB
testcase_28 AC 132 ms
53,736 KB
testcase_29 AC 132 ms
54,320 KB
testcase_30 AC 129 ms
54,148 KB
testcase_31 AC 128 ms
53,752 KB
testcase_32 AC 123 ms
54,292 KB
権限があれば一括ダウンロードができます

ソースコード

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 || ints[0] > 1 || ints[0] < -1) {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