結果

問題 No.1571 All Your Cycles Are Same Lengths
ユーザー ぷらぷら
提出日時 2021-06-27 14:32:35
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 640 bytes
コンパイル時間 3,357 ms
コンパイル使用メモリ 192,460 KB
最終ジャッジ日時 2025-01-22 14:22:20
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 4 WA * 6
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int Q;
    cin >> Q;
    while (Q--) {
        int N,T;
        cin >> N >> T;
        if(T%2 == 1) {
            cout << "No" << endl;
        }
        else {
            cout << "Yes" << endl;
            for(int i = 1; i <= N; i++) {
                for(int j = i+1; j <= N; j++) {
                    if(i == 1) {
                        cout << i << " " << j << " " << T/2 << endl;
                    }
                    else {
                        cout << i << " " << j << " " << 0 << endl;
                    }
                }
            }
        }
    }
}
0