結果

問題 No.2552 Not Coprime, Not Divisor
ユーザー sepa38sepa38
提出日時 2023-11-17 23:13:10
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 138 ms / 2,000 ms
コード長 233 bytes
コンパイル時間 170 ms
コンパイル使用メモリ 81,700 KB
実行使用メモリ 72,124 KB
最終ジャッジ日時 2023-11-17 23:13:34
合計ジャッジ時間 3,329 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 82 ms
65,716 KB
testcase_01 AC 120 ms
70,456 KB
testcase_02 AC 76 ms
65,188 KB
testcase_03 AC 122 ms
70,380 KB
testcase_04 AC 115 ms
70,396 KB
testcase_05 AC 57 ms
63,440 KB
testcase_06 AC 120 ms
70,872 KB
testcase_07 AC 133 ms
71,660 KB
testcase_08 AC 102 ms
69,420 KB
testcase_09 AC 132 ms
72,124 KB
testcase_10 AC 73 ms
64,880 KB
testcase_11 AC 94 ms
68,816 KB
testcase_12 AC 138 ms
71,780 KB
testcase_13 AC 82 ms
65,452 KB
testcase_14 AC 70 ms
64,408 KB
testcase_15 AC 36 ms
53,460 KB
testcase_16 AC 36 ms
53,460 KB
testcase_17 AC 66 ms
64,068 KB
testcase_18 AC 36 ms
53,460 KB
testcase_19 AC 36 ms
53,460 KB
testcase_20 AC 35 ms
53,460 KB
testcase_21 AC 37 ms
53,460 KB
testcase_22 AC 36 ms
53,460 KB
testcase_23 AC 37 ms
53,460 KB
testcase_24 AC 35 ms
53,460 KB
testcase_25 AC 35 ms
53,460 KB
testcase_26 AC 36 ms
53,460 KB
testcase_27 AC 36 ms
53,460 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ls = [i for i in range(n+1)]
for i in range(2, n+1):
  if ls[i] != i:
    continue
  for j in range(i, n+1, i):
    ls[j] -= ls[j] // i
ans = 0
for i in range(1, n+1):
  ans += ((n // i) - 1) * (ls[i] - 1)
print(ans)
0