結果

問題 No.627 ランダムウォークの軌跡
ユーザー yamax3232yamax3232
提出日時 2018-03-19 13:23:50
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 513 bytes
コンパイル時間 3,265 ms
コンパイル使用メモリ 71,744 KB
実行使用メモリ 56,420 KB
最終ジャッジ日時 2023-08-30 03:36:15
合計ジャッジ時間 9,215 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 127 ms
55,852 KB
testcase_01 AC 132 ms
55,888 KB
testcase_02 AC 128 ms
55,820 KB
testcase_03 AC 127 ms
55,808 KB
testcase_04 AC 127 ms
55,868 KB
testcase_05 AC 128 ms
55,544 KB
testcase_06 AC 129 ms
55,592 KB
testcase_07 AC 127 ms
56,420 KB
testcase_08 AC 129 ms
55,916 KB
testcase_09 AC 128 ms
56,012 KB
testcase_10 AC 131 ms
56,004 KB
testcase_11 AC 131 ms
55,772 KB
testcase_12 AC 132 ms
55,532 KB
testcase_13 AC 134 ms
55,784 KB
testcase_14 AC 131 ms
55,828 KB
testcase_15 AC 133 ms
56,012 KB
testcase_16 AC 133 ms
55,916 KB
testcase_17 AC 134 ms
55,736 KB
testcase_18 AC 136 ms
55,780 KB
testcase_19 AC 137 ms
55,860 KB
testcase_20 AC 135 ms
55,768 KB
testcase_21 AC 134 ms
55,884 KB
testcase_22 AC 137 ms
55,808 KB
testcase_23 AC 137 ms
55,752 KB
testcase_24 AC 135 ms
55,616 KB
testcase_25 AC 135 ms
56,096 KB
testcase_26 AC 137 ms
55,812 KB
testcase_27 AC 136 ms
55,788 KB
testcase_28 AC 140 ms
55,616 KB
testcase_29 AC 140 ms
55,820 KB
testcase_30 WA -
testcase_31 AC 127 ms
55,540 KB
testcase_32 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.Scanner;

public class Main2 {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner kb=new Scanner(System.in);
		int  n =kb.nextInt();
		int[] a=new int[n];
		boolean b=true;
		for(int i=0;i<a.length;i++){
			a[i]=kb.nextInt();
		}
		for(int i=0;i<a.length;i++){
			if(i+1<a.length){
				if(a[i+1]!=a[i]+1&&a[i+1]!=a[i]-1){
					b=false;
				}
			}
		}
		if(!b){
			System.out.println("F");
		}else{
			System.out.println("T");
		}


	}
}
0