結果
問題 | No.1312 Snake Eyes |
ユーザー | Kiri8128 |
提出日時 | 2020-12-09 00:12:42 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 166 ms / 2,000 ms |
コード長 | 901 bytes |
コンパイル時間 | 244 ms |
コンパイル使用メモリ | 82,176 KB |
実行使用メモリ | 75,832 KB |
最終ジャッジ日時 | 2024-11-30 12:53:51 |
合計ジャッジ時間 | 8,186 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 36 ms
51,712 KB |
testcase_01 | AC | 35 ms
51,712 KB |
testcase_02 | AC | 34 ms
51,712 KB |
testcase_03 | AC | 35 ms
51,840 KB |
testcase_04 | AC | 37 ms
51,840 KB |
testcase_05 | AC | 37 ms
52,096 KB |
testcase_06 | AC | 37 ms
52,224 KB |
testcase_07 | AC | 36 ms
51,968 KB |
testcase_08 | AC | 37 ms
51,968 KB |
testcase_09 | AC | 38 ms
51,584 KB |
testcase_10 | AC | 38 ms
52,224 KB |
testcase_11 | AC | 35 ms
51,712 KB |
testcase_12 | AC | 34 ms
52,096 KB |
testcase_13 | AC | 35 ms
52,352 KB |
testcase_14 | AC | 35 ms
52,736 KB |
testcase_15 | AC | 35 ms
52,608 KB |
testcase_16 | AC | 34 ms
52,096 KB |
testcase_17 | AC | 37 ms
52,480 KB |
testcase_18 | AC | 36 ms
52,096 KB |
testcase_19 | AC | 38 ms
51,712 KB |
testcase_20 | AC | 37 ms
51,712 KB |
testcase_21 | AC | 37 ms
52,096 KB |
testcase_22 | AC | 39 ms
59,264 KB |
testcase_23 | AC | 40 ms
58,880 KB |
testcase_24 | AC | 43 ms
59,000 KB |
testcase_25 | AC | 42 ms
58,624 KB |
testcase_26 | AC | 39 ms
58,496 KB |
testcase_27 | AC | 56 ms
59,392 KB |
testcase_28 | AC | 33 ms
52,352 KB |
testcase_29 | AC | 43 ms
58,752 KB |
testcase_30 | AC | 44 ms
59,136 KB |
testcase_31 | AC | 41 ms
58,752 KB |
testcase_32 | AC | 40 ms
59,136 KB |
testcase_33 | AC | 46 ms
58,752 KB |
testcase_34 | AC | 38 ms
58,880 KB |
testcase_35 | AC | 47 ms
59,008 KB |
testcase_36 | AC | 41 ms
58,368 KB |
testcase_37 | AC | 44 ms
59,392 KB |
testcase_38 | AC | 44 ms
58,880 KB |
testcase_39 | AC | 113 ms
59,776 KB |
testcase_40 | AC | 52 ms
59,264 KB |
testcase_41 | AC | 109 ms
59,264 KB |
testcase_42 | AC | 102 ms
59,264 KB |
testcase_43 | AC | 115 ms
58,880 KB |
testcase_44 | AC | 103 ms
58,880 KB |
testcase_45 | AC | 53 ms
58,752 KB |
testcase_46 | AC | 105 ms
59,648 KB |
testcase_47 | AC | 112 ms
60,288 KB |
testcase_48 | AC | 140 ms
75,264 KB |
testcase_49 | AC | 135 ms
75,328 KB |
testcase_50 | AC | 128 ms
75,596 KB |
testcase_51 | AC | 116 ms
75,832 KB |
testcase_52 | AC | 142 ms
75,520 KB |
testcase_53 | AC | 138 ms
75,512 KB |
testcase_54 | AC | 138 ms
75,776 KB |
testcase_55 | AC | 124 ms
75,520 KB |
testcase_56 | AC | 110 ms
75,264 KB |
testcase_57 | AC | 139 ms
75,448 KB |
testcase_58 | AC | 138 ms
75,520 KB |
testcase_59 | AC | 80 ms
75,500 KB |
testcase_60 | AC | 141 ms
75,648 KB |
testcase_61 | AC | 154 ms
75,636 KB |
testcase_62 | AC | 85 ms
75,136 KB |
testcase_63 | AC | 43 ms
59,008 KB |
testcase_64 | AC | 36 ms
51,712 KB |
testcase_65 | AC | 36 ms
52,352 KB |
testcase_66 | AC | 42 ms
58,752 KB |
testcase_67 | AC | 42 ms
51,712 KB |
testcase_68 | AC | 39 ms
52,224 KB |
testcase_69 | AC | 37 ms
52,352 KB |
testcase_70 | AC | 36 ms
52,096 KB |
testcase_71 | AC | 35 ms
51,712 KB |
testcase_72 | AC | 37 ms
51,712 KB |
testcase_73 | AC | 35 ms
52,224 KB |
testcase_74 | AC | 37 ms
52,224 KB |
testcase_75 | AC | 38 ms
51,712 KB |
testcase_76 | AC | 140 ms
75,516 KB |
testcase_77 | AC | 150 ms
75,520 KB |
testcase_78 | AC | 143 ms
75,136 KB |
testcase_79 | AC | 35 ms
52,096 KB |
testcase_80 | AC | 152 ms
75,008 KB |
testcase_81 | AC | 134 ms
75,136 KB |
testcase_82 | AC | 53 ms
60,672 KB |
testcase_83 | AC | 159 ms
75,392 KB |
testcase_84 | AC | 166 ms
75,520 KB |
testcase_85 | AC | 37 ms
51,712 KB |
testcase_86 | AC | 37 ms
51,968 KB |
testcase_87 | AC | 123 ms
75,648 KB |
ソースコード
def primeFactor(N): i, n, ret, d, sq = 2, N, {}, 2, 99 while i <= sq: k = 0 while n % i == 0: n, k, ret[i] = n//i, k+1, k+1 if k > 0 or i == 97: sq = int(n**(1/2)+0.5) if i < 4: i = i * 2 - 1 else: i, d = i+d, d^6 if n > 1: ret[n] = 1 return ret def divisors(N): pf = primeFactor(N) ret = [1] for p in pf: ret_prev = ret ret = [] for i in range(pf[p]+1): for r in ret_prev: ret.append(r * (p ** i)) return sorted(ret) N = int(input()) for p in range(2, 10 ** 6 + 10): s = 0 a = 1 f = 0 while s < N: s += a a *= p if N % s == 0 and N // s < p: f = 1 break if f: print(p) break else: for d in divisors(N): a = N // d if a < d - 1: print(d - 1) break