Submission #731692

# Submission time Handle Problem Language Result Execution time Memory
731692 2023-04-27T19:36:18 Z study Meandian (CEOI06_meandian) C++17
0 / 100
1 ms 324 KB
#include "libmean.h"
#include <bits/stdc++.h>
using namespace std;

int ans[100];

int32_t main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	int n = Init();
	fill(ans,ans+n,-1);
	queue<int> q;
	for (int i=0; i<n; ++i) q.push(i);
	while (q.size() > 4){
		vector<int> idx;
		for (int i=0; i<5; ++i){
			idx.emplace_back(q.front());
			q.pop();
		}
		vector<pair<int,int>> queries = {
			{Meandian(idx[0],idx[1],idx[2],idx[3]),idx[4]},
			{Meandian(idx[0],idx[1],idx[2],idx[4]),idx[3]},
			{Meandian(idx[0],idx[1],idx[3],idx[4]),idx[2]},
			{Meandian(idx[0],idx[2],idx[3],idx[4]),idx[1]},
			{Meandian(idx[1],idx[2],idx[3],idx[4]),idx[0]}
		};
		sort(queries.begin(),queries.end());
		ans[queries[2].second] = queries[0].first+queries[4].first-queries[2].first;
		for (int i=0; i<5; ++i){
			if (i != 2) q.emplace(queries[i].second);
		}
	}
	Solution(ans);
	return 0;
}
# Verdict Execution time Memory Grader output
1 Runtime error 0 ms 320 KB Execution killed with signal 13
2 Runtime error 0 ms 208 KB Execution killed with signal 13
3 Runtime error 1 ms 208 KB Execution killed with signal 13
4 Runtime error 0 ms 208 KB Execution killed with signal 13
5 Runtime error 1 ms 324 KB Execution killed with signal 13
6 Runtime error 0 ms 208 KB Execution killed with signal 13
7 Runtime error 1 ms 208 KB Execution killed with signal 13
8 Runtime error 0 ms 208 KB Execution killed with signal 13
9 Runtime error 0 ms 208 KB Execution killed with signal 13
10 Runtime error 0 ms 208 KB Execution killed with signal 13