結果
問題 | No.1514 Squared Matching |
ユーザー |
![]() |
提出日時 | 2021-06-17 07:13:35 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 1,048 ms / 4,000 ms |
コード長 | 314 bytes |
コンパイル時間 | 274 ms |
コンパイル使用メモリ | 82,600 KB |
実行使用メモリ | 450,284 KB |
最終ジャッジ日時 | 2025-01-02 07:42:10 |
合計ジャッジ時間 | 16,904 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 26 |
ソースコード
n=int(input()) ans=0 maxsqrt=0 sums=[1]*(n+1) sums[0]=0 i=2 while i*i<=n: j=i*i for k in range(j,n+1,j): sums[k]=0 i+=1 currsum=0 for i in range(n+1): currsum+=sums[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)