結果
| 問題 | No.316 もっと刺激的なFizzBuzzをください |
| コンテスト | |
| ユーザー |
cww
|
| 提出日時 | 2015-12-14 01:49:51 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 402 bytes |
| 記録 | |
| コンパイル時間 | 943 ms |
| コンパイル使用メモリ | 77,884 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-04 19:38:29 |
| 合計ジャッジ時間 | 2,293 ms |
|
ジャッジサーバーID (参考情報) |
judge5_1 / judge4_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 4 |
| other | AC * 33 |
コンパイルメッセージ
In file included from /usr/local/include/boost/config/header_deprecated.hpp:18,
from /usr/local/include/boost/math/tools/header_deprecated.hpp:11,
from /usr/local/include/boost/math/common_factor_rt.hpp:12,
from main.cpp:2:
/usr/local/include/boost/math/common_factor_rt.hpp:14:1: note: '#pragma message: This header is deprecated. Use <boost/integer/common_factor_rt.hpp> instead.'
14 | BOOST_MATH_HEADER_DEPRECATED("<boost/integer/common_factor_rt.hpp>");
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
ソースコード
#include<iostream>
#include <boost/math/common_factor_rt.hpp>
using namespace std;
int main(){
long long int a,b,c,n,ans,r1,r2,r3,r4;
cin >> n >> a >> b >> c;
r1 = n/boost::math::lcm(a,b);
r2 = n/boost::math::lcm(b,c);
r3 = n/boost::math::lcm(c,a);
r4 = n/boost::math::lcm(a,boost::math::lcm(b,c));
ans = n/a + n/b + n/c;
cout << ans-r1-r2-r3+r4 << endl;
return 0;
}
cww