結果

問題 No.1794 Continued Fraction
ユーザー Kanten4205
提出日時 2021-04-04 15:19:46
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 190 bytes
コンパイル時間 811 ms
コンパイル使用メモリ 62,592 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-16 19:16:02
合計ジャッジ時間 1,957 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 | main(){std::cin>>N>>M;int a = GCD(N,M);std::cout<<'\n';}
      | ^~~~

ソースコード

diff #

#include <iostream>
int N, M;
int GCD(int A,int B){if (!B) return 0;if ((A-N)|(B-M))std::cout<<' ';std::cout<<A/B;return GCD(B,A%B);}
main(){std::cin>>N>>M;int a = GCD(N,M);std::cout<<'\n';}
0