結果

問題 No.3666 League of Jigsaw
コンテスト
ユーザー GOTKAKO
提出日時 2026-08-30 16:34:56
言語 C++17
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 881 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,108 ms
コンパイル使用メモリ 210,752 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-30 16:34:59
合計ジャッジ時間 2,549 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);

    int T; cin >> T;
    while(T--){
        int L,J,O; cin >> L >> J >> O;
        if(L+J < O+O){cout << "No\n"; continue;}
        int yes = 0;
        if(L < J) swap(L,J);
        int over = (L-J)/6,del = min({J,O,over});
        L -= 7*del,O -= del,J -= del;
        over = (L-J)/2,del = min(O,over);
        L -= del*2,O -= del;

        L -= O,J -= O,O -= O;
        if(L < J) swap(L,J);
        if(L+J == 0) yes = 1;
        else if(L%2 || J%2) yes = 0;
        else if((L+J)%12 == 0){
            if(L <= J*5) yes = 1;
        }
        else{
            L /= 2,J /= 2;
            int del = min(J,(L+J)/6);
            L -= del*5,J -= del;
            if(L <= 2) yes = 1;
        }

        if(yes) cout << "Yes\n";
        else cout << "No\n";
    }
}
0