제출 #733832

#제출 시각아이디문제언어결과실행 시간메모리
733832vjudge1Lightning Rod (NOI18_lightningrod)C++17
21 / 100
1740 ms276 KiB
#include<bits/stdc++.h> using namespace std; int n, x, y, sx, sy, ans = 1; void sol() { if(sx + sy >= x + y) { return; } if(sx - sy < x - y) { ans++; } sx = x; sy = y; return; } int main() { cin >> n; cin >> x >> y; sx = x; sy = y; for(int i = 1; i < n; i++) { scanf("%d", &x); scanf("%d", &y); sol(); } cout << ans; return 0; }

컴파일 시 표준 에러 (stderr) 메시지

lightningrod.cpp: In function 'int main()':
lightningrod.cpp:24:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   24 |   scanf("%d", &x);
      |   ~~~~~^~~~~~~~~~
lightningrod.cpp:25:8: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
   25 |   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...