# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
923362 | 2024-02-07T06:57:55 Z | vjudge1 | Hidden Sequence (info1cup18_hidden) | C++17 | 0 ms | 344 KB |
#include <bits/stdc++.h> #include "grader.h" #pragma GCC optimize("Ofast") #pragma GCC target("avx2") using namespace std; #define pb push_back vector<int> findSequence(int n){ vector<int> xxx; for(int i=1;i<=n;i++)xxx.pb(1); return xxx; int L=(n/2)+1; int c1=-1,c0=-1; for(int i=1;i<=L;i++){ vector<int> v; for(int j=1;j<=i;j++)v.pb(1); if(!isSubsequence(v)){ c1=i-1; c0=n-c1; break; } } if(c1==-1){ for(int i=1;i<=L;i++){ vector<int> v; for(int j=1;j<=i;j++)v.pb(0); if(!isSubsequence(v)){ c0=i-1; c1=n-c1; break; } } } vector<int> ans; if(c1<=0){ for(int i=1;i<=n;i++)ans.pb(0); return ans; } if(c0<=0){ for(int i=1;i<=n;i++)ans.pb(1); return ans; } int cnt0=0,cnt1=0; { vector<int> v; v.pb(1); for(int i=1;i<=c0;i++)v.pb(0); if(!isSubsequence(v)){ ans.pb(0); c0--; cnt0++; } else{ ans.pb(1); c1--; cnt1++; } } for(int i=2;i<=n;i++){ vector<int> v=ans; if(c1){ v.pb(1); for(int j=1;j<=c0;j++)v.pb(0); if(isSubsequence(v)){ ans.pb(1); cnt1++; c1--; } else{ ans.pb(0); cnt0++; c0--; } } else{ ans.pb(0); } } return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output is not correct: The returned sequence does not match the hidden one |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Output is not correct: The returned sequence does not match the hidden one |
2 | Halted | 0 ms | 0 KB | - |