Submission #1076885

#TimeUsernameProblemLanguageResultExecution timeMemory
1076885TrumlingRadio Towers (IOI22_towers)C++17
Compilation error
0 ms0 KiB
#include "towers.h" #include <vector> #include<bits/stdc++.h> using namespace std; #define F first #define S second #define all(x) x.begin(),x.end() typedef long long ll; #define pb push_back #define INF 9999999999999999 ll n; vector<ll>h; void init(int N, vector<int> H) { n=N; for(int i=0;i<N;i++) h.pb(H[i]); } int max_towers(int L, int R, int D) { vector<ll>v(n); for(int i=L;i<=R;i++) v[i]=1; for(int i=L;i<=R;i++) { ll maxi=h[i]; for(int j=i-1;j>=L;j--) { maxi=max(maxi,h[j]); if(maxi-D>=h[j] && maxi-D>=h[i]) if(v[i]<v[j]+1) v[i]=v[j] + 1 } } ll maxi=0; for(int i=0;i<n;i++) maxi=max(maxi,v[i]); return maxi; }

Compilation message (stderr)

towers.cpp: In function 'int max_towers(int, int, int)':
towers.cpp:38:26: error: expected ';' before '}' token
   38 |             v[i]=v[j] + 1
      |                          ^
      |                          ;
......
   41 |       }
      |       ~