Submission #733810

#TimeUsernameProblemLanguageResultExecution timeMemory
733810vjudge1Lightning Rod (NOI18_lightningrod)C++17
0 / 100
1813 ms78240 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; int main() { int t, n, m, ans, i, z; cin >> n; int x[n + 2], y[n + 2]; cin >> x[1] >> y[1]; ans = 1; for ( i = 2; i <= n; i ++) { scanf("%d %d",&x[i], &y[i]); if ( x[i] - x[i - 1] < y[i]- y[i - 1]) ans ++; } cout << ans << endl; }

Compilation message (stderr)

lightningrod.cpp: In function 'int main()':
lightningrod.cpp:6:6: warning: unused variable 't' [-Wunused-variable]
    6 |  int t, n, m, ans, i, z;
      |      ^
lightningrod.cpp:6:12: warning: unused variable 'm' [-Wunused-variable]
    6 |  int t, n, m, ans, i, z;
      |            ^
lightningrod.cpp:6:23: warning: unused variable 'z' [-Wunused-variable]
    6 |  int t, n, m, ans, i, z;
      |                       ^
lightningrod.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d %d",&x[i], &y[i]);
      |   ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...