結果
| 問題 | No.3477 Yet Another LIS Triangle |
| コンテスト | |
| ユーザー |
Tehom
|
| 提出日時 | 2026-03-23 23:50:32 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 1,113 bytes |
| 記録 | |
| コンパイル時間 | 8,697 ms |
| コンパイル使用メモリ | 274,248 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-03-23 23:50:45 |
| 合計ジャッジ時間 | 5,518 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 2 WA * 20 |
ソースコード
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
#define ll long long
#define rep(i,a,b) for(int i=(a);i<(b);i++)
#define repl(i,a,b) for(ll i=(a);i<(b);i++)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend()
template <typename T> bool chmin(T &a,T b){if(a>b){a=b;return true;} return false;}
template <typename T> bool chmax(T &a,T b){if(a<b){a=b;return true;} return false;}
void solve(){
int n,k; cin >> n >> k;
if(k == 1 || k == n){
cout << "No" << "\n";
return;
}
cout << "Yes" << "\n";
vector<int> a(n),b(n),c(n);
a[0]=c.back()=1,a.back()=b[0]=2,b.back()=c[0]=3;
rep(i,1,k) a[i]=3+k+i;
rep(i,k,n-1) a[i]=4+(n-2-i);
rep(i,1,k) b[i]=n+1+k+i;
rep(i,k,n-1) b[i]=n+1+(n-2-i);
rep(i,1,k) c[i]=2*n-1+k+i;
rep(i,k,n-1) c[i]=2*n-2+(n-2-i);
rep(i,0,n) cout << a[i] << " ";
cout << "\n";
rep(i,0,n) cout << b[i] << " ";
cout << "\n";
rep(i,0,n) cout << c[i] << " ";
cout << "\n";
return;
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int T; cin >> T;
while(T--) solve();
}
Tehom