結果

問題 No.3079 アルベド
ユーザー 👑 obakyanobakyan
提出日時 2022-04-16 21:52:32
言語 Lua
(LuaJit 2.1.1696795921)
結果
AC  
実行時間 66 ms / 2,000 ms
コード長 376 bytes
コンパイル時間 190 ms
コンパイル使用メモリ 5,296 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-26 21:15:40
合計ジャッジ時間 1,280 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 12 ms
4,376 KB
testcase_01 AC 66 ms
4,376 KB
testcase_02 AC 43 ms
4,380 KB
testcase_03 AC 29 ms
4,376 KB
testcase_04 AC 53 ms
4,380 KB
testcase_05 AC 38 ms
4,380 KB
testcase_06 AC 44 ms
4,376 KB
testcase_07 AC 11 ms
4,380 KB
testcase_08 AC 15 ms
4,380 KB
testcase_09 AC 35 ms
4,380 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

local t = {}
for i = 1, 100000 do
  t[i] = true
end
t[1] = false
for i = 2, 100000 do
  if t[i] then
    local d = i + i
    while d <= 100000 do
      t[d] = false
      d = d + i
    end
  end
end
t[1] = 0
for i = 2, 100000 do
  if t[i] then
    t[i] = t[i - 1] + 1
  else
    t[i] = t[i - 1]
  end
end
local q = io.read("*n")
for iq = 1, q do
  print(t[io.read("*n")])
end
0