結果

問題 No.2671 NUPC Decompressor
ユーザー twooimp2twooimp2
提出日時 2024-03-15 21:38:18
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 831 bytes
コンパイル時間 7,051 ms
コンパイル使用メモリ 311,948 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-03-15 21:38:26
合計ジャッジ時間 7,927 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 2 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 #

#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;

void IO(){
  ios::sync_with_stdio(false);
  std::cin.tie(nullptr);
}

int main(){
  IO();
  ll k;
  cin>>k;
  vector<string> s={
    "N0U0P0C0","N0U0P0C1","N0U0P1C0","N0U0P1C1",
    "N0U1P0C0","N0U1P0C1","N0U1P1C0","N0U1P1C1",
    "N1U0P0C0","N1U0P0C1","N1U0P1C0","N1U0P1C1",
    "N1U1P0C0","N1U1P0C1","N1U1P1C0","N1U1P1C1",
  };
  vector<string> ans;
  for(ll i=0;i<16;i++){
    string str;
    for(ll j=0;j<8;j++){
      if(j%2==0){
        str+=s[i][j];
      }else{
        if(s[i][j]=='1'){
          str=str+str;
        }
      }
    }
    ans.push_back(str);
  }
  sort(ans.begin(),ans.end());
  cout<<ans[k-1]<<endl;
}
0