結果
問題 |
No.316 もっと刺激的なFizzBuzzをください
|
ユーザー |
|
提出日時 | 2021-09-02 23:35:22 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
TLE
|
実行時間 | - |
コード長 | 822 bytes |
コンパイル時間 | 1,919 ms |
コンパイル使用メモリ | 192,256 KB |
最終ジャッジ日時 | 2025-01-24 04:26:28 |
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 |
other | AC * 18 TLE * 15 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for (int i = 0; i < (n); ++i) using namespace std; using ll = long long; using P = pair<int, int>; struct fast_ios { fast_ios(){ cin.tie(nullptr), ios::sync_with_stdio(false), cout << fixed << setprecision(20); }; } fast_ios_; const int INF = (int)1e9; const ll INFL = (ll)1e18; const int MOD = 1e9 + 7; const double EPS = 1e-10; int dx[]={0, 0, -1, 1}; int dy[]={1, -1, 0, 0}; template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; } template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; } int main() { int n, a, b, c; cin >> n >> a >> b >> c; int ans = 0; for (int i = 1; i <= n; i++) { if (i % a == 0 || i % b == 0 || i % c == 0) ans += 1; } cout << ans << endl; return 0; }