Submission #12837

#TimeUsernameProblemLanguageResultExecution timeMemory
12837yongwhan덩치 (KOI13_body)C++98
Compilation error
0 ms0 KiB
#include<iostream> #include<utility> #include<vector> using namespace std; int main() { int n; cin>>n; vector<int> v(n); for (int i=0; i<n; i++) { int x,y; cin>>x>>y; v[i]=make_pair(x,y); } vector<int> ret(n); for (int i=0; i<n; i++) { for (int j=0; j<n; j++) if(i!=j) { if(v[j].first>v[i].first && v[j].second>v[i].first) ret[i]++; } } for (int i=0; i<n; i++) { if(i) cout << " "; cout << ret[i]+1; } cout << endl; return 0; }

Compilation message (stderr)

bb.cpp: In function 'int main()':
bb.cpp:11:23: error: cannot convert 'std::pair<int, int>' to 'int' in assignment
bb.cpp:17:15: error: request for member 'first' in 'v.std::vector<_Tp, _Alloc>::operator[] [with _Tp = int, _Alloc = std::allocator<int>, std::vector<_Tp, _Alloc>::reference = int&, std::vector<_Tp, _Alloc>::size_type = long unsigned int](((long unsigned int)j))', which is of non-class type 'int'
bb.cpp:17:26: error: request for member 'first' in 'v.std::vector<_Tp, _Alloc>::operator[] [with _Tp = int, _Alloc = std::allocator<int>, std::vector<_Tp, _Alloc>::reference = int&, std::vector<_Tp, _Alloc>::size_type = long unsigned int](((long unsigned int)i))', which is of non-class type 'int'
bb.cpp:17:40: error: request for member 'second' in 'v.std::vector<_Tp, _Alloc>::operator[] [with _Tp = int, _Alloc = std::allocator<int>, std::vector<_Tp, _Alloc>::reference = int&, std::vector<_Tp, _Alloc>::size_type = long unsigned int](((long unsigned int)j))', which is of non-class type 'int'
bb.cpp:17:52: error: request for member 'first' in 'v.std::vector<_Tp, _Alloc>::operator[] [with _Tp = int, _Alloc = std::allocator<int>, std::vector<_Tp, _Alloc>::reference = int&, std::vector<_Tp, _Alloc>::size_type = long unsigned int](((long unsigned int)i))', which is of non-class type 'int'