結果
問題 |
No.141 魔法少女コバ
|
ユーザー |
|
提出日時 | 2016-09-13 15:55:19 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 816 ms |
コンパイル使用メモリ | 67,580 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-17 04:53:42 |
合計ジャッジ時間 | 5,255 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 92 WA * 1 |
ソースコード
#include <iostream> #include <math.h> int func(int a,int b){ while(1){ int r=a%b; if(r==0)return b; a=b; b=r; } } int main(){ int a,b; std::cin>>a>>b; int m=func(a,b); a/=m; b/=m; int count=0; while(1){ if(a>b){ a-=b; }else{ int tmp=a; a=b; b=tmp; } count++; if(a==b){ break; } } std::cout<<count<<std::endl; return 0; }