結果

問題 No.1514 Squared Matching
ユーザー kozykozy
提出日時 2021-05-21 22:09:02
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 1,512 ms / 4,000 ms
コード長 277 bytes
コンパイル時間 499 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 466,432 KB
最終ジャッジ日時 2024-10-10 08:53:24
合計ジャッジ時間 28,043 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 167 ms
444,160 KB
testcase_01 AC 1,505 ms
466,100 KB
testcase_02 AC 165 ms
443,776 KB
testcase_03 AC 165 ms
443,648 KB
testcase_04 AC 165 ms
444,288 KB
testcase_05 AC 173 ms
448,384 KB
testcase_06 AC 197 ms
466,164 KB
testcase_07 AC 435 ms
466,048 KB
testcase_08 AC 1,448 ms
466,432 KB
testcase_09 AC 1,278 ms
466,048 KB
testcase_10 AC 1,372 ms
466,432 KB
testcase_11 AC 1,435 ms
466,176 KB
testcase_12 AC 1,455 ms
465,792 KB
testcase_13 AC 1,478 ms
466,176 KB
testcase_14 AC 1,493 ms
466,256 KB
testcase_15 AC 1,499 ms
466,172 KB
testcase_16 AC 1,480 ms
466,432 KB
testcase_17 AC 1,499 ms
465,792 KB
testcase_18 AC 1,512 ms
465,792 KB
testcase_19 AC 1,500 ms
465,792 KB
testcase_20 AC 1,504 ms
465,792 KB
testcase_21 AC 1,488 ms
466,344 KB
testcase_22 AC 444 ms
466,008 KB
testcase_23 AC 748 ms
466,332 KB
testcase_24 AC 969 ms
466,432 KB
testcase_25 AC 1,224 ms
466,304 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