結果
問題 | No.316 もっと刺激的なFizzBuzzをください |
ユーザー |
|
提出日時 | 2017-06-20 15:48:53 |
言語 | D (dmd 2.109.1) |
結果 |
AC
|
実行時間 | 1 ms / 1,000 ms |
コード長 | 411 bytes |
コンパイル時間 | 952 ms |
コンパイル使用メモリ | 105,892 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-12 20:20:03 |
合計ジャッジ時間 | 2,353 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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.algorithm, std.conv, std.range, std.stdio, std.string;import std.numeric; // gcd, fftvoid main(){auto n = readln.chomp.to!long;auto rd = readln.split.to!(long[]), a = rd[0], b = rd[1], c = rd[2];auto ab = a / gcd(a, b) * b, bc = b / gcd(b, c) * c, ca = c / gcd(c, a) * a;auto abc = ab / gcd(ab, bc) * bc;auto r = n/a + n/b + n/c - (n/ab + n/bc + n/ca) + n/abc;writeln(r);}