結果
問題 | No.415 ぴょん |
ユーザー |
![]() |
提出日時 | 2018-01-15 22:09:29 |
言語 | C++11 (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 504 bytes |
コンパイル時間 | 704 ms |
コンパイル使用メモリ | 81,288 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 14:55:13 |
合計ジャッジ時間 | 1,533 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#include <iostream>#include <iomanip>#include <vector>#include <algorithm>#include <string>#include <sstream>#include <cmath>#include <stack>#include <cctype>#include <stdio.h>#include <map>#include <string.h>typedef long long ll;using namespace std;long long gcd(long long a, long long b){if(b==0){return a;}return gcd(b, a%b);}long long lcm(long long a, long long b){return a/gcd(a,b)*b;}int main() {ll n,d ;cin>>n>>d;cout<<lcm(n,d)/d-1<<endl;return 0;}