結果
問題 | No.316 もっと刺激的なFizzBuzzをください |
ユーザー |
![]() |
提出日時 | 2017-02-01 01:50:54 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 510 bytes |
コンパイル時間 | 690 ms |
コンパイル使用メモリ | 105,228 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 06:49:02 |
合計ジャッジ時間 | 1,606 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/numeric.d(2999): Warning: cannot inline function `std.numeric.gcdImpl!ulong.gcdImpl`
ソースコード
import std.stdio;import std.algorithm;import std.string : chomp;import std.range;import std.conv;import std.numeric;void main(string[] args){auto lcm(ulong a, ulong b) { return a * b / gcd(a, b); }immutable n = readln.chomp.to!int;auto input = readln.splitter.map!(to!int).array;ulong a = input[0], b = input[1], c = input[2];writeln(n / a + n / b + n / c- n / lcm(a, b)- n / lcm(a, c)- n / lcm(b, c)+ n / lcm(lcm(a, b), c));}