# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
67147 | MrTEK | Hidden Sequence (info1cup18_hidden) | C++14 | 11 ms | 580 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "grader.h"
using namespace std;
#define mp make_pair
#define pb push_back
#define len(a) (int)a.size()
#define fi first
#define sc second
#define d1(w) cerr<<#w<<":"<<w<<endl;
#define d2(w,c) cerr<<#w<<":"<<w<<" "<<#c<<":"<<c<<endl;
#define d3(w,c,z) cerr<<#w<<":"<<w<<" "<<#c<<":"<<c<<" "<<#z<<":"<<z<<endl;
#define left ind+ind
#define right ind+ind+1
#define mid (l+r)/2
#define FAST_IO ios_base::sync_with_stdio(false);
#define endl '\n'
const int maxn = 620;
const long long LINF = 1e18;
const int LOG = 31;
const int INF = 1e9;
const int N = 1e3 + 5;
const int M = 4;
const int SQ = 350;
const int MOD = 998244353;
vector < int > findSequence (int N)
{
vector < int > ans (N, 0),sif,v;
for (int i = 0 ; i < N ; i++) {
sif.pb(0);
if (isSubsequence(sif) == false) {sif.pop_back();break;}
}
if (len(sif) == N) {
for (int i = 0 ; i < N ; i++) ans[i] = sif[i];
return ans;
}
else if(len(sif) == 0) {
for (int i = 0 ; i < N ; i++) ans[i] = 1;
return ans;
}
for (int i = 0 ; i < N ; i++) {
v.clear();
for (int j = 0; j < i ; j++) v.pb(ans[j]);
v.pb(1);
for (int j = 0 ; j < len(sif) ; j++) v.pb(sif[j]);
if (len(v) > N) {
for (int j = i ; j < N ; j++) ans[i] = 0;
break;
}
// printf("%d ------>",i + 1);
// for (auto j : v) printf("%d ",j);
// puts("");
if (isSubsequence(v)) {
ans[i] = 1;
continue;
}
else {
ans[i] = 0;
sif.pop_back();
}
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |