# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
496920 | 2021-12-22T06:38:26 Z | abc864197532 | Hidden Sequence (info1cup18_hidden) | C++17 | 6 ms | 292 KB |
#include <bits/stdc++.h> using namespace std; #define lli long long int #define mp make_pair #define eb emplace_back #define pb push_back #define X first #define Y second #define pii pair<int,int> #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() void abc() {cout << endl;} template <typename T, typename ...U> void abc(T i, U ...j) { cout << i << ' ', abc(j...); } template <typename T> void printv(T l, T r) { for (; l != r; ++l) cout << *l << " \n"[l + 1 == r]; } #ifdef Doludu #define test(x...) abc("[" + string(#x) + "]", x); #include "grader.cpp" #else #define test(x...) void(0); #endif const int N = 1001; bool isSubsequence (vector <int> S); vector <int> findSequence(int n) { int bound = n + 1 >> 1; int len = 0, d = 0; if (isSubsequence(vector <int>(bound, 0))) { d = 1; } for (int i = bound - 1; i > 0; --i) { if (isSubsequence(vector <int>(i, d))) { len = i; break; } } vector <int> ans; for (int i = 0; i < n; ++i) { if (len == 0) { ans.pb(d ^ 1); continue; } if (len == n - i) { ans.pb(d); len--; continue; } vector <int> res = ans; res.pb(d ^ 1); for (int j = 0; j < len; ++j) res.pb(d); if (isSubsequence(res)) ans.pb(d ^ 1); else ans.pb(d), len--; } return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 200 KB | Output is not correct: The returned sequence does not match the hidden one |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Partially correct | 6 ms | 200 KB | Output is partially correct: Maximum length of a query = 165 |
2 | Partially correct | 5 ms | 292 KB | Output is partially correct: Maximum length of a query = 178 |
3 | Incorrect | 6 ms | 280 KB | Output is not correct: The returned sequence does not match the hidden one |
4 | Halted | 0 ms | 0 KB | - |