Official

A - 布団の組 / Futon Pairs Editorial by sounansya Editorial for printing


AtCoder をはじめたばかりで何をしたらよいか分からない方は、まずは practice contest の問題 A「Welcome to AtCoder」を解いてみてください。基本的な入出力の方法が載っています。
また、プログラミングコンテストの問題に慣れていない方は、AtCoder Beginners Selection の問題をいくつか解いてみることをおすすめします。


\(A_i+B_i\) が奇数なら \(1\) 人余るので、答えは x です。逆に、偶数なら余らないので答えは o です。

実装例(Python3)

n = int(input())
ans = ""
for i in range(n):
    a, b = map(int, input().split())
    if (a + b) % 2 == 1:
        ans += "x"
    else:
        ans += "o"
print(ans)

posted:
last update: