結果

問題 No.2051 Divide
コンテスト
ユーザー obakyan
提出日時 2022-08-23 22:43:27
言語 Lua
(LuaJit 2.1.1787165859)
コンパイル:
luajit -b _filename_ a.out
実行:
luajit _filename_
結果
AC  
実行時間 1 ms / 2,000 ms
+ 222µs
コード長 308 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 3 ms
コンパイル使用メモリ 6,528 KB
実行使用メモリ 6,528 KB
最終ジャッジ日時 2026-09-13 18:46:18
合計ジャッジ時間 1,496 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 23
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

local a, b = io.read("*n", "*n")
local c = 0
for i = 1, 100000 do
  if a % i == 0 then
    local j = math.floor(a / i)
    if i < j then
      if i % b == 0 then c = c + 1 end
      if j % b == 0 then c = c + 1 end    
    elseif i == j then
      if i % b == 0 then c = c + 1 end
    end
  end
end
print(c)
0