結果

問題 No.1514 Squared Matching
ユーザー kozykozy
提出日時 2021-05-21 22:09:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,483 ms / 4,000 ms
コード長 277 bytes
コンパイル時間 159 ms
コンパイル使用メモリ 81,892 KB
実行使用メモリ 466,504 KB
最終ジャッジ日時 2024-04-18 15:39:23
合計ジャッジ時間 27,977 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 240 ms
444,324 KB
testcase_01 AC 1,471 ms
466,248 KB
testcase_02 AC 225 ms
444,508 KB
testcase_03 AC 225 ms
444,336 KB
testcase_04 AC 224 ms
444,944 KB
testcase_05 AC 229 ms
447,880 KB
testcase_06 AC 260 ms
465,544 KB
testcase_07 AC 461 ms
465,672 KB
testcase_08 AC 1,450 ms
465,556 KB
testcase_09 AC 1,269 ms
466,276 KB
testcase_10 AC 1,332 ms
466,204 KB
testcase_11 AC 1,387 ms
465,552 KB
testcase_12 AC 1,449 ms
466,208 KB
testcase_13 AC 1,478 ms
465,924 KB
testcase_14 AC 1,409 ms
465,964 KB
testcase_15 AC 1,467 ms
466,124 KB
testcase_16 AC 1,455 ms
465,664 KB
testcase_17 AC 1,437 ms
465,932 KB
testcase_18 AC 1,445 ms
465,952 KB
testcase_19 AC 1,452 ms
466,152 KB
testcase_20 AC 1,432 ms
466,116 KB
testcase_21 AC 1,483 ms
466,268 KB
testcase_22 AC 493 ms
466,048 KB
testcase_23 AC 737 ms
465,812 KB
testcase_24 AC 998 ms
466,504 KB
testcase_25 AC 1,212 ms
466,352 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
  N=int(input())
  A=[0]*50000000
  ans1=0
  for i in range(1,N+1):
    if A[i-1]==1:
      continue
    ans=1
    for j in range(2,N+1):
      c=i*(j**2)
      if c>N:
        break
      else:
        A[c-1]=1
        ans+=1
    ans1+=ans*ans
  print(ans1)
main()
0