結果
| 問題 |
No.379 五円硬貨
|
| コンテスト | |
| ユーザー |
nobigomu
|
| 提出日時 | 2018-05-01 00:14:08 |
| 言語 | Lua (LuaJit 2.1.1734355927) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 881 bytes |
| コンパイル時間 | 34 ms |
| コンパイル使用メモリ | 5,120 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-06-28 00:00:46 |
| 合計ジャッジ時間 | 885 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 16 |
ソースコード
local ffi = require 'ffi'
local M = ffi.load 'gmp'
ffi.cdef [[
typedef unsigned long mp_bitcnt_t;
typedef unsigned long mp_limb_t;
typedef long mp_exp_t;
typedef struct {
int _mp_prec;
int _mp_size;
mp_exp_t _mp_exp;
mp_limb_t * _mp_d;
} __mpf_struct;
typedef __mpf_struct mpf_t[1];
typedef const __mpf_struct * mpf_srcptr;
typedef __mpf_struct * mpf_ptr;
void __gmpf_init_set_ui(mpf_ptr, unsigned long);
void __gmpf_div_ui(mpf_ptr, mpf_srcptr, unsigned long);
void __gmpf_mul_ui(mpf_ptr, mpf_srcptr, unsigned long);
void __gmpf_set_default_prec(mp_bitcnt_t);
int __gmp_printf(const char *, ...);
]]
M.__gmpf_set_default_prec(128ULL)
M.__gmp_printf("%.15Ff\n", (function (n, g, v)
local t=ffi.new("mpf_t")
M.__gmpf_init_set_ui(t,n/5ULL)
M.__gmpf_mul_ui(t,t,g+0ULL)
M.__gmpf_div_ui(t,t,v+0ULL)
return t
end)(io.stdin:read("*n"), io.stdin:read("*n"), io.stdin:read("*n")))
nobigomu