結果

問題 No.442 和と積
コンテスト
ユーザー mban
提出日時 2017-03-05 04:58:08
言語 PyPy2
(7.3.20)
コンパイル:
pypy2 -m py_compile _filename_
実行:
/usr/bin/pypy2 Main.pyc
結果
AC  
実行時間 50 ms / 1,000 ms
+ 467µs
コード長 311 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 56 ms
コンパイル使用メモリ 80,740 KB
実行使用メモリ 81,256 KB
最終ジャッジ日時 2026-07-18 12:21:44
合計ジャッジ時間 2,745 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import math

L = raw_input().split()
A = int(L[0])
B = int(L[1])
S = A + B
P = A * B

def greatest_common_dicisor(x,y):
    if x < y:
        temp = x
        x = y
        y = temp
    
    r = x % y
    while r > 0:
        x = y
        y = r
        r = x % y
    return y
print greatest_common_dicisor(S,P)
0