답안 #129368

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
129368 2019-07-12T06:58:03 Z Dajunctic Exhibition (JOI19_ho_t2) C++17
컴파일 오류
0 ms 0 KB
/*
 _   ________   ___       __ ___   _           _  _
| | / /|  _  \ / _ \     / // _ \ | |         | |(_)
| |/ / | | | |/ /_\ \   / // /_\ \| | __ __ _ | | _
|    \ | | | ||  _  |  / / |  _  || |/ // _` || || |
| |\  \| |/ / | | | | / /  | | | ||   <| (_| || || |
\_| \_/|___/  \_| |_//_/   \_| |_/|_|\_\\__,_||_||_|
*/
#include<bits/stdc++.h>
using namespace std;
#define int long long
const int N = 1e5+50;
const int mod = 1e9+7;
#define pb push_back
const int in = 1e9+9;
typedef pair<int,int> ii;
int n, m;
struct Exhibition{
	int s, v;
} Pictures[N];
int size[N];
#define fi first
#define se second
signed main(){
	cin >> n >> m;
	for(int i=1;i<=n;i++){
		cin >> Pictures[i].s >> Pictures[i].v;
	}
	for(int i=1;i<=m;i++) cin >> size[i];
	sort(Pictures+1,Pictures+n+1,[](Exhibition _a,Exhibition _b){return _a.v > _b.v or (_a.v == _b.v and _a.s > _b.s);});
	sort(size+1,size+m+1,greater<int>());
	int it = 1;
	for(int i=1;i<=n;i++){
		if(it<=m and Pictures[i].s <= size[it]) it++;
	}
	cout << it-1;
}

Compilation message

joi2019_ho_t2.cpp: In function 'int main()':
joi2019_ho_t2.cpp:29:31: error: reference to 'size' is ambiguous
  for(int i=1;i<=m;i++) cin >> size[i];
                               ^~~~
joi2019_ho_t2.cpp:21:5: note: candidates are: long long int size [100050]
 int size[N];
     ^~~~
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from joi2019_ho_t2.cpp:9:
/usr/include/c++/7/bits/range_access.h:252:5: note:                 template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])
     size(const _Tp (&/*__array*/)[_Nm]) noexcept
     ^~~~
/usr/include/c++/7/bits/range_access.h:242:5: note:                 template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)
     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
     ^~~~
joi2019_ho_t2.cpp:31:7: error: reference to 'size' is ambiguous
  sort(size+1,size+m+1,greater<int>());
       ^~~~
joi2019_ho_t2.cpp:21:5: note: candidates are: long long int size [100050]
 int size[N];
     ^~~~
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from joi2019_ho_t2.cpp:9:
/usr/include/c++/7/bits/range_access.h:252:5: note:                 template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])
     size(const _Tp (&/*__array*/)[_Nm]) noexcept
     ^~~~
/usr/include/c++/7/bits/range_access.h:242:5: note:                 template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)
     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
     ^~~~
joi2019_ho_t2.cpp:31:14: error: reference to 'size' is ambiguous
  sort(size+1,size+m+1,greater<int>());
              ^~~~
joi2019_ho_t2.cpp:21:5: note: candidates are: long long int size [100050]
 int size[N];
     ^~~~
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from joi2019_ho_t2.cpp:9:
/usr/include/c++/7/bits/range_access.h:252:5: note:                 template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])
     size(const _Tp (&/*__array*/)[_Nm]) noexcept
     ^~~~
/usr/include/c++/7/bits/range_access.h:242:5: note:                 template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)
     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
     ^~~~
joi2019_ho_t2.cpp:34:33: error: reference to 'size' is ambiguous
   if(it<=m and Pictures[i].s <= size[it]) it++;
                                 ^~~~
joi2019_ho_t2.cpp:21:5: note: candidates are: long long int size [100050]
 int size[N];
     ^~~~
In file included from /usr/include/c++/7/string:51:0,
                 from /usr/include/c++/7/bits/locale_classes.h:40,
                 from /usr/include/c++/7/bits/ios_base.h:41,
                 from /usr/include/c++/7/ios:42,
                 from /usr/include/c++/7/istream:38,
                 from /usr/include/c++/7/sstream:38,
                 from /usr/include/c++/7/complex:45,
                 from /usr/include/c++/7/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:52,
                 from joi2019_ho_t2.cpp:9:
/usr/include/c++/7/bits/range_access.h:252:5: note:                 template<class _Tp, long unsigned int _Nm> constexpr std::size_t std::size(const _Tp (&)[_Nm])
     size(const _Tp (&/*__array*/)[_Nm]) noexcept
     ^~~~
/usr/include/c++/7/bits/range_access.h:242:5: note:                 template<class _Container> constexpr decltype (__cont.size()) std::size(const _Container&)
     size(const _Container& __cont) noexcept(noexcept(__cont.size()))
     ^~~~