답안 #865380

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
865380 2023-10-24T07:47:41 Z Trisanu_Das Lightning Rod (NOI18_lightningrod) C++17
컴파일 오류
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std;
 
int n;
stack<pair<int, int> > s;
 
int main() {
	cin >> n;
	for (int i = 1; i <= n; i++) { 
      int x, y; cin >> x >> y;
      int mx = x + y, mn = x - y;
      while(!s.empty() && s.top().ff >= mn) s.pop();
      if(s.empty() || s.top().ss < mx) s.push({mn, mx});
	}
	cout << s.size() << '\n';
}

Compilation message

lightningrod.cpp: In function 'int main()':
lightningrod.cpp:12:35: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'ff'
   12 |       while(!s.empty() && s.top().ff >= mn) s.pop();
      |                                   ^~
lightningrod.cpp:13:31: error: '__gnu_cxx::__alloc_traits<std::allocator<std::pair<int, int> >, std::pair<int, int> >::value_type' {aka 'struct std::pair<int, int>'} has no member named 'ss'
   13 |       if(s.empty() || s.top().ss < mx) s.push({mn, mx});
      |                               ^~