結果
問題 |
No.894 二種類のバス
|
ユーザー |
![]() |
提出日時 | 2019-09-27 21:32:00 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 417 bytes |
コンパイル時間 | 1,536 ms |
コンパイル使用メモリ | 167,900 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-24 20:51:01 |
合計ジャッジ時間 | 2,072 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 WA * 2 |
ソースコード
#include<bits/stdc++.h> using namespace std; typedef long long ll; long long gcd(long long a, long long b){ if(b==0) return a; return gcd(b,a%b); } signed main(){ ios::sync_with_stdio(false); cin.tie(0); cout << fixed << setprecision(20); ll t,a,b; cin>>t>>a>>b; t--; ll g = gcd(a,b); ll l = a*b/g; ll ans = t/a + t/b -t/l; ans++; cout << ans << endl; }