結果

問題 No.747 循環小数N桁目 Hard
ユーザー hiromi_ayasehiromi_ayase
提出日時 2018-10-20 14:20:43
言語 Java21
(openjdk 21)
結果
WA  
実行時間 -
コード長 2,877 bytes
コンパイル時間 2,538 ms
コンパイル使用メモリ 82,960 KB
実行使用メモリ 42,916 KB
最終ジャッジ日時 2024-04-29 19:41:29
合計ジャッジ時間 24,968 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
38,212 KB
testcase_01 AC 70 ms
37,992 KB
testcase_02 AC 72 ms
38,248 KB
testcase_03 AC 70 ms
38,372 KB
testcase_04 WA -
testcase_05 AC 69 ms
38,244 KB
testcase_06 AC 70 ms
38,220 KB
testcase_07 AC 68 ms
37,852 KB
testcase_08 WA -
testcase_09 AC 70 ms
38,192 KB
testcase_10 WA -
testcase_11 AC 69 ms
38,152 KB
testcase_12 AC 69 ms
37,852 KB
testcase_13 AC 69 ms
38,096 KB
testcase_14 AC 70 ms
38,204 KB
testcase_15 AC 69 ms
38,324 KB
testcase_16 AC 71 ms
38,192 KB
testcase_17 AC 68 ms
38,220 KB
testcase_18 AC 68 ms
38,212 KB
testcase_19 AC 69 ms
38,160 KB
testcase_20 AC 69 ms
38,152 KB
testcase_21 AC 68 ms
38,196 KB
testcase_22 AC 69 ms
38,364 KB
testcase_23 AC 69 ms
38,196 KB
testcase_24 AC 68 ms
37,968 KB
testcase_25 AC 68 ms
38,120 KB
testcase_26 AC 69 ms
38,200 KB
testcase_27 AC 73 ms
38,364 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 68 ms
38,200 KB
testcase_31 AC 69 ms
38,152 KB
testcase_32 AC 68 ms
38,376 KB
testcase_33 WA -
testcase_34 AC 108 ms
39,892 KB
testcase_35 WA -
testcase_36 WA -
testcase_37 AC 92 ms
39,664 KB
testcase_38 AC 115 ms
39,672 KB
testcase_39 AC 103 ms
39,416 KB
testcase_40 WA -
testcase_41 AC 184 ms
40,292 KB
testcase_42 WA -
testcase_43 AC 119 ms
39,564 KB
testcase_44 AC 152 ms
40,068 KB
testcase_45 AC 163 ms
40,388 KB
testcase_46 AC 157 ms
40,072 KB
testcase_47 WA -
testcase_48 AC 124 ms
39,908 KB
testcase_49 WA -
testcase_50 AC 117 ms
40,072 KB
testcase_51 AC 116 ms
39,564 KB
testcase_52 AC 99 ms
39,576 KB
testcase_53 AC 406 ms
42,760 KB
testcase_54 AC 289 ms
41,856 KB
testcase_55 AC 315 ms
42,380 KB
testcase_56 AC 282 ms
41,900 KB
testcase_57 AC 115 ms
39,728 KB
testcase_58 AC 415 ms
42,916 KB
testcase_59 AC 145 ms
40,012 KB
testcase_60 WA -
testcase_61 AC 209 ms
40,304 KB
testcase_62 WA -
testcase_63 WA -
testcase_64 AC 121 ms
39,736 KB
testcase_65 AC 94 ms
39,620 KB
testcase_66 AC 140 ms
39,912 KB
testcase_67 AC 134 ms
40,244 KB
testcase_68 AC 149 ms
40,128 KB
testcase_69 WA -
testcase_70 WA -
testcase_71 AC 110 ms
39,620 KB
testcase_72 AC 131 ms
40,104 KB
testcase_73 AC 160 ms
40,044 KB
testcase_74 WA -
testcase_75 AC 122 ms
39,492 KB
testcase_76 AC 125 ms
39,984 KB
testcase_77 AC 113 ms
39,652 KB
testcase_78 AC 150 ms
40,048 KB
testcase_79 WA -
testcase_80 AC 170 ms
40,268 KB
testcase_81 WA -
testcase_82 AC 127 ms
39,620 KB
testcase_83 WA -
testcase_84 AC 188 ms
40,184 KB
testcase_85 AC 172 ms
40,332 KB
testcase_86 AC 147 ms
40,012 KB
testcase_87 AC 183 ms
40,252 KB
testcase_88 AC 122 ms
39,820 KB
testcase_89 WA -
testcase_90 AC 163 ms
40,040 KB
testcase_91 AC 168 ms
40,248 KB
testcase_92 WA -
testcase_93 AC 178 ms
40,200 KB
testcase_94 AC 251 ms
40,984 KB
testcase_95 AC 312 ms
42,184 KB
testcase_96 AC 279 ms
41,892 KB
testcase_97 AC 336 ms
42,244 KB
testcase_98 AC 461 ms
42,580 KB
testcase_99 AC 397 ms
42,568 KB
testcase_100 WA -
testcase_101 AC 189 ms
40,512 KB
testcase_102 AC 176 ms
40,056 KB
testcase_103 AC 208 ms
40,652 KB
testcase_104 AC 208 ms
40,680 KB
testcase_105 AC 217 ms
40,772 KB
testcase_106 WA -
testcase_107 AC 212 ms
40,560 KB
testcase_108 AC 211 ms
40,548 KB
testcase_109 AC 211 ms
40,728 KB
testcase_110 AC 214 ms
40,772 KB
testcase_111 AC 212 ms
40,588 KB
testcase_112 AC 211 ms
40,620 KB
testcase_113 AC 211 ms
40,760 KB
testcase_114 AC 214 ms
40,856 KB
testcase_115 AC 218 ms
40,688 KB
testcase_116 AC 209 ms
40,680 KB
testcase_117 AC 211 ms
40,772 KB
testcase_118 WA -
testcase_119 WA -
testcase_120 AC 228 ms
40,532 KB
testcase_121 AC 223 ms
40,536 KB
testcase_122 WA -
testcase_123 AC 210 ms
40,756 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