結果
問題 | No.1571 All Your Cycles Are Same Lengths |
ユーザー |
![]() |
提出日時 | 2021-06-27 14:46:53 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,130 bytes |
コンパイル時間 | 2,330 ms |
コンパイル使用メモリ | 195,072 KB |
最終ジャッジ日時 | 2025-01-22 14:24:36 |
ジャッジサーバーID (参考情報) |
judge2 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 1 WA * 9 |
ソースコード
#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 << "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 if(i == 2) {cout << i << " " << j << " " << 1 << endl;}else {cout << i << " " << j << " " << 0 << 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;}}}}}}