# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
98725 | 2019-02-25T12:10:55 Z | tmwilliamlin168 | Hidden Sequence (info1cup18_hidden) | C++14 | 12 ms | 384 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; bool qry(int a, int b, int c) { vector<int> v(a, c); while(b--) v.push_back(c^1); return isSubsequence(v); } vector<int> findSequence(int n) { int c=0; for(int i=1; i<=n; ++i) { vector<int> v(i>n/2?n-i+1:i, i>n/2); if(qry(i>n/2?n-i+1:i, 0, i>n/2)^i<=n/2) break; c=i; } vector<int> ans; for(int i=1, j=0; i<=c; ++i) { for(; j<n-c; ++j) { if(j+c+1-i<=n/2?!qry(j+1, c+1-i, 1):qry(i, n-c-j, 0)) break; ans.push_back(1); } ans.push_back(0); } while(ans.size()<n) ans.push_back(1); return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct: Maximum length of a query = 5 |
2 | Correct | 2 ms | 256 KB | Output is correct: Maximum length of a query = 6 |
3 | Correct | 2 ms | 256 KB | Output is correct: Maximum length of a query = 5 |
4 | Correct | 2 ms | 384 KB | Output is correct: Maximum length of a query = 5 |
5 | Correct | 2 ms | 284 KB | Output is correct: Maximum length of a query = 4 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct: Maximum length of a query = 83 |
2 | Correct | 8 ms | 256 KB | Output is correct: Maximum length of a query = 90 |
3 | Correct | 8 ms | 256 KB | Output is correct: Maximum length of a query = 96 |
4 | Correct | 6 ms | 384 KB | Output is correct: Maximum length of a query = 77 |
5 | Correct | 7 ms | 384 KB | Output is correct: Maximum length of a query = 95 |
6 | Correct | 7 ms | 256 KB | Output is correct: Maximum length of a query = 87 |
7 | Correct | 8 ms | 256 KB | Output is correct: Maximum length of a query = 97 |
8 | Correct | 7 ms | 384 KB | Output is correct: Maximum length of a query = 83 |
9 | Correct | 6 ms | 256 KB | Output is correct: Maximum length of a query = 101 |
10 | Correct | 12 ms | 384 KB | Output is correct: Maximum length of a query = 100 |
11 | Correct | 12 ms | 256 KB | Output is correct: Maximum length of a query = 96 |
12 | Correct | 7 ms | 384 KB | Output is correct: Maximum length of a query = 100 |
13 | Correct | 10 ms | 256 KB | Output is correct: Maximum length of a query = 101 |