Submission #413629

# Submission time Handle Problem Language Result Execution time Memory
413629 2021-05-29T06:39:09 Z GK2007 Road Construction (JOI21_road_construction) C++14
0 / 100
2268 ms 2097156 KB
#include<algorithm>
#include<iostream>
#include<vector>
using namespace std;
int main(){
	int n,m,i,j;
	cin>>n>>m;
	pair<int, int> a[n+1];
	vector<int> b;
	for(i=1; i<=n; i++)
	{
		cin>>a[i].first>>a[i].second;
	}
	for(j=1; j<n; j++)
	{
		for(i=j+1; i<=n; i++)
		{
			b.push_back(abs(a[i].first-a[i].second)+abs(a[j].first-a[j].second));
		}
	}
	sort(b.begin(), b.end());
	for(i=0; i<m; i++)
	{
		cout<<b[i]<<endl;
	}
	return 0;
}
# Verdict Execution time Memory Grader output
1 Incorrect 517 ms 4956 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2219 ms 2097156 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2268 ms 2097156 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2268 ms 2097156 KB Execution killed with signal 9
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 517 ms 4956 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 517 ms 4956 KB Output isn't correct
2 Halted 0 ms 0 KB -