結果

問題 No.141 魔法少女コバ
コンテスト
ユーザー pluto77
提出日時 2016-04-16 13:31:46
言語 PyPy2
(7.3.15)
結果
AC  
実行時間 86 ms / 5,000 ms
コード長 241 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 125 ms
コンパイル使用メモリ 77,504 KB
最終ジャッジ日時 2025-12-03 20:25:59
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 93
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

# -*- coding: utf-8 -*-
#yuki_141

m,n=map(int,raw_input().split())

count=0
while m!=n:
 if m==1:
  count+=n
  break
 if n==1:
  count+=m-1
  break
 if m>n:
  temp=(m-1)/n
  count+=temp
  m-=temp*n
 else:
  count+=1
  m,n=n,m  
print count
0