Submission #895061

#TimeUsernameProblemLanguageResultExecution timeMemory
895061LitusianoRabbit Carrot (LMIO19_triusis)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> using namespace std; #define int long long signed main(){ int n,h; cin>>n>>h; n++ int ans = 0; vector<int> v(n+1,0); //for(int& i : v) cin>>i for(int i = 1; i<=n; i++){ cin>>v[i]; if(v[i] > i*h){ ans++; v[i] = v[i-1] + h; } } cout<<ans<<endl; }

Compilation message (stderr)

triusis.cpp: In function 'int main()':
triusis.cpp:7:25: error: expected ';' before 'long'
    7 |  int n,h; cin>>n>>h; n++
      |                         ^
      |                         ;
triusis.cpp:13:4: error: 'ans' was not declared in this scope; did you mean 'abs'?
   13 |    ans++;
      |    ^~~
      |    abs
triusis.cpp:17:8: error: 'ans' was not declared in this scope; did you mean 'abs'?
   17 |  cout<<ans<<endl;
      |        ^~~
      |        abs