結果
問題 | No.1571 All Your Cycles Are Same Lengths |
ユーザー | the-xin |
提出日時 | 2021-06-27 15:11:25 |
言語 | C++14 (gcc 12.3.0 + boost 1.83.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 577 bytes |
コンパイル時間 | 523 ms |
コンパイル使用メモリ | 67,464 KB |
実行使用メモリ | 4,380 KB |
最終ジャッジ日時 | 2023-09-07 17:57:50 |
合計ジャッジ時間 | 1,907 ms |
ジャッジサーバーID (参考情報) |
judge12 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 2 ms
4,376 KB |
testcase_01 | AC | 2 ms
4,380 KB |
testcase_02 | AC | 2 ms
4,380 KB |
testcase_03 | AC | 2 ms
4,380 KB |
testcase_04 | WA | - |
testcase_05 | AC | 2 ms
4,376 KB |
testcase_06 | WA | - |
testcase_07 | AC | 2 ms
4,376 KB |
testcase_08 | WA | - |
testcase_09 | WA | - |
testcase_10 | WA | - |
ソースコード
#include<iostream> #include<algorithm> #include<cstring> using namespace std; typedef long long LL; const int N = 300; int g[N][N]; int main(){ int T; cin>>T; while(T--){ int n,t; cin>>n>>t; if((n-2)%2==0&&t%2){ puts("No"); continue; }else{ puts("Yes"); int w=0; if(n-2!=0) w=t/(n-2); for(int i=2;i<=n;i++){ for(int j=i+1;j<=n;j++) g[i][j]=w; } w=t-w*(n-2); w/=2; for(int i=1;i<=n;i++) g[1][i]=w; for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ printf("%d %d %d\n",i,j,g[i][j]); } } } } return 0; }