結果
問題 | No.316 もっと刺激的なFizzBuzzをください |
ユーザー |
![]() |
提出日時 | 2023-05-04 23:50:14 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 1,008 bytes |
コンパイル時間 | 2,795 ms |
コンパイル使用メモリ | 243,556 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-22 13:13:00 |
合計ジャッジ時間 | 4,285 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#line 2 "library/src/template.hpp"#include<bits/stdc++.h>#define rep(i, N) for (int i = 0; i < (N); i++)#define all(x) (x).begin(),(x).end()#define popcount(x) __builtin_popcount(x)using i128=__int128_t;using ll = long long;using ld = long double;using graph = std::vector<std::vector<int>>;using P = std::pair<int, int>;constexpr int inf = 1e9;constexpr ll infl = 1e18;constexpr ld eps = 1e-6;const long double pi = acos(-1);constexpr uint64_t MOD = 1e9 + 7;constexpr uint64_t MOD2 = 998244353;constexpr int dx[] = { 1,0,-1,0 };constexpr int dy[] = { 0,1,0,-1 };template<class T>constexpr inline void chmax(T&x,T y){if(x<y)x=y;}template<class T>constexpr inline void chmin(T&x,T y){if(x>y)x=y;}#line 2 "main.cpp"using namespace std;int main(){ll n, a, b, c;cin >> n >> a >> b >> c;ll sum = 0;sum += n / a, sum += n / b, sum += n / c;sum -= n / lcm(a, b), sum -= n / lcm(b, c), sum -= n/lcm(c, a);sum += n / lcm(a, lcm(b, c));cout << sum << '\n';}