結果

問題 No.627 ランダムウォークの軌跡
ユーザー sudo_yumsudo_yum
提出日時 2018-05-25 12:45:19
言語 Java21
(openjdk 21)
結果
AC  
実行時間 135 ms / 2,000 ms
コード長 687 bytes
コンパイル時間 2,047 ms
コンパイル使用メモリ 71,828 KB
実行使用メモリ 56,212 KB
最終ジャッジ日時 2023-09-11 03:24:17
合計ジャッジ時間 9,231 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 130 ms
55,732 KB
testcase_01 AC 127 ms
55,792 KB
testcase_02 AC 127 ms
56,212 KB
testcase_03 AC 127 ms
55,900 KB
testcase_04 AC 126 ms
55,920 KB
testcase_05 AC 127 ms
56,156 KB
testcase_06 AC 129 ms
55,808 KB
testcase_07 AC 128 ms
55,404 KB
testcase_08 AC 127 ms
55,716 KB
testcase_09 AC 128 ms
55,768 KB
testcase_10 AC 129 ms
55,980 KB
testcase_11 AC 128 ms
56,096 KB
testcase_12 AC 131 ms
56,076 KB
testcase_13 AC 130 ms
55,744 KB
testcase_14 AC 130 ms
55,636 KB
testcase_15 AC 129 ms
55,352 KB
testcase_16 AC 128 ms
55,688 KB
testcase_17 AC 129 ms
55,648 KB
testcase_18 AC 133 ms
55,808 KB
testcase_19 AC 134 ms
55,824 KB
testcase_20 AC 133 ms
55,860 KB
testcase_21 AC 135 ms
55,984 KB
testcase_22 AC 131 ms
56,032 KB
testcase_23 AC 132 ms
55,160 KB
testcase_24 AC 131 ms
55,676 KB
testcase_25 AC 134 ms
55,592 KB
testcase_26 AC 131 ms
56,192 KB
testcase_27 AC 134 ms
55,684 KB
testcase_28 AC 133 ms
55,896 KB
testcase_29 AC 134 ms
55,496 KB
testcase_30 AC 124 ms
53,632 KB
testcase_31 AC 126 ms
55,632 KB
testcase_32 AC 128 ms
55,604 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.util.*;

public class Main{
  static StringBuilder sb = new StringBuilder("");
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int T = sc.nextInt();
    int[] x = new int[T];
    for (int i=0;i<T ;i++ ) {
      x[i]=sc.nextInt();
    }
    sc.close();
    if (x[0]==0) {
      System.out.println("F");
      System.exit(0);
    }
    if (T==1) {
      if (!(x[0]==1||x[0]==-1)) {
        System.out.println("F");
        System.exit(0);
      }
    }
    for (int i=0;i<T-1 ;i++ ) {
      int k =x[i+1]-x[i];
      if (k*k!=1) {
        System.out.println("F");
        System.exit(0);
      }
    }
    System.out.println("T");
  }
}
0