結果

問題 No.1312 Snake Eyes
ユーザー marroncastlemarroncastle
提出日時 2020-12-11 08:50:44
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 382 bytes
コンパイル時間 200 ms
コンパイル使用メモリ 81,852 KB
実行使用メモリ 61,984 KB
最終ジャッジ日時 2023-10-20 01:22:08
合計ジャッジ時間 6,387 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,596 KB
testcase_01 AC 37 ms
53,596 KB
testcase_02 AC 37 ms
53,596 KB
testcase_03 AC 35 ms
53,596 KB
testcase_04 AC 37 ms
53,596 KB
testcase_05 AC 36 ms
53,596 KB
testcase_06 AC 36 ms
53,596 KB
testcase_07 AC 36 ms
53,596 KB
testcase_08 AC 36 ms
53,596 KB
testcase_09 AC 37 ms
53,596 KB
testcase_10 AC 36 ms
53,596 KB
testcase_11 AC 36 ms
53,596 KB
testcase_12 AC 36 ms
53,596 KB
testcase_13 AC 36 ms
53,596 KB
testcase_14 AC 36 ms
53,596 KB
testcase_15 AC 35 ms
53,596 KB
testcase_16 AC 35 ms
53,596 KB
testcase_17 WA -
testcase_18 AC 36 ms
53,596 KB
testcase_19 AC 37 ms
53,596 KB
testcase_20 AC 36 ms
53,596 KB
testcase_21 AC 36 ms
53,596 KB
testcase_22 AC 36 ms
53,596 KB
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 AC 37 ms
53,596 KB
testcase_27 AC 36 ms
53,596 KB
testcase_28 WA -
testcase_29 AC 42 ms
59,908 KB
testcase_30 WA -
testcase_31 AC 37 ms
53,596 KB
testcase_32 AC 37 ms
53,596 KB
testcase_33 AC 37 ms
53,596 KB
testcase_34 AC 37 ms
53,596 KB
testcase_35 AC 37 ms
53,596 KB
testcase_36 AC 37 ms
53,596 KB
testcase_37 AC 40 ms
59,908 KB
testcase_38 WA -
testcase_39 AC 46 ms
61,984 KB
testcase_40 AC 45 ms
61,984 KB
testcase_41 WA -
testcase_42 AC 41 ms
59,916 KB
testcase_43 WA -
testcase_44 AC 41 ms
59,916 KB
testcase_45 AC 42 ms
59,916 KB
testcase_46 WA -
testcase_47 AC 43 ms
59,916 KB
testcase_48 WA -
testcase_49 WA -
testcase_50 AC 66 ms
61,984 KB
testcase_51 WA -
testcase_52 AC 77 ms
61,984 KB
testcase_53 AC 69 ms
61,984 KB
testcase_54 AC 74 ms
61,984 KB
testcase_55 AC 58 ms
61,984 KB
testcase_56 WA -
testcase_57 AC 64 ms
61,984 KB
testcase_58 WA -
testcase_59 AC 54 ms
61,984 KB
testcase_60 AC 63 ms
61,984 KB
testcase_61 AC 75 ms
61,984 KB
testcase_62 AC 57 ms
61,984 KB
testcase_63 WA -
testcase_64 AC 44 ms
61,984 KB
testcase_65 AC 47 ms
61,984 KB
testcase_66 WA -
testcase_67 AC 36 ms
53,596 KB
testcase_68 AC 46 ms
61,984 KB
testcase_69 WA -
testcase_70 AC 71 ms
61,984 KB
testcase_71 AC 49 ms
59,920 KB
testcase_72 AC 46 ms
61,984 KB
testcase_73 AC 42 ms
59,916 KB
testcase_74 AC 37 ms
53,596 KB
testcase_75 AC 42 ms
59,916 KB
testcase_76 WA -
testcase_77 AC 79 ms
61,984 KB
testcase_78 AC 79 ms
61,984 KB
testcase_79 AC 53 ms
59,920 KB
testcase_80 AC 83 ms
61,984 KB
testcase_81 AC 74 ms
61,984 KB
testcase_82 WA -
testcase_83 WA -
testcase_84 AC 77 ms
61,984 KB
testcase_85 AC 76 ms
61,984 KB
testcase_86 WA -
testcase_87 AC 61 ms
61,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
def divisor(n):
  cd = []
  i = 1
  while i*i <= n:
    if n%i==0:
      # cd.append(i)
      if n//i - i >= 2:
        cd.append(n//i)
    i += 1
  return cd[-1]

if N<=2:
  print(N+1)
  exit()
ans = divisor(N)-1
for m in range(3,41):
  p = 2
  while pow(p,m)-1<=N*(p-1):
    if (N*(p-1))%(pow(p,m)-1)==0:
      ans = min(ans, p)
      break
    p += 1
print(ans) 
0