関数 f(x,y)f(x, y)f(x,y) が次のように定義されているとき,f(775,527)f(775, 527)f(775,527) の値は幾らか。ここで,x mod yx \bmod yxmody は xxx を yyy で割った余りを返す。
f(x,y): if y=0 then return x else return f(y,x mod y)f(x, y): \text{ if } y = 0 \text{ then return } x \text{ else return } f(y, x \bmod y)f(x,y): if y=0 then return x else return f(y,xmody)
0
31
248
527
この関数はユークリッドの互除法により xxx と yyy の最大公約数を求める。
したがって値は 31 であり「イ」が正解である。