제출 #137671

#제출 시각아이디문제언어결과실행 시간메모리
137671ekremLightning Rod (NOI18_lightningrod)C++98
80 / 100
2011 ms76480 KiB
#include <bits/stdc++.h> #define st first #define nd second #define mp make_pair #define pb push_back #define coc g[mode][i] #define sol (k+k) #define sag (k+k+1) #define orta ((bas+son)>>1) #define mod 1000000007 #define inf 1000000009 #define N 10000005 using namespace std; typedef long long ll; typedef pair < int , int > ii; typedef pair < double , double > dd; int n, m, result, ch; ii a, s[N]; int readInt () { result = 0; ch; // ch = getchar(); while (true) { ch = getchar(); if (ch < '0' || ch > '9') break; result = result*10 + (ch - '0'); } return result; } int main(){ // freopen("in.txt", "r", stdin); // freopen("out.txt", "w", stdout); n = readInt(); // cout << n << endl; // ch = getchar(); for(int i = 1; i <= n; i++){ a.st = readInt(); a.nd = readInt(); // cout << a.st << " " << a.nd << endl; while(m and abs(s[m].st - a.st) <= a.nd - s[m].nd) m--; if(m and abs(s[m].st - a.st) <= s[m].nd - a.nd) continue; s[++m] = a; } printf("%d\n", m); return 0; }

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

lightningrod.cpp: In function 'int readInt()':
lightningrod.cpp:25:4: warning: statement has no effect [-Wunused-value]
  ch;
    ^
#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...