提出 #70886813


ソースコード 拡げる

def f(a, b, c):
  if (b - c) % 3 != 0:
    return 10 ** 10
  return max(b, c)

t = int(input())
for _ in range(t):
  r, g, b = map(int, input().split())
  ans = 10 ** 10
  target = [f(r, g, b), f(g, b, r), f(b, r, g)]
  for tar in target:
    ans = min(ans, tar)
  if ans == 10 ** 10:
    ans = -1
  print(ans)

提出情報

提出日時
問題 B - Balls of Three Colors
ユーザ shunta
言語 Python (PyPy 3.10-v7.3.12)
得点 400
コード長 324 Byte
結果 AC
実行時間 58 ms
メモリ 76724 KiB

ジャッジ結果

セット名 Sample All
得点 / 配点 0 / 0 400 / 400
結果
AC × 1
AC × 6
セット名 テストケース
Sample 00-sample-001.txt
All 00-sample-001.txt, 01-001.txt, 01-002.txt, 01-003.txt, 01-004.txt, 01-005.txt
ケース名 結果 実行時間 メモリ
00-sample-001.txt AC 55 ms 76396 KiB
01-001.txt AC 57 ms 76216 KiB
01-002.txt AC 57 ms 76724 KiB
01-003.txt AC 58 ms 76544 KiB
01-004.txt AC 57 ms 76280 KiB
01-005.txt AC 57 ms 76572 KiB