結果
問題 |
No.894 二種類のバス
|
ユーザー |
![]() |
提出日時 | 2019-09-27 23:36:48 |
言語 | C++17(clang) (17.0.6 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 366 bytes |
コンパイル時間 | 1,905 ms |
コンパイル使用メモリ | 164,152 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-30 15:00:00 |
合計ジャッジ時間 | 2,496 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 |
ソースコード
#include <bits/stdc++.h> #define int unsigned long long #include <numeric> using namespace std; signed main() { int T, A, B; cin >> T >> A >> B; int ans = 0; ans = (T-1LL)/A + (T-1LL)/B + 1LL; // Tぴったりを数えないので-1、0秒の時の分を+1 int kobai = lcm(A, B); kobai = (T-1LL)/ kobai; ans -= kobai; cout << ans << endl; }