結果

問題 No.2671 NUPC Decompressor
ユーザー t9unkubjt9unkubj
提出日時 2024-03-15 21:25:08
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 827 bytes
コンパイル時間 2,133 ms
コンパイル使用メモリ 180,992 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-15 21:25:15
合計ジャッジ時間 2,957 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 AC 2 ms
6,676 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 2 ms
6,676 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

/**
 * author:	t9unkubj
 * created:	2024-03-15 
 */

#include<bits/stdc++.h>

#ifdef t9unkubj
#define _GLIBCXX_DEBUG
#define dbg(x) cout<<__LINE__<<" "<<#x<<":="<<x<<endl;
#else 
#define dbg(x) t9unkubj
#endif

using namespace std;

//#include<atcoder/all>
//using namespace atcoder;

int main(){
	ios::sync_with_stdio(false);
	std::cin.tie(nullptr);
	string s="NUPC";
	vector<string>se;
	for(int i=0;i<16;i++){
		string t;
		for(int j=0;j<8;j++){
			if(j&1){
				if(i>>(j-1)&1)t+=t;
			}
			else{
				t+=s[j/2];
			}
		}
		se.push_back(t);
	}
	sort(se.begin(),se.end(),[](string s,string t){
		for(int i=0;i<min<int>(s.size(),t.size());i++){
			if(s[i]!=t[i])return s[i]<t[i];
		}
		if((int)s.size()>(int)t.size())return false;
		return true;
	});
	int k;
	cin>>k;
	while(k--)se.erase(se.begin());
	cout<<*se.begin()<<endl;
}
0