結果

問題 No.627 ランダムウォークの軌跡
ユーザー Pump0129
提出日時 2018-03-26 17:56:54
言語 Java
(openjdk 23)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 583 bytes
コンパイル時間 1,847 ms
コンパイル使用メモリ 74,504 KB
実行使用メモリ 41,516 KB
最終ジャッジ日時 2024-06-25 06:50:25
合計ジャッジ時間 6,872 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

package net.ipipip0129.yukicoder.no627;

import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int cnt = Integer.parseInt(scan.nextLine());
		
		int revnum = 0;
		boolean isend = false;
		for (int i = 0; i < cnt; i++) {
			int num = Integer.parseInt(scan.nextLine());
			if ((revnum - num) * (revnum - num) != 1) {
				System.out.println("F");
				isend = true;
				break;
			}
			revnum = num;
		}
		
		scan.close();
		
		if(!isend) {
			System.out.println("T");
		}
		
	}
}
0