結果
問題 | No.747 循環小数N桁目 Hard |
ユーザー | marurunn11 |
提出日時 | 2020-07-24 02:26:48 |
言語 | Python3 (3.12.2 + numpy 1.26.4 + scipy 1.12.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 1,712 bytes |
コンパイル時間 | 475 ms |
コンパイル使用メモリ | 12,800 KB |
実行使用メモリ | 11,264 KB |
最終ジャッジ日時 | 2024-04-20 11:03:09 |
合計ジャッジ時間 | 6,466 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 28 ms
11,008 KB |
testcase_01 | AC | 28 ms
11,008 KB |
testcase_02 | AC | 27 ms
11,008 KB |
testcase_03 | AC | 27 ms
11,008 KB |
testcase_04 | AC | 26 ms
11,136 KB |
testcase_05 | AC | 29 ms
11,008 KB |
testcase_06 | AC | 28 ms
11,136 KB |
testcase_07 | AC | 26 ms
11,136 KB |
testcase_08 | AC | 27 ms
11,136 KB |
testcase_09 | AC | 27 ms
11,136 KB |
testcase_10 | AC | 27 ms
11,008 KB |
testcase_11 | AC | 27 ms
11,008 KB |
testcase_12 | AC | 27 ms
11,136 KB |
testcase_13 | AC | 26 ms
11,136 KB |
testcase_14 | AC | 27 ms
11,136 KB |
testcase_15 | AC | 28 ms
11,008 KB |
testcase_16 | AC | 27 ms
11,008 KB |
testcase_17 | AC | 28 ms
11,008 KB |
testcase_18 | AC | 29 ms
10,880 KB |
testcase_19 | AC | 29 ms
11,136 KB |
testcase_20 | AC | 28 ms
11,008 KB |
testcase_21 | AC | 28 ms
11,008 KB |
testcase_22 | AC | 26 ms
11,008 KB |
testcase_23 | AC | 27 ms
11,136 KB |
testcase_24 | AC | 28 ms
11,136 KB |
testcase_25 | AC | 28 ms
11,008 KB |
testcase_26 | AC | 27 ms
11,136 KB |
testcase_27 | AC | 27 ms
11,008 KB |
testcase_28 | AC | 26 ms
11,008 KB |
testcase_29 | AC | 29 ms
11,008 KB |
testcase_30 | AC | 29 ms
11,136 KB |
testcase_31 | AC | 28 ms
11,008 KB |
testcase_32 | AC | 27 ms
11,008 KB |
testcase_33 | RE | - |
testcase_34 | RE | - |
testcase_35 | RE | - |
testcase_36 | RE | - |
testcase_37 | RE | - |
testcase_38 | RE | - |
testcase_39 | RE | - |
testcase_40 | RE | - |
testcase_41 | RE | - |
testcase_42 | RE | - |
testcase_43 | RE | - |
testcase_44 | RE | - |
testcase_45 | RE | - |
testcase_46 | RE | - |
testcase_47 | RE | - |
testcase_48 | RE | - |
testcase_49 | RE | - |
testcase_50 | RE | - |
testcase_51 | RE | - |
testcase_52 | RE | - |
testcase_53 | RE | - |
testcase_54 | RE | - |
testcase_55 | RE | - |
testcase_56 | RE | - |
testcase_57 | RE | - |
testcase_58 | RE | - |
testcase_59 | RE | - |
testcase_60 | RE | - |
testcase_61 | RE | - |
testcase_62 | RE | - |
testcase_63 | RE | - |
testcase_64 | RE | - |
testcase_65 | RE | - |
testcase_66 | RE | - |
testcase_67 | RE | - |
testcase_68 | RE | - |
testcase_69 | RE | - |
testcase_70 | RE | - |
testcase_71 | RE | - |
testcase_72 | RE | - |
testcase_73 | RE | - |
testcase_74 | RE | - |
testcase_75 | RE | - |
testcase_76 | RE | - |
testcase_77 | RE | - |
testcase_78 | RE | - |
testcase_79 | RE | - |
testcase_80 | RE | - |
testcase_81 | RE | - |
testcase_82 | RE | - |
testcase_83 | RE | - |
testcase_84 | RE | - |
testcase_85 | RE | - |
testcase_86 | RE | - |
testcase_87 | RE | - |
testcase_88 | RE | - |
testcase_89 | RE | - |
testcase_90 | RE | - |
testcase_91 | RE | - |
testcase_92 | RE | - |
testcase_93 | RE | - |
testcase_94 | RE | - |
testcase_95 | RE | - |
testcase_96 | RE | - |
testcase_97 | RE | - |
testcase_98 | RE | - |
testcase_99 | RE | - |
testcase_100 | RE | - |
testcase_101 | RE | - |
testcase_102 | RE | - |
testcase_103 | RE | - |
testcase_104 | RE | - |
testcase_105 | RE | - |
testcase_106 | RE | - |
testcase_107 | RE | - |
testcase_108 | RE | - |
testcase_109 | RE | - |
testcase_110 | RE | - |
testcase_111 | RE | - |
testcase_112 | RE | - |
testcase_113 | RE | - |
testcase_114 | RE | - |
testcase_115 | RE | - |
testcase_116 | RE | - |
testcase_117 | RE | - |
testcase_118 | RE | - |
testcase_119 | RE | - |
testcase_120 | RE | - |
testcase_121 | RE | - |
testcase_122 | RE | - |
testcase_123 | RE | - |
ソースコード
#n = int(input()) #入力 #a, b = (int(x) for x in input().split()) #a = [int(x) for x in input().split()] #a = list(map(int, input().split())) #a = [list(map(int,input().split(" "))) for i in range(N)] #2次元 #a.sort() # C++ の sort(a.begin(), a.end()); #a.append(3) # C++ の a.push_back(3); #exit(0) # return 0 的な。終了できる。 import math import copy #math.gcd(a, b) で、gcd 計算できる。 #math.pi は円周率。 INF = 10**18 #べき乗 C++ の pow(10, 18) or 1e18; pi = math.pi large_P = 1000000007 #large_P = 1000000009 #large_P = 998244353 #繰り返し2乗法 #N^aの、Mで割った余りを求める。 def my_pow(N, a, M): if(a == 0): return 1 else: if(a % 2 == 0): tempo = my_pow(N, a/2, M) return (tempo * tempo) % M else: tempo = my_pow(N, a - 1, M) return (tempo * N) % M #N_C_a を M で割った余り def my_combination(N, a, M): res = 1 for i in range(0, a): res *= N - i res %= M for i in range(0, a): res *= my_pow(i + 1, M - 2, M) res %= M return res #N_C_i を M で割った余りを、v[i] に代入する。 def my_combination_table(N, M, v): if(len(v) < N + 1): l = N + 1 - len(v) tempo = [1] * l v.extend(tempo) for i in range(1, N + 1): v[i] = v[i - 1] * (N - (i - 1)) v[i] %= M v[i] *= my_pow(i, M - 2, M) v[i] %= M return #math.factorial で階乗は計算できる。 #math.gcd で gcd は計算できる。 N = int(input()) K = int(input()) N %= 6 K = K % 2 + 2 res = my_pow(N, K, 6) arr = [4, 2, 8, 5, 7, 1] print(arr[res])