# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1034045 | 2024-07-25T09:01:20 Z | denislav | Hidden Sequence (info1cup18_hidden) | C++17 | 5 ms | 704 KB |
# include <iostream> # include <vector> # include <algorithm> # include "grader.h" //# include "grader.cpp" using namespace std; int n; void print(vector<int> v) { for(int x: v) cout<<x; cout<<"\n"; } vector < int > findSequence (int N) { n=N; int cnt=0; vector<int> ans; for(int i=1;i<=n;i++) { ans.push_back(0); if(!isSubsequence(ans)) { ans.pop_back(); break; } cnt++; } //cout<<"Here"<<" "<<cnt<<endl; for(int i=0;i<=cnt;i++) { while(true) { int br=0, id=-1; if(i==0) { id=-1; } else { while(true) { id++; if(ans[id]==0) br++; if(br==i) break; } } //cout<<i<<" "<<id<<endl; ans.insert(ans.begin()+id+1,1); //cout<<"Here"<<endl; if((int)ans.size()==n+1 or !isSubsequence(ans)) { ans.erase(ans.begin()+id+1); //print(ans); break; } } } return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 8 |
2 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 10 |
3 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 8 |
4 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 9 |
5 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 7 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 4 ms | 344 KB | Output is partially correct: Maximum length of a query = 165 |
2 | Partially correct | 5 ms | 344 KB | Output is partially correct: Maximum length of a query = 178 |
3 | Partially correct | 5 ms | 704 KB | Output is partially correct: Maximum length of a query = 190 |
4 | Partially correct | 3 ms | 436 KB | Output is partially correct: Maximum length of a query = 153 |
5 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 188 |
6 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 172 |
7 | Partially correct | 3 ms | 600 KB | Output is partially correct: Maximum length of a query = 192 |
8 | Partially correct | 3 ms | 444 KB | Output is partially correct: Maximum length of a query = 164 |
9 | Partially correct | 3 ms | 596 KB | Output is partially correct: Maximum length of a query = 200 |
10 | Partially correct | 4 ms | 344 KB | Output is partially correct: Maximum length of a query = 199 |
11 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 190 |
12 | Partially correct | 3 ms | 700 KB | Output is partially correct: Maximum length of a query = 199 |
13 | Partially correct | 3 ms | 456 KB | Output is partially correct: Maximum length of a query = 200 |