結果

問題 No.894 二種類のバス
コンテスト
ユーザー Y17
提出日時 2019-09-27 21:32:11
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 247 bytes
コンパイル時間 1,152 ms
コンパイル使用メモリ 157,868 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-24 20:51:09
合計ジャッジ時間 1,811 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 16 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

#define int long long

signed main(){
    int t, a, b;
    cin >> t >> a >> b;

    t--;
    int l = a / __gcd(a, b) * b;
    int ans = t/a + t/b - t/l + 1;

    cout << ans << endl;

    return 0;
}
0