結果
| 問題 |
No.2671 NUPC Decompressor
|
| コンテスト | |
| ユーザー |
nono00
|
| 提出日時 | 2024-03-15 21:25:33 |
| 言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 771 bytes |
| コンパイル時間 | 3,464 ms |
| コンパイル使用メモリ | 264,216 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-09-30 00:21:21 |
| 合計ジャッジ時間 | 4,126 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
#include <bits/stdc++.h>
namespace nono {
void solve() {
const std::string S = "NUPC";
std::vector<std::string> vec;
auto dfs = [&](auto self, int i, std::string s) -> void {
if (i == 8) {
vec.push_back(s);
return;
}
if (i % 2 == 0) {
s.push_back(S[i / 2]);
self(self, i + 1, s);
} else {
self(self, i + 1, s);
self(self, i + 1, s + s);
}
};
dfs(dfs, 0, "");
std::ranges::sort(vec);
int k;
std::cin >> k;
std::cout << vec[k - 1] << '\n';
}
} // namespace nono
int main() {
std::cin.tie(0)->sync_with_stdio(0);
std::cout << std::fixed << std::setprecision(16);
int t = 1;
while (t--) nono::solve();
}
nono00