제출 #733827

#제출 시각아이디문제언어결과실행 시간메모리
733827vjudge1Lightning Rod (NOI18_lightningrod)C++17
0 / 100
2055 ms131760 KiB
#include<bits/stdc++.h> using namespace std; using ll = long long; int main() { int t, n, m, ans, i, z,j, x, y; cin >> n; vector < pair < int, int > > v; ans = 0; for ( i = 1; i <= n; i ++) { scanf("%d",& x); scanf("%d",& y); v.push_back(make_pair(y, x)); } map <int, int > A; sort ( v.begin(), v.end()); for ( i = v.size() - 1; i >= 0; i -- ) { if ( A[i] == 0) { A[i] = 1; ans ++; for ( j = i; j >= 0; j --) { if ( abs(v[i].second - v[j].second) >= abs(v[i].first - v[j].first)) { A[j] = 1; } } } } cout << ans << endl; }

컴파일 시 표준 에러 (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,j, x, y;
      |      ^
lightningrod.cpp:6:12: warning: unused variable 'm' [-Wunused-variable]
    6 |  int t, n, m, ans, i, z,j, x, y;
      |            ^
lightningrod.cpp:6:23: warning: unused variable 'z' [-Wunused-variable]
    6 |  int t, n, m, ans, i, z,j, x, y;
      |                       ^
lightningrod.cpp:12:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   12 |   scanf("%d",& x);
      |   ~~~~~^~~~~~~~~~
lightningrod.cpp:13:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   13 |   scanf("%d",& y);
      |   ~~~~~^~~~~~~~~~
#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...