Submission #1157677

#TimeUsernameProblemLanguageResultExecution timeMemory
1157677adlinRoad Construction (JOI21_road_construction)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#define F first
#define S second
#define pb push_back

using namespace std;

typedef long long ll;

const int maxn = 250001;

int n,k;

pair <int,int> a[maxn];

int main(){
	
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	
	cin >> n >> k;
	
	for(int i = 1; i <= n; i++){
		cin >> a[i].F >> a[i].S;
	}
	
	vector <int> v;
	
	for(int i = 1; i <= n; i++){
		for(int j = i + 1; j <= n; j++){
			v.pb(abs(a[i].F-a[j].F) + abs(a[i].S-a[j].S));
		}
	}
	
	sort(all(v));
	
	for(int i = 0; i < v.size(); i++) cout << v[i] << '\n';
	
	return 0;
}

Compilation message (stderr)

road_construction.cpp: In function 'int main()':
road_construction.cpp:35:14: error: 'all' was not declared in this scope
   35 |         sort(all(v));
      |              ^~~
road_construction.cpp:35:14: note: suggested alternatives:
In file included from /usr/include/c++/11/filesystem:44,
                 from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:129,
                 from road_construction.cpp:1:
/usr/include/c++/11/bits/fs_fwd.h:154:7: note:   'std::filesystem::perms::all'
  154 |       all               =  0777,
      |       ^~~
In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/stdc++.h:146,
                 from road_construction.cpp:1:
/usr/include/c++/11/ranges:1130:27: note:   'std::ranges::views::all'
 1130 |     inline constexpr _All all;
      |                           ^~~