# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
923287 | vjudge1 | Maxcomp (info1cup18_maxcomp) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "grader.h"
using namespace std;
vector<int>findSequence(int n){
map<set<string>,string>cnt;
for(int i=0;i<(1<<n);i++){
string s="";
for(int j=0;j<n;j++){
if((i>>j)&1){
s+='1';
}else{
s+='0';
}
}
set<string>e;
for(int r=(n/2+1);r<=(n/2+1);r++){
for(int k=0;k<(1<<(r));k++){
string t="";
for(int j=0;j<(r);j++){
if((k>>j)&1){
t+='1';
}else{
t+='0';
}
}
int p=0;
for(auto u:s){
if(p<t.size() and u==t[p]){
p++;
}
}
if(p==t.size()){
e.insert(t);
}
}
}
cnt[e]=s;
}
set<vector<int>>e;
for(int r=(n/2+1);r<=(n/2+1);r++){
for(int k=0;k<(1<<(r));k++){
vector<int>t;
for(int j=0;j<(r);j++){
if((k>>j)&1){
t.push_back(1);
}else{
t.push_back(0);
}
}
if(isSubsequence(t)){
e.insert(t);
}
}
}
vector<int>ans;
for(auto u:cnt[e]){
ans.push_back(u-'0');
}
return ans;
}