結果
問題 | No.415 ぴょん |
ユーザー |
![]() |
提出日時 | 2016-12-13 23:09:08 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 807 bytes |
コンパイル時間 | 744 ms |
コンパイル使用メモリ | 85,464 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-18 14:52:03 |
合計ジャッジ時間 | 1,429 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 27 |
ソースコード
#define _CRT_SECURE_NO_WARNINGS #include <stdio.h> #include <algorithm> #include <utility> #include <functional> #include <cstring> #include <queue> #include <stack> #include <math.h> #include <iterator> #include <vector> #include <string> #include <set> #include <math.h> #include <iostream> #include<map> #include <iomanip> #include <stdlib.h> #include <list> #include <typeinfo> #include <list> #include <set> using namespace std; #define MAX_MOD 1000000007 #define REP(i,n) for(long long i = 0;i < n;++i) #define LONG_INF 100000000000000 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*b / gcd(a, b); } int main() { long long n, d; cin >> n >> d; long long hoge = lcm(n, d) / d - 1; cout << hoge << endl; }