結果

問題 No.747 循環小数N桁目 Hard
ユーザー hiromi_ayasehiromi_ayase
提出日時 2018-10-20 14:20:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 2,877 bytes
コンパイル時間 3,203 ms
コンパイル使用メモリ 94,528 KB
実行使用メモリ 43,092 KB
最終ジャッジ日時 2024-11-19 02:30:30
合計ジャッジ時間 27,627 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
38,328 KB
testcase_01 AC 78 ms
38,352 KB
testcase_02 AC 79 ms
38,216 KB
testcase_03 AC 78 ms
38,296 KB
testcase_04 WA -
testcase_05 AC 78 ms
38,248 KB
testcase_06 AC 79 ms
38,152 KB
testcase_07 AC 79 ms
38,368 KB
testcase_08 WA -
testcase_09 AC 78 ms
38,204 KB
testcase_10 WA -
testcase_11 AC 78 ms
38,032 KB
testcase_12 AC 76 ms
38,156 KB
testcase_13 AC 76 ms
38,064 KB
testcase_14 AC 79 ms
38,480 KB
testcase_15 AC 78 ms
38,252 KB
testcase_16 AC 78 ms
38,216 KB
testcase_17 AC 78 ms
38,164 KB
testcase_18 AC 80 ms
38,012 KB
testcase_19 AC 79 ms
38,460 KB
testcase_20 AC 78 ms
38,092 KB
testcase_21 AC 80 ms
38,444 KB
testcase_22 AC 83 ms
38,444 KB
testcase_23 AC 77 ms
38,092 KB
testcase_24 AC 78 ms
38,164 KB
testcase_25 AC 79 ms
38,052 KB
testcase_26 AC 79 ms
38,476 KB
testcase_27 AC 80 ms
38,572 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 76 ms
37,964 KB
testcase_31 AC 77 ms
38,628 KB
testcase_32 AC 76 ms
38,240 KB
testcase_33 WA -
testcase_34 AC 126 ms
40,004 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 104 ms
40,056 KB
testcase_38 AC 139 ms
39,844 KB
testcase_39 AC 121 ms
39,640 KB
testcase_40 WA -
testcase_41 AC 207 ms
40,656 KB
testcase_42 WA -
testcase_43 AC 131 ms
40,060 KB
testcase_44 AC 174 ms
40,548 KB
testcase_45 AC 188 ms
40,268 KB
testcase_46 AC 179 ms
40,220 KB
testcase_47 WA -
testcase_48 AC 146 ms
40,216 KB
testcase_49 WA -
testcase_50 AC 134 ms
40,244 KB
testcase_51 AC 132 ms
39,768 KB
testcase_52 AC 114 ms
39,628 KB
testcase_53 AC 440 ms
42,976 KB
testcase_54 AC 319 ms
40,900 KB
testcase_55 AC 369 ms
42,392 KB
testcase_56 AC 323 ms
42,040 KB
testcase_57 AC 131 ms
39,716 KB
testcase_58 AC 474 ms
43,092 KB
testcase_59 AC 172 ms
40,320 KB
testcase_60 WA -
testcase_61 AC 240 ms
40,580 KB
testcase_62 WA -
testcase_63 WA -
testcase_64 AC 136 ms
39,700 KB
testcase_65 AC 112 ms
39,568 KB
testcase_66 AC 170 ms
40,212 KB
testcase_67 AC 158 ms
40,156 KB
testcase_68 AC 177 ms
40,392 KB
testcase_69 WA -
testcase_70 WA -
testcase_71 AC 125 ms
39,816 KB
testcase_72 AC 144 ms
39,752 KB
testcase_73 AC 183 ms
40,192 KB
testcase_74 WA -
testcase_75 AC 136 ms
39,688 KB
testcase_76 AC 151 ms
40,092 KB
testcase_77 AC 131 ms
39,832 KB
testcase_78 AC 178 ms
40,280 KB
testcase_79 WA -
testcase_80 AC 177 ms
40,312 KB
testcase_81 WA -
testcase_82 AC 147 ms
39,744 KB
testcase_83 WA -
testcase_84 AC 208 ms
40,468 KB
testcase_85 AC 190 ms
40,388 KB
testcase_86 AC 160 ms
39,928 KB
testcase_87 AC 206 ms
40,340 KB
testcase_88 AC 137 ms
40,072 KB
testcase_89 WA -
testcase_90 AC 176 ms
40,204 KB
testcase_91 AC 188 ms
40,440 KB
testcase_92 WA -
testcase_93 AC 197 ms
40,480 KB
testcase_94 AC 279 ms
40,696 KB
testcase_95 AC 342 ms
42,252 KB
testcase_96 AC 309 ms
42,204 KB
testcase_97 AC 382 ms
42,436 KB
testcase_98 AC 458 ms
43,028 KB
testcase_99 AC 380 ms
42,668 KB
testcase_100 WA -
testcase_101 AC 209 ms
40,724 KB
testcase_102 AC 187 ms
40,400 KB
testcase_103 AC 239 ms
40,928 KB
testcase_104 AC 238 ms
40,788 KB
testcase_105 AC 236 ms
40,768 KB
testcase_106 WA -
testcase_107 AC 234 ms
40,792 KB
testcase_108 AC 238 ms
40,952 KB
testcase_109 AC 238 ms
40,792 KB
testcase_110 AC 238 ms
40,720 KB
testcase_111 AC 238 ms
40,784 KB
testcase_112 AC 237 ms
40,824 KB
testcase_113 AC 236 ms
40,768 KB
testcase_114 AC 236 ms
40,620 KB
testcase_115 AC 241 ms
40,920 KB
testcase_116 AC 235 ms
40,792 KB
testcase_117 AC 237 ms
40,792 KB
testcase_118 WA -
testcase_119 WA -
testcase_120 AC 237 ms
40,788 KB
testcase_121 AC 240 ms
40,824 KB
testcase_122 WA -
testcase_123 AC 236 ms
40,848 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import java.math.BigInteger;

public class Main {


  private static void solve() {
    BigInteger n = new BigInteger(next());
    BigInteger k = new BigInteger(next());
    
    int n2 = n.mod(BigInteger.valueOf(2)).intValue();
    int n3 = n.mod(BigInteger.valueOf(3)).intValue();
    int k3 = k.mod(BigInteger.valueOf(2)).intValue();
    
    int nx = n2;
    int kx = n3 == 0 ? 0 : (k3 == 0 ? 1 : n3);

    int d = new int[][]{{0,4,2},{3,2,5}}[nx][kx];
    String s = "285714";
    System.out.println(s.charAt((d + 5) % 6));
  }
  

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}
0