제출 #652053

#제출 시각아이디문제언어결과실행 시간메모리
652053mychecksedad카니발 티켓 (IOI20_tickets)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define pb push_back
void allocate_tickets( std::vector<std::vector<int>> _x);

long long find_maximum(int k, std::vector<std::vector<int>> x) {
	int n = x.size();
	int m = x[0].size();
	std::vector<std::vector<int>> answer;
	vector<ll> a;
	for (int i = 0; i < n; i++) {
		std::vector<int> row(m, 0);
		answer.push_back(row);
		a.pb(x[i][0]);
	}
	sort(all(a));
	ll ans = 0;

	for(int i = 0; i < n/2; ++i){
		ans += a[n - i - 1] - a[i];
	}

	allocate_tickets(answer);
	return ans;
}

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

tickets.cpp: In function 'long long int find_maximum(int, std::vector<std::vector<int> >)':
tickets.cpp:17:7: error: 'all' was not declared in this scope; did you mean 'std::filesystem::perms::all'?
   17 |  sort(all(a));
      |       ^~~
      |       std::filesystem::perms::all
In file included from /usr/include/c++/10/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
                 from tickets.cpp:1:
/usr/include/c++/10/bits/fs_fwd.h:148:7: note: 'std::filesystem::perms::all' declared here
  148 |       all  =  0777,
      |       ^~~