結果

問題 No.1523 +/- Tree
ユーザー vkgainz
提出日時 2021-06-05 09:47:50
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 446 bytes
コンパイル時間 1,461 ms
コンパイル使用メモリ 167,360 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-11-21 05:49:29
合計ジャッジ時間 4,089 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 43 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

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

int main() {
    int N, K; cin >> N >> K;
    if((N - 1) % K == 0) cout << "No";
    else {
        cout << "Yes" << "\n";
        for(int i = 0; i < N - 1; i++) {
            cout << i + 1 << " " << i + 2 << " ";
            if(i%K == K - 1) {
                cout << -5001*(K - 1) - 1 << "\n";
            }
            else {
                cout << 5001 << "\n";
            }
        }
    }
}
0