Submission #797088

#TimeUsernameProblemLanguageResultExecution timeMemory
797088yusuf12360Rabbit Carrot (LMIO19_triusis)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h> #define int lpng long using namespace std; signed main() { ios::sync_with_stdio(0); cin.tie(0); cout.tie(0); int n, m, las=0, ans=0; cin >> n >> m; while(n--) { int in; cin >> in; if(in>las+m) las=in+m, ans++; else las=in; } cout << ans << '\n'; return 0; }

Compilation message (stderr)

triusis.cpp: In function 'int main()':
triusis.cpp:2:13: error: 'lpng' was not declared in this scope; did you mean 'long'?
    2 | #define int lpng long
      |             ^~~~
triusis.cpp:6:2: note: in expansion of macro 'int'
    6 |  int n, m, las=0, ans=0; cin >> n >> m;
      |  ^~~
triusis.cpp:6:33: error: 'n' was not declared in this scope; did you mean 'yn'?
    6 |  int n, m, las=0, ans=0; cin >> n >> m;
      |                                 ^
      |                                 yn
triusis.cpp:6:38: error: 'm' was not declared in this scope; did you mean 'tm'?
    6 |  int n, m, las=0, ans=0; cin >> n >> m;
      |                                      ^
      |                                      tm
triusis.cpp:2:18: error: expected ';' before 'long'
    2 | #define int lpng long
      |                  ^~~~
triusis.cpp:8:3: note: in expansion of macro 'int'
    8 |   int in; cin >> in;
      |   ^~~
triusis.cpp:8:18: error: 'in' was not declared in this scope; did you mean 'yn'?
    8 |   int in; cin >> in;
      |                  ^~
      |                  yn
triusis.cpp:9:9: error: 'las' was not declared in this scope; did you mean 'labs'?
    9 |   if(in>las+m) las=in+m, ans++;
      |         ^~~
      |         labs
triusis.cpp:9:26: error: 'ans' was not declared in this scope; did you mean 'abs'?
    9 |   if(in>las+m) las=in+m, ans++;
      |                          ^~~
      |                          abs
triusis.cpp:12:10: error: 'ans' was not declared in this scope; did you mean 'abs'?
   12 |  cout << ans << '\n';
      |          ^~~
      |          abs