結果
| 問題 |
No.894 二種類のバス
|
| コンテスト | |
| ユーザー |
ui_mtc
|
| 提出日時 | 2019-09-27 22:30:06 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 357 bytes |
| コンパイル時間 | 1,835 ms |
| コンパイル使用メモリ | 191,816 KB |
| 最終ジャッジ日時 | 2025-01-07 19:28:45 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 1 |
ソースコード
#include <bits/stdc++.h>
#define int 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;
}
ui_mtc