結果

問題 No.3659 CONSTRUCTION 1,2,3
コンテスト
ユーザー Rapca1256
提出日時 2026-08-30 15:57:55
言語 Python3
(3.14.7 + numpy 2.5.2 + scipy 1.18.0)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 1,221 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 292 ms
コンパイル使用メモリ 21,540 KB
実行使用メモリ 15,996 KB
最終ジャッジ日時 2026-08-30 15:58:11
合計ジャッジ時間 3,169 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 7 WA * 8
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import sys
import math
#from collections import deque, defaultdict, Counter
#import heapq
#import bisect
#import itertools
#import functools

# 外部ライブラリ(AtCoder環境で利用可能)
#from sortedcontainers import SortedList, SortedSet, SortedDict
#from atcoder.dsu import DSU
#from atcoder.segtree import SegTree
#from atcoder.lazysegtree import LazySegTree
#from atcoder.fenwicktree import FenwickTree

# 入力高速化
#input = sys.stdin.readline
# 再帰回数上限

# よくあるmod
#MOD = 1000000007
MOD = 998244353

from collections import Counter

def solve():
    # 解答ここから
    A, B, C = map(int, input().split(' '))
    if (A + B + C) % 6 != 0:
        print("No")
        return
    A, B, C = max(A, B, C), A + B + C -max(A, B, C) - min(A, B, C) , min(A, B, C)

    d1 = A - B
    d2 = B - C
    if d1 == 1 and d2 == 1:
        print("Yes")
        return

    if d1 < d2:
        if C >= d2 and (B + C) >= 3 * (d2 - 1):
            print("Yes")
        else:
            print("No")
    else:
        if C >= d1 and (A + B) >= 3 * (d1 - 1):
            print("Yes")
        else:
            print("No")
if __name__ == '__main__':
    T = 1
    for _ in range(T):
        solve()
0