結果
問題 | No.415 ぴょん |
ユーザー |
![]() |
提出日時 | 2017-10-04 13:28:14 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
RE
(最新)
AC
(最初)
|
実行時間 | - |
コード長 | 582 bytes |
コンパイル時間 | 1,487 ms |
コンパイル使用メモリ | 79,064 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-18 14:54:43 |
合計ジャッジ時間 | 4,844 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 2 RE * 25 |
コンパイルメッセージ
main.cpp: In function ‘long long int gcd(long long int, long long int)’: main.cpp:22:8: warning: control reaches end of non-void function [-Wreturn-type] 22 | gcd( b, a%b ); | ~~~^~~~~~~~~~
ソースコード
#include <iostream> #include <vector> #include <string> #include <cstring> #include <math.h> #include <cmath> #include <limits.h> #include <map> #include <set> #include <queue> #include <algorithm> #include <functional> #include <stdio.h> using namespace std; long long MOD = 1000000007; long long gcd( long long a, long long b ) { if ( b == 0 ) { return a; } gcd( b, a%b ); } int main() { long long N,D; cin >> N >> D; if ( N == D ) { cout << 0 << endl; return 0; } cout << N / gcd(N,D) -1 << endl; return 0; }