結果
問題 |
No.3152 neither multiple of A nor B
|
ユーザー |
![]() |
提出日時 | 2025-05-20 21:38:20 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 454 bytes |
コンパイル時間 | 3,017 ms |
コンパイル使用メモリ | 275,900 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-05-20 21:38:25 |
合計ジャッジ時間 | 4,797 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 |
ソースコード
//#define _GLIBCXX_DEBUG #include <bits/stdc++.h> using namespace std; #define rep(i, n) for (ll i = 0; i < (ll)(n); i++) #define all(a) (a).begin(), (a).end() using ll = long long; const ll INF32 = 2e9; const ll INF64 = 4e18; void printYN(bool ok){ if(ok)cout << "Yes" << endl; else cout << "No" << endl; return; } int main() { long long N, A, B; cin >> N >> A >> B; cout << N-N/A-N/B+N/(A*B/gcd(A, B)) << endl; return 0; }