Submission #435948

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4359482021-06-24 02:30:19cgiosyBiochips (IZhO12_biochips)C++17
Compilation error
0 ms0 KiB
// gs14004's code test
#include <bits/stdc++.h>
using namespace std;
int n,m,inp[200005];
int piv,sz[200005],a[200005];
vector<int> g[200005];
int root;
int dfs(int x){
int num = ++piv;
a[num] = inp[x];
sz[num] = 1;
for(int &i : g[x]){
sz[num] += dfs(i);
}
return sz[num];
}
int dp[2][200005];
void mx(int&a, int b) { a=max(a, b); }
int main() {
ios::sync_with_stdio(0);cin.tie(0);
int N, K, r;
cin>>N>>K;n=N,m=K;
int W[N+1];
for(int i=1; i<=N; i++) {
int p;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

biochips.cpp: In lambda function:
biochips.cpp:45:13: error: 'G' was not declared in this scope
   45 |   for(int e=G[i]; e; e=F[e]) {
      |             ^
biochips.cpp:45:24: error: 'F' was not declared in this scope
   45 |   for(int e=G[i]; e; e=F[e]) {
      |                        ^
biochips.cpp:50:20: error: 'D' was not declared in this scope
   50 |    while(n[d]<p+j) D[d][n[d]++]=0;
      |                    ^
biochips.cpp:52:8: error: 'D' was not declared in this scope
   52 |     mx(D[d][p+j], D[d][p+j-k-1]+D[d^1][q+k]);
      |        ^
biochips.cpp:53:30: error: 'D' was not declared in this scope
   53 |    for(int k=0; k<m; k++) mx(D[d][p+k], D[d^1][q+k]);
      |                              ^
biochips.cpp:55:15: error: 'D' was not declared in this scope
   55 |   if(p==n[d]) D[d][n[d]++]=W[i];
      |               ^
biochips.cpp:56:11: error: 'D' was not declared in this scope
   56 |   else mx(D[d][p], W[i]);
      |           ^
biochips.cpp: In function 'int main()':
biochips.cpp:59:30: error: 'D' was not declared in this scope
   59 |  cout<<(N<=10 ? dp[m%2][1] : D[0][cg(r)-1])<<'\n';
      |                              ^