# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
997607 | 2024-06-12T14:42:17 Z | 12345678 | Hidden Sequence (info1cup18_hidden) | C++17 | 6 ms | 856 KB |
#include<bits/stdc++.h> #include "grader.h" using namespace std; const int nx=205; int used[nx], sz[nx], mn=-1, a, b; vector<int> findSequence (int N) { vector<int> tmp, res; for (int i=1; i<=(N+1)/2; i++) { tmp.push_back(0); if (!isSubsequence(tmp)) { mn=0; a=i-1; break; } } tmp.clear(); for (int i=1; i<=(N+1)/2; i++) { tmp.push_back(1); if (!isSubsequence(tmp)) { mn=1; a=i-1; break; } } if (mn==-1) mn=0, a=N/2; for (int t=1; t<=200; t++) { int cnt=0; for (int i=0; i<=a; i++) if (!used[i]) cnt++; if (cnt==1) { int sm=0; vector<int> res; for (int i=0; i<=a; i++) sm+=sz[i]; for (int i=0; i<=a; i++) if (!used[i]) sz[i]=N-a-sm; cnt=0; } if (cnt==0) { vector<int> res; for (int i=0; i<=a; i++) { for (int j=0; j<sz[i]; j++) res.push_back(!mn); if (i!=a) res.push_back(mn); } return res; } for (int i=0; i<=a; i++) { if (!used[i]) { vector<int> qrs; for (int j=0; j<i; j++) qrs.push_back(mn); for (int j=0; j<t; j++) qrs.push_back(!mn); for (int j=i; j<a; j++) qrs.push_back(mn); if (!isSubsequence(qrs)) used[i]=1, sz[i]=t-1; } } } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 344 KB | Output is partially correct: Maximum length of a query = 6 |
2 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 8 |
3 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 6 |
4 | Correct | 0 ms | 344 KB | Output is correct: Maximum length of a query = 5 |
5 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 6 |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 85 |
2 | Correct | 3 ms | 444 KB | Output is correct: Maximum length of a query = 90 |
3 | Partially correct | 5 ms | 440 KB | Output is partially correct: Maximum length of a query = 101 |
4 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 81 |
5 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 103 |
6 | Partially correct | 5 ms | 344 KB | Output is partially correct: Maximum length of a query = 130 |
7 | Partially correct | 4 ms | 600 KB | Output is partially correct: Maximum length of a query = 144 |
8 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 86 |
9 | Partially correct | 4 ms | 344 KB | Output is partially correct: Maximum length of a query = 126 |
10 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 125 |
11 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 97 |
12 | Partially correct | 6 ms | 856 KB | Output is partially correct: Maximum length of a query = 150 |
13 | Partially correct | 3 ms | 344 KB | Output is partially correct: Maximum length of a query = 107 |