結果

問題 No.1312 Snake Eyes
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-06-16 09:32:39
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 793 ms
コンパイル使用メモリ 87,268 KB
実行使用メモリ 76,212 KB
最終ジャッジ日時 2023-08-28 16:46:54
合計ジャッジ時間 13,843 ms
ジャッジサーバーID
(参考情報)
judge13 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,168 KB
testcase_01 AC 69 ms
71,392 KB
testcase_02 AC 68 ms
71,324 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 69 ms
71,324 KB
testcase_06 AC 68 ms
71,124 KB
testcase_07 AC 69 ms
71,396 KB
testcase_08 AC 69 ms
71,072 KB
testcase_09 AC 69 ms
71,484 KB
testcase_10 AC 70 ms
71,480 KB
testcase_11 AC 71 ms
71,436 KB
testcase_12 AC 69 ms
71,424 KB
testcase_13 AC 69 ms
71,120 KB
testcase_14 AC 69 ms
71,368 KB
testcase_15 AC 69 ms
71,288 KB
testcase_16 AC 68 ms
71,436 KB
testcase_17 AC 70 ms
71,308 KB
testcase_18 AC 69 ms
71,440 KB
testcase_19 AC 69 ms
71,336 KB
testcase_20 AC 70 ms
71,588 KB
testcase_21 AC 71 ms
71,304 KB
testcase_22 AC 68 ms
71,124 KB
testcase_23 AC 70 ms
71,508 KB
testcase_24 AC 74 ms
75,896 KB
testcase_25 AC 74 ms
75,940 KB
testcase_26 AC 69 ms
71,312 KB
testcase_27 AC 81 ms
76,052 KB
testcase_28 AC 69 ms
71,336 KB
testcase_29 AC 73 ms
75,780 KB
testcase_30 AC 74 ms
75,924 KB
testcase_31 AC 74 ms
75,928 KB
testcase_32 AC 69 ms
71,472 KB
testcase_33 AC 76 ms
75,916 KB
testcase_34 AC 73 ms
75,908 KB
testcase_35 AC 80 ms
76,024 KB
testcase_36 AC 71 ms
71,536 KB
testcase_37 AC 73 ms
75,932 KB
testcase_38 AC 74 ms
75,936 KB
testcase_39 TLE -
testcase_40 AC 82 ms
75,800 KB
testcase_41 AC 139 ms
75,784 KB
testcase_42 AC 1,269 ms
75,796 KB
testcase_43 AC 260 ms
75,828 KB
testcase_44 AC 145 ms
75,924 KB
testcase_45 AC 82 ms
76,024 KB
testcase_46 AC 1,142 ms
75,984 KB
testcase_47 TLE -
testcase_48 -- -
testcase_49 -- -
testcase_50 -- -
testcase_51 -- -
testcase_52 -- -
testcase_53 -- -
testcase_54 -- -
testcase_55 -- -
testcase_56 -- -
testcase_57 -- -
testcase_58 -- -
testcase_59 -- -
testcase_60 -- -
testcase_61 -- -
testcase_62 -- -
testcase_63 -- -
testcase_64 -- -
testcase_65 -- -
testcase_66 -- -
testcase_67 -- -
testcase_68 -- -
testcase_69 -- -
testcase_70 -- -
testcase_71 -- -
testcase_72 -- -
testcase_73 -- -
testcase_74 -- -
testcase_75 -- -
testcase_76 -- -
testcase_77 -- -
testcase_78 -- -
testcase_79 -- -
testcase_80 -- -
testcase_81 -- -
testcase_82 -- -
testcase_83 -- -
testcase_84 -- -
testcase_85 -- -
testcase_86 -- -
testcase_87 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

n=int(input())
ans=n-1
for i in range(2,n):
  nn=n
  t=nn%i
  nn//=i
  flg=True
  while nn:
    if t==nn%i:
      nn//=i
    else:
      flg=False
      break
  if flg:
    print(i)
    exit()
# ぞろ目になっても2桁を超えない
st=set()
for i in range(1,int(n**.5)+1):
  if n%i==0:
    st.add(i)
    st.add(n//i)
# n=x*(p+1)=x*p+x
# x:nの約数
for x in st:
  p=n//x
  p-=1
  if p>=10**6 and n%p==(n//p)%p:
    ans=min(ans,p)
print(ans)
0