結果
| 問題 |
No.2671 NUPC Decompressor
|
| コンテスト | |
| ユーザー |
tnakao0123
|
| 提出日時 | 2024-04-26 09:43:11 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 3 ms / 2,000 ms |
| コード長 | 612 bytes |
| コンパイル時間 | 1,482 ms |
| コンパイル使用メモリ | 62,616 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-11-09 00:06:06 |
| 合計ジャッジ時間 | 1,534 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 13 |
ソースコード
/* -*- coding: utf-8 -*-
*
* 2671.cc: No.2671 NUPC Decompressor - yukicoder
*/
#include<cstdio>
#include<string>
#include<algorithm>
using namespace std;
/* constant */
const int M = 4;
const int MBITS = 1 << M;
const char cs[] = "NUPC";
/* typedef */
/* global variables */
/* subroutines */
string ss[MBITS];
/* main */
int main() {
for (int bits = 0; bits < MBITS; bits++) {
for (int i = 0; i < M; i++) {
ss[bits] += cs[i];
if ((bits >> i) & 1) ss[bits] += ss[bits];
}
}
sort(ss, ss + MBITS);
int k;
scanf("%d", &k), k--;
puts(ss[k].c_str());
return 0;
}
tnakao0123