# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
973500 | 2024-05-02T05:52:55 Z | shoryu386 | Hidden Sequence (info1cup18_hidden) | C++17 | 4 ms | 700 KB |
#include <bits/stdc++.h> #include "grader.h" using namespace std; vector < int > findSequence (int N){ int A = 1, B = 0; vector<int> test; int numA = 0; for (int x = 1; x <= N/2+1; x++){ test.push_back(A); if (isSubsequence(test)){ numA++; } else break; } if (numA >= N/2+1){ swap(A, B); numA = 0; test.clear(); for (int x = 1; x <= N/2+1; x++){ test.push_back(A); if (isSubsequence(test)){ numA++; } else break; } } int filler[numA+1]; memset(filler, 0, sizeof(filler)); test.clear(); int cap = N/4 + 2; int marker = -1; for (int x = 0; x <= numA; x++){ while (true){ filler[x]++; test.clear(); if (filler[x] > cap){ filler[x] = 0; marker = x; //cerr << "Marked " << x << "!\n"; break; } for (int y = 0; y < x; y++){ test.push_back(A); } for (int y = 0; y < filler[x]; y++){ test.push_back(B); } for (int y = 0; y < numA - x; y++){ test.push_back(A); } if (test.size() <= N && isSubsequence(test)){ continue; } else {filler[x]--; break;} } } int numB = N-numA; if (marker != -1){ int cursum = 0; for (int x = 0; x <= numA; x++){ cursum += filler[x]; } filler[marker] = numB - cursum; } test.clear(); for (int y = 0; y < numA; y++){ for (int z = 0; z < filler[y]; z++){ test.push_back(B); } test.push_back(A); } for (int z = 0; z < filler[numA]; z++){ test.push_back(B); } return test; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 1 ms | 344 KB | Output is partially correct: Maximum length of a query = 7 |
2 | Partially correct | 1 ms | 500 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 = 7 |
4 | Partially correct | 1 ms | 344 KB | Output is partially correct: Maximum length of a query = 8 |
5 | Partially correct | 0 ms | 344 KB | Output is partially correct: Maximum length of a query = 6 |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 3 ms | 436 KB | Output is partially correct: Maximum length of a query = 86 |
2 | Partially correct | 3 ms | 692 KB | Output is partially correct: Maximum length of a query = 92 |
3 | Partially correct | 3 ms | 444 KB | Output is partially correct: Maximum length of a query = 102 |
4 | Partially correct | 3 ms | 440 KB | Output is partially correct: Maximum length of a query = 87 |
5 | Partially correct | 3 ms | 440 KB | Output is partially correct: Maximum length of a query = 102 |
6 | Partially correct | 3 ms | 500 KB | Output is partially correct: Maximum length of a query = 131 |
7 | Partially correct | 4 ms | 700 KB | Output is partially correct: Maximum length of a query = 145 |
8 | Partially correct | 3 ms | 684 KB | Output is partially correct: Maximum length of a query = 97 |
9 | Partially correct | 3 ms | 432 KB | Output is partially correct: Maximum length of a query = 114 |
10 | Partially correct | 4 ms | 696 KB | Output is partially correct: Maximum length of a query = 125 |
11 | Partially correct | 3 ms | 432 KB | Output is partially correct: Maximum length of a query = 97 |
12 | Partially correct | 4 ms | 428 KB | Output is partially correct: Maximum length of a query = 150 |
13 | Partially correct | 3 ms | 692 KB | Output is partially correct: Maximum length of a query = 106 |