結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 108 ms
54,180 KB
testcase_01 AC 107 ms
54,124 KB
testcase_02 AC 100 ms
52,972 KB
testcase_03 AC 104 ms
52,828 KB
testcase_04 AC 111 ms
53,808 KB
testcase_05 AC 100 ms
52,948 KB
testcase_06 AC 96 ms
52,716 KB
testcase_07 AC 110 ms
53,888 KB
testcase_08 AC 107 ms
53,888 KB
testcase_09 WA -
testcase_10 AC 99 ms
53,008 KB
testcase_11 AC 110 ms
53,840 KB
testcase_12 AC 110 ms
52,948 KB
testcase_13 AC 104 ms
52,740 KB
testcase_14 AC 113 ms
53,948 KB
testcase_15 AC 117 ms
53,996 KB
testcase_16 AC 115 ms
53,856 KB
testcase_17 AC 115 ms
53,936 KB
testcase_18 AC 109 ms
52,944 KB
testcase_19 AC 100 ms
52,444 KB
testcase_20 AC 121 ms
54,300 KB
testcase_21 AC 118 ms
54,508 KB
testcase_22 AC 116 ms
54,000 KB
testcase_23 WA -
testcase_24 AC 116 ms
54,452 KB
testcase_25 AC 119 ms
54,396 KB
testcase_26 AC 116 ms
54,300 KB
testcase_27 AC 114 ms
54,004 KB
testcase_28 AC 117 ms
53,892 KB
testcase_29 AC 122 ms
53,904 KB
testcase_30 AC 101 ms
52,712 KB
testcase_31 AC 106 ms
53,980 KB
testcase_32 AC 104 ms
54,024 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; break;}
			}
			System.out.println(possible==true?"T":"F");
		}
	}
}
0