結果
問題 | No.316 もっと刺激的なFizzBuzzをください |
ユーザー |
|
提出日時 | 2022-06-13 00:08:11 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 323 bytes |
コンパイル時間 | 2,761 ms |
コンパイル使用メモリ | 245,012 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 12:32:39 |
合計ジャッジ時間 | 4,121 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include <bits/stdc++.h>using std::cin;using std::cout;using std::lcm;using ll = long long;int main() {ll n, a, b, c;cin >> n >> a >> b >> c;ll ans = n/a + n/b + n/c;ans -= n/lcm(a,b) + n/lcm(a,c) + n/lcm(b,c);ans += n/lcm(lcm(a,b),c);cout << ans << '\n';return 0;}