# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1141565 | Agageldi | Hidden Sequence (info1cup18_hidden) | C++17 | 0 ms | 412 KiB |
#include<bits/stdc++.h>
// #include "grader.cpp"
#include "grader.h"
#define pb push_back
#define sz(s) (int)s.size()
using namespace std;
vector <int> v;
int n, m, a[500];
vector < int > findSequence (int N)
{
deque <int> d;
vector <deque <int>> v;
d.pb(1);
int sonky = 1, pod = 0;
while(sz(d) < N) {
bool tr = 0, p = 0;
for(auto i:v) {
int cnt = 0;
for(int j = 0; j < sz(d); j++) {
if(cnt == sz(i)) break;
if(i[cnt] == d[j]) {
cnt++;
}
}
if(cnt == sz(i)) p = 1;
}
if(p) {
if(pod == 2) break;
sonky = 1 - sonky;
pod++;
v.pb(d);
d.pop_back();
d.pb(sonky);
continue;
}
else d.pb(sonky);
pod = 0;
}
while(sz(d) < N) {
bool tr = 0, p = 0;
for(int i = 0;i <sz(v); i++) {
int cnt = 0;
for(int j = 0; j < sz(d); j++) {
if(cnt == sz(v[i])) break;
if(v[i][cnt] == d[j]) {
cnt++;
}
}
if(cnt == sz(v[i])) p = 1;
}
if(p) {
if(pod == 2) break;
pod++;
v.pb(d);
sonky = 1 - sonky;
d.pop_front();
d.push_front(sonky);
continue;
}
else d.push_front(sonky);
pod = 0;
}
vector <int> answer;
for(auto i:d) {
answer.pb(i);
}
return answer;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |