結果

問題 No.627 ランダムウォークの軌跡
ユーザー shinwisteriashinwisteria
提出日時 2018-02-15 22:54:15
言語 Java21
(openjdk 21)
結果
AC  
実行時間 129 ms / 2,000 ms
コード長 532 bytes
コンパイル時間 3,093 ms
コンパイル使用メモリ 72,668 KB
実行使用メモリ 57,900 KB
最終ジャッジ日時 2023-08-28 15:33:43
合計ジャッジ時間 8,475 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 118 ms
56,088 KB
testcase_01 AC 120 ms
56,324 KB
testcase_02 AC 120 ms
56,064 KB
testcase_03 AC 121 ms
55,888 KB
testcase_04 AC 120 ms
56,036 KB
testcase_05 AC 118 ms
55,860 KB
testcase_06 AC 120 ms
56,132 KB
testcase_07 AC 120 ms
56,056 KB
testcase_08 AC 121 ms
55,776 KB
testcase_09 AC 119 ms
56,360 KB
testcase_10 AC 122 ms
55,928 KB
testcase_11 AC 123 ms
55,724 KB
testcase_12 AC 122 ms
56,124 KB
testcase_13 AC 125 ms
57,900 KB
testcase_14 AC 124 ms
55,716 KB
testcase_15 AC 125 ms
55,924 KB
testcase_16 AC 125 ms
55,920 KB
testcase_17 AC 126 ms
55,924 KB
testcase_18 AC 127 ms
56,056 KB
testcase_19 AC 127 ms
55,956 KB
testcase_20 AC 127 ms
55,964 KB
testcase_21 AC 126 ms
55,728 KB
testcase_22 AC 126 ms
55,748 KB
testcase_23 AC 127 ms
55,488 KB
testcase_24 AC 127 ms
55,768 KB
testcase_25 AC 128 ms
56,084 KB
testcase_26 AC 127 ms
55,816 KB
testcase_27 AC 128 ms
53,820 KB
testcase_28 AC 128 ms
55,836 KB
testcase_29 AC 129 ms
56,068 KB
testcase_30 AC 119 ms
55,812 KB
testcase_31 AC 119 ms
56,044 KB
testcase_32 AC 119 ms
55,652 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package m.shin;
import java.util.Scanner;

public class RandomWalknokiseki {

	public static void main(String[] args) {
		Scanner s = new Scanner(System.in);
		int T = s.nextInt();
		Boolean ft = true;
		int[] X = new int[T];
		for(int i = 0;i < T;i++){
			X[i] = s.nextInt();
			if(i > 0){
				if(Math.abs(X[i] - X[i-1]) != 1){
					ft = false;
				}
			}else if(i == 0){
				if(Math.abs(X[i]) != 1){
					ft = false;
				}
			}
		}
		s.close();
		if(ft){
			System.out.println("T");
		}else{
			System.out.println("F");
		}
	}

}
0