結果

問題 No.627 ランダムウォークの軌跡
ユーザー uafr_csuafr_cs
提出日時 2018-01-05 21:22:40
言語 Java
(openjdk 23)
結果
AC  
実行時間 159 ms / 2,000 ms
コード長 507 bytes
コンパイル時間 3,028 ms
コンパイル使用メモリ 74,744 KB
実行使用メモリ 41,420 KB
最終ジャッジ日時 2024-12-23 06:15:18
合計ジャッジ時間 8,525 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 33
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.ArrayList;
import java.util.Arrays;
import java.util.Collections;
import java.util.LinkedList;
import java.util.Scanner;
import java.util.TreeSet;

public class Main {
	
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		final int T = sc.nextInt();
		int x = 0;
		for(int i = 0; i < T; i++){
			final int nx = sc.nextInt();
			if(nx != x + 1 && nx != x - 1){ 
				System.out.println("F");
				return;
			}
			x = nx;
		}
		
		System.out.println("T");
	}
}
0