結果

問題 No.627 ランダムウォークの軌跡
ユーザー Tsukasa_Type
提出日時 2018-02-09 02:14:32
言語 Java
(openjdk 23)
結果
WA  
実行時間 -
コード長 493 bytes
コンパイル時間 2,497 ms
コンパイル使用メモリ 74,780 KB
実行使用メモリ 54,484 KB
最終ジャッジ日時 2024-10-01 21:17:13
合計ジャッジ時間 7,995 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30 WA * 3
権限があれば一括ダウンロードができます

ソースコード

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