結果
問題 | No.152 貯金箱の消失 |
ユーザー |
👑 |
提出日時 | 2020-04-20 00:08:42 |
言語 | Lua (LuaJit 2.1.1734355927) |
結果 |
AC
|
実行時間 | 15 ms / 5,000 ms |
コード長 | 419 bytes |
コンパイル時間 | 156 ms |
コンパイル使用メモリ | 6,820 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-06 08:14:58 |
合計ジャッジ時間 | 819 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
ソースコード
local function getgcd(x, y)while 0 < x dox, y = y % x, xendreturn yendlocal x = io.read("*n")x = math.floor(x / 4)local ret = 0for n = 1, x doif x < 2 * (n + 1) * (2 * n + 1) thenbreakendfor m = n + 1, x, 2 dolocal sum = 2 * m * (m + n)if x < sum thenbreakelseif getgcd(m, n) == 1 thenret = ret + 1endendendendprint(ret % 1000003)