# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
136362 | khsoo01 | Meandian (CEOI06_meandian) | C++11 | 8 ms | 380 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include"libmean.h"
#define X first
#define Y second
using namespace std;
typedef pair<int,int> pii;
int n, ans[105];
void solve (vector<int> V) {
vector<pii> R;
for(int i=0;i<5;i++) {
vector<int> T;
for(int j=0;j<5;j++) {
if(i != j) T.push_back(V[j]);
}
R.push_back({Meandian(T[0], T[1], T[2], T[3]), V[i]});
}
sort(R.begin(), R.end());
ans[R[2].Y-1] = R[0].X - R[2].X + R[4].X;
}
int main()
{
n = Init();
for(int i=0;i<n;i++) {
ans[i] = -1;
}
if(n == 4) {
Solution(ans);
return 0;
}
int C = 0;
while(C < n-4) {
vector<int> V;
for(int i=1;V.size()<5&&i<=n;i++) {
if(ans[i-1] == -1) V.push_back(i);
}
solve(V);
C++;
}
Solution(ans);
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |