結果

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

テストケース

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

ソースコード

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)/2)&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;
	k--;
	cout<<se[k]<<endl;
}
0