結果
問題 |
No.2671 NUPC Decompressor
|
ユーザー |
![]() |
提出日時 | 2023-12-01 01:04:19 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 547 bytes |
コンパイル時間 | 2,405 ms |
コンパイル使用メモリ | 205,252 KB |
最終ジャッジ日時 | 2025-02-18 02:46:53 |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; int main() { int K; cin >> K; const int size = 4; vector<string> decompressed; string nupc = "NUPC"; for (int bit = 0; bit < (1 << size); bit++) { string tmp = ""; for (int i = 0; i < size; i++) { tmp.push_back(nupc[i]); if (bit & (1 << i)) { tmp += tmp; } } decompressed.push_back(tmp); } sort(decompressed.begin(), decompressed.end()); cout << decompressed[K - 1] << endl; }