結果
問題 | No.894 二種類のバス |
ユーザー |
|
提出日時 | 2019-09-29 14:05:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 346 bytes |
コンパイル時間 | 733 ms |
コンパイル使用メモリ | 91,608 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-03 04:27:50 |
合計ジャッジ時間 | 1,447 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 3 |
other | WA * 17 |
ソースコード
#include<iostream> #include<algorithm> #include<cmath> #include<iomanip> #include<vector> #include<map> #include<queue> using namespace std; typedef long long ll; const int MOD=1e9+7; int main() { ll a,b,t,ans=0,g,l; cin >> t >> a >> b; ans+=(t-1)/a+1; ans+=(t-1)/b+1; g=__gcd(a,b); l=a/g*b+1; ans-=(t-1)/l; cout << ans << endl; }