結果

問題 No.627 ランダムウォークの軌跡
ユーザー Mcpu3Mcpu3
提出日時 2018-04-14 17:51:12
言語 Java21
(openjdk 21)
結果
AC  
実行時間 134 ms / 2,000 ms
コード長 397 bytes
コンパイル時間 1,993 ms
コンパイル使用メモリ 71,656 KB
実行使用メモリ 56,608 KB
最終ジャッジ日時 2023-09-09 05:21:12
合計ジャッジ時間 7,852 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 120 ms
55,928 KB
testcase_01 AC 121 ms
56,000 KB
testcase_02 AC 120 ms
56,608 KB
testcase_03 AC 118 ms
56,100 KB
testcase_04 AC 119 ms
56,060 KB
testcase_05 AC 121 ms
55,768 KB
testcase_06 AC 122 ms
56,160 KB
testcase_07 AC 120 ms
56,456 KB
testcase_08 AC 121 ms
55,772 KB
testcase_09 AC 121 ms
55,920 KB
testcase_10 AC 121 ms
55,748 KB
testcase_11 AC 122 ms
55,396 KB
testcase_12 AC 123 ms
56,000 KB
testcase_13 AC 124 ms
55,760 KB
testcase_14 AC 131 ms
56,092 KB
testcase_15 AC 124 ms
56,384 KB
testcase_16 AC 127 ms
55,484 KB
testcase_17 AC 128 ms
56,276 KB
testcase_18 AC 127 ms
56,120 KB
testcase_19 AC 128 ms
55,764 KB
testcase_20 AC 134 ms
55,656 KB
testcase_21 AC 130 ms
56,256 KB
testcase_22 AC 129 ms
55,848 KB
testcase_23 AC 131 ms
55,776 KB
testcase_24 AC 127 ms
56,172 KB
testcase_25 AC 131 ms
55,732 KB
testcase_26 AC 132 ms
55,804 KB
testcase_27 AC 132 ms
55,652 KB
testcase_28 AC 131 ms
56,376 KB
testcase_29 AC 131 ms
55,672 KB
testcase_30 AC 121 ms
55,460 KB
testcase_31 AC 122 ms
55,804 KB
testcase_32 AC 120 ms
56,128 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

class no627{
	public static void main(String[] args) {
		Scanner stdIn=new Scanner(System.in);
		String[] tf= {"T","F"};
		int t=stdIn.nextInt();
		int[] x=new int[t];
		for(int i=0;i<t;i++) x[i]=stdIn.nextInt();
		int p=0;
		int xorf=0;
		for(int i=0;i<t;i++) {
			if(!(p==x[i]+1||p==x[i]-1)) xorf=1;
			p=x[i];
		}
		System.out.println(tf[xorf]);
	}
}
0