結果

問題 No.2239 Friday
ユーザー navel_tosnavel_tos
提出日時 2023-03-10 21:31:58
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 1,020 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 11,792 KB
実行使用メモリ 10,056 KB
最終ジャッジ日時 2023-10-18 07:12:44
合計ジャッジ時間 1,515 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,056 KB
testcase_01 AC 30 ms
10,056 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 29 ms
10,056 KB
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 30 ms
10,056 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 29 ms
10,056 KB
testcase_13 AC 29 ms
10,056 KB
testcase_14 WA -
testcase_15 AC 29 ms
10,056 KB
testcase_16 AC 29 ms
10,056 KB
testcase_17 WA -
testcase_18 AC 29 ms
10,056 KB
testcase_19 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#yukicoder380A

'''
Friday. また日本語能力が怪しい問題が・・・。
競技プログラミング界隈あるあるなのか?

日本語難しすぎないか??
アジフライがA個、アジ皿がB枚。
エビフライがB個、エビ皿がA枚。
自然な皿の枚数と不自然な皿の枚数の差を最小化せよ。

A>B として話を進める。のも面倒なのでごり押しで解こう。
アジフライが沢山あるが、アジ皿が不十分な状況である。
順に盛り付けて、B枚までは自然な皿が増えてゆき、以降は不自然な皿ばかりできてゆく。
言い換えれば 最大でも自然な皿は2*B枚までしか作れない。

2*Bで過半数の皿が作れない場合、しかたがないので限界まで自然な皿を作るしかない。
'''
A,B=list(map(int,input().split()))
if A<B:
    A,B=B,A

if A+B<=2*(2*B):
    if (A+B)%2==1:
        print(1)
    else:
        print(0)
else:
    print(A+B-2*B)
0