結果
問題 |
No.3152 neither multiple of A nor B
|
ユーザー |
![]() |
提出日時 | 2025-05-20 21:35:11 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 262 bytes |
コンパイル時間 | 935 ms |
コンパイル使用メモリ | 109,992 KB |
実行使用メモリ | 6,272 KB |
最終ジャッジ日時 | 2025-05-20 21:35:13 |
合計ジャッジ時間 | 2,284 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 40 |
ソースコード
#include<iostream> #include<vector> #include<math.h> #include<iomanip> #include<numeric> using namespace std; int main() { long long N,A,B; cin>>N>>A>>B; long long a = N/A; long long b = N/B; long long ab = N/(lcm(A,B)); cout << N - a - b + ab << endl; }