結果

問題 No.627 ランダムウォークの軌跡
ユーザー fal_rndfal_rnd
提出日時 2018-01-05 22:58:19
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 1,743 bytes
コンパイル時間 3,033 ms
コンパイル使用メモリ 80,256 KB
実行使用メモリ 57,804 KB
最終ジャッジ日時 2023-08-24 21:13:25
合計ジャッジ時間 9,314 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
55,784 KB
testcase_01 AC 132 ms
56,004 KB
testcase_02 AC 132 ms
55,756 KB
testcase_03 AC 130 ms
55,692 KB
testcase_04 AC 129 ms
55,804 KB
testcase_05 AC 133 ms
55,808 KB
testcase_06 AC 132 ms
55,676 KB
testcase_07 AC 133 ms
55,756 KB
testcase_08 AC 131 ms
56,344 KB
testcase_09 AC 134 ms
55,944 KB
testcase_10 AC 136 ms
55,528 KB
testcase_11 AC 135 ms
55,744 KB
testcase_12 AC 133 ms
55,736 KB
testcase_13 AC 133 ms
55,724 KB
testcase_14 AC 137 ms
55,456 KB
testcase_15 AC 137 ms
55,728 KB
testcase_16 AC 138 ms
57,804 KB
testcase_17 AC 136 ms
55,500 KB
testcase_18 AC 137 ms
55,888 KB
testcase_19 AC 139 ms
55,964 KB
testcase_20 AC 140 ms
55,816 KB
testcase_21 AC 146 ms
55,744 KB
testcase_22 AC 138 ms
55,756 KB
testcase_23 AC 137 ms
55,888 KB
testcase_24 AC 139 ms
56,284 KB
testcase_25 AC 140 ms
55,728 KB
testcase_26 AC 140 ms
55,992 KB
testcase_27 AC 141 ms
55,484 KB
testcase_28 AC 143 ms
56,140 KB
testcase_29 AC 139 ms
55,876 KB
testcase_30 AC 127 ms
55,524 KB
testcase_31 AC 128 ms
55,980 KB
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Iterator;
import java.util.PrimitiveIterator;
import java.util.Scanner;
import java.util.stream.IntStream;
import java.util.stream.Stream;

class Main_Util{
	private void solve(){
		int n=gInt();
		int[]in=ints(n).toArray();
		if(in[0]==0){
			System.out.println('F');
			return;
		}
		for(int i:rep(n-1)) {
			if(Math.abs(in[i]-in[i+1])!=1) {
				System.out.println('F');
				return;
			}
		}
		System.out.println('T');
	}

	public static void main(String[]$){
		new Main_Util().solve();
		System.out.flush();
	}

	static class System{
		private static final InputStream in=java.lang.System.in;
		private static final PrintWriter out=new PrintWriter(java.lang.System.out,false);
	}
	static Scanner s=new Scanner(System.in);

	static int gInt(){
		return s.nextInt();
	}
	static long gLong(){
		return s.nextLong();
	}
	static long gDouble(){
		return s.nextLong();
	}

	static Range rep(int i){
		return new Range(i);
	}
	static Range rep(int f,int t){
		return new Range(f,t);
	}
	static class Range implements Iterable<Integer>,PrimitiveIterator.OfInt{
		int from,to,c;
		Range(int from,int to){
			this.from=from;
			this.to=to;
			this.c=from;
		}
		Range(int n){
			this(0,n-1);
		}
		@Override
		public Iterator<Integer> iterator(){
			return this;
		}
		@Override
		public boolean hasNext(){
			return c<=to;
		}
		@Override
		public int nextInt(){
			return c++;
		}
	}

	static IntStream REPS(int v){
		return IntStream.range(0,v);
	}
	static IntStream REPS(int l,int r){
		return IntStream.rangeClosed(l,r);
	}

	static IntStream ints(int n){
		return REPS(n).map(i->gInt());
	}
	static Stream<String> strs(int n){
		return REPS(n).mapToObj(i->s.next());
	}
}
0