結果
問題 | No.2671 NUPC Decompressor |
ユーザー |
![]() |
提出日時 | 2024-03-15 21:28:33 |
言語 | C++23 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 3 ms / 2,000 ms |
コード長 | 954 bytes |
コンパイル時間 | 3,195 ms |
コンパイル使用メモリ | 261,968 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-09-30 00:24:05 |
合計ジャッジ時間 | 3,805 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 13 |
ソースコード
#include <bits/stdc++.h> using namespace std; using ll = long long; int K; vector<string> A; int main(void){ ios::sync_with_stdio(false); cin.tie(nullptr); cin >> K; for(int i = 0;i < 2;i++){ string s = "N"; if(i)s += s; for(int j = 0;j < 2;j++){ string t = s + 'U'; if(j)t += t; for(int k = 0;k < 2;k++){ string u = t + 'P'; if(k)u += u; for(int l = 0;l < 2;l++){ string w = u + 'C'; if(l)w += w; A.push_back(w); } } } } sort(A.begin(), A.end(), [](string a, string b){ for(int i = 0;i < b.size();i++){ if(i == a.size())return true; if(a[i] < b[i])return true; if(a[i] > b[i])return false; } return false; }); cout << A[K - 1] << endl; return 0; }