結果
問題 | No.316 もっと刺激的なFizzBuzzをください |
ユーザー |
|
提出日時 | 2018-07-23 16:20:17 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 1,000 ms |
コード長 | 539 bytes |
コンパイル時間 | 2,057 ms |
コンパイル使用メモリ | 192,108 KB |
最終ジャッジ日時 | 2025-01-06 12:01:48 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 33 |
ソースコード
#include "bits/stdc++.h"using namespace std;#define fastcin {\cin.tie(0);\ios::sync_with_stdio(false);\}#define rep(i, a, b) for(int i = a; i < b; i++)#define print(x) cout << x << "\n"typedef long long ll;int main() {fastcin;ll n, a[7], ans = 0;cin >> n >> a[0] >> a[1] >> a[2];a[3] = lcm(a[0], a[1]);a[4] = lcm(a[1], a[2]);a[5] = lcm(a[0], a[2]);a[6] = lcm(a[3], a[4]);rep(i, 0, 3) ans += n/a[i];rep(i, 3, 6) ans -= n/a[i];ans += n/a[6];print(ans);return 0;}