結果
問題 | No.1514 Squared Matching |
ユーザー | yuusanlondon |
提出日時 | 2021-06-17 07:10:53 |
言語 | PyPy3 (7.3.15) |
結果 |
MLE
|
実行時間 | - |
コード長 | 317 bytes |
コンパイル時間 | 1,316 ms |
コンパイル使用メモリ | 86,892 KB |
実行使用メモリ | 840,796 KB |
最終ジャッジ日時 | 2023-08-30 15:51:29 |
合計ジャッジ時間 | 3,027 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge11 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 71 ms
71,016 KB |
testcase_01 | MLE | - |
testcase_02 | -- | - |
testcase_03 | -- | - |
testcase_04 | -- | - |
testcase_05 | -- | - |
testcase_06 | -- | - |
testcase_07 | -- | - |
testcase_08 | -- | - |
testcase_09 | -- | - |
testcase_10 | -- | - |
testcase_11 | -- | - |
testcase_12 | -- | - |
testcase_13 | -- | - |
testcase_14 | -- | - |
testcase_15 | -- | - |
testcase_16 | -- | - |
testcase_17 | -- | - |
testcase_18 | -- | - |
testcase_19 | -- | - |
testcase_20 | -- | - |
testcase_21 | -- | - |
testcase_22 | -- | - |
testcase_23 | -- | - |
testcase_24 | -- | - |
testcase_25 | -- | - |
ソースコード
n=int(input()) ans=0 maxsqrt=0 a=[1]*(n+1) a[0]=0 i=2 while i*i<=n: j=i*i for k in range(j,n+1,j): a[k]=0 i+=1 sums=[0]*(n+1) currsum=0 for i in range(n+1): currsum+=a[i] sums[i]=currsum while (maxsqrt+1)*(maxsqrt+1)<=n: maxsqrt+=1 b=1 while b*b<=n: ans+=(2*b-1)*(sums[n//(b*b)]) b+=1 print(ans)