結果

問題 No.627 ランダムウォークの軌跡
ユーザー yamax3232yamax3232
提出日時 2018-03-19 13:23:09
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 541 bytes
コンパイル時間 4,675 ms
コンパイル使用メモリ 71,820 KB
実行使用メモリ 57,804 KB
最終ジャッジ日時 2023-08-30 03:36:01
合計ジャッジ時間 10,114 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 126 ms
55,884 KB
testcase_01 WA -
testcase_02 AC 129 ms
55,820 KB
testcase_03 AC 133 ms
55,616 KB
testcase_04 AC 127 ms
53,992 KB
testcase_05 AC 124 ms
56,000 KB
testcase_06 AC 123 ms
55,544 KB
testcase_07 AC 125 ms
55,872 KB
testcase_08 AC 127 ms
56,028 KB
testcase_09 WA -
testcase_10 AC 131 ms
55,652 KB
testcase_11 AC 128 ms
55,968 KB
testcase_12 AC 129 ms
55,936 KB
testcase_13 WA -
testcase_14 AC 132 ms
55,900 KB
testcase_15 WA -
testcase_16 AC 130 ms
55,880 KB
testcase_17 AC 132 ms
55,860 KB
testcase_18 AC 130 ms
55,624 KB
testcase_19 WA -
testcase_20 AC 132 ms
55,852 KB
testcase_21 AC 131 ms
55,684 KB
testcase_22 AC 132 ms
55,652 KB
testcase_23 WA -
testcase_24 AC 138 ms
55,484 KB
testcase_25 AC 134 ms
55,792 KB
testcase_26 AC 134 ms
57,804 KB
testcase_27 WA -
testcase_28 AC 134 ms
55,576 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 128 ms
55,792 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){
					System.out.println(i);
					b=false;
				}
			}
		}
		if(!b){
			System.out.println("F");
		}else{
			System.out.println("T");
		}


	}
}
0