結果
| 問題 |
No.894 二種類のバス
|
| コンテスト | |
| ユーザー |
kafuka97
|
| 提出日時 | 2019-09-27 21:48:44 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 618 bytes |
| コンパイル時間 | 1,497 ms |
| コンパイル使用メモリ | 166,140 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-24 22:49:43 |
| 合計ジャッジ時間 | 2,155 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 6 WA * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef int64_t i64;
typedef uint64_t ui64;
const int inf=1073741823;
const i64 llinf=4611686018427387903LL;
i64 gcd(i64 a,i64 b){
i64 t,r;
if(a<b){
t=a;
a=b;
b=t;
}
r=a%b;
while(r!=0){
a=b;
b=r;
r=a%b;
}
return b;
}
int digit(i64 n){
int t=1;
while(n>=10){
n/=10;
t++;
}
return t;
}
int main(void){
i64 t,a,b;
scanf("%lli%lli%lli",&t,&a,&b);
i64 da=t/a;
i64 db=t/b;
i64 dg=t/(a/gcd(a,b)*b);
printf("%lli\n",da+db-dg);
return 0;
}
kafuka97