結果

問題 No.3477 Yet Another LIS Triangle
コンテスト
ユーザー askr58
提出日時 2026-03-20 23:25:52
言語 C++23
(gcc 15.2.0 + boost 1.89.0)
コンパイル:
g++-15 -O2 -lm -std=c++23 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 55 ms / 2,000 ms
コード長 697 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,986 ms
コンパイル使用メモリ 340,624 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2026-03-20 23:25:57
合計ジャッジ時間 4,450 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 22
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using namespace std;
using ll=long long;
int main(){
	int ttt;
	cin>>ttt;
	while(ttt--){
		ll n,k;
		cin>>n>>k;
		if(n==k||k==1){
			cout<<"No"<<endl;
			continue;
		}
		cout<<"Yes"<<endl;
		vector<ll> a(n-1),b(n-1),c(n-2);
		iota(a.begin(),a.end(),2);
		iota(b.begin(),b.end(),n+1);
		iota(c.begin(),c.end(),2*n);
		k-=2;
		ranges::reverse(a.begin()+k,a.end());
		ranges::reverse(b.begin()+k,b.end());
		ranges::reverse(c.begin()+k,c.end());
		cout<<1;
		for(int i=0;i<n-1;i++)cout<<" "<<a[i];
		cout<<endl;
		cout<<a[n-2];
		for(int i=0;i<n-1;i++)cout<<" "<<b[i];
		cout<<endl;
		cout<<b[n-2];
		for(int i=0;i<n-2;i++)cout<<" "<<c[i];
		cout<<" "<<1<<endl;
	}
}

			
	

0