結果
問題 |
No.1571 All Your Cycles Are Same Lengths
|
ユーザー |
|
提出日時 | 2021-06-29 21:06:55 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 411 bytes |
コンパイル時間 | 500 ms |
コンパイル使用メモリ | 64,000 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-25 23:34:29 |
合計ジャッジ時間 | 2,003 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 4 WA * 6 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type] 4 | main() | ^~~~
ソースコード
#include<iostream> using namespace std; int Q,N,T; main() { cin>>Q; for(;Q--;) { cin>>N>>T; if(T%2==0) { cout<<"Yes"<<endl; for(int i=1;i<N;i++)for(int j=i+1;j<=N;j++) { cout<<i<<" "<<j<<" "<<(i==1?T/2:0)<<endl; } } else if(N==T) { cout<<"Yes"<<endl; for(int i=1;i<N;i++)for(int j=i+1;j<=N;j++) { cout<<i<<" "<<j<<" "<<1<<endl; } } else cout<<"No"<<endl; } }