답안 #136204

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
136204 2019-07-25T01:05:57 Z gs14004 Meandian (CEOI06_meandian) C++17
0 / 100
7 ms 376 KB
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <assert.h>
#include <limits.h>
#include <math.h>
#include <time.h>
#include <iostream>
#include <functional>
#include <numeric>
#include <algorithm>
#include <stack>
#include <queue>
#include <deque>
#include <vector>
#include <string>
#include <bitset>
#include <map>
#include <set>
using namespace std;
typedef long long lint;
typedef long double llf;
typedef pair<int, int> pi;
#include "libmean.h"

int n, arr[100];
deque<int> Q;

void resolve(int a, int b, int c, int d, int e){
	vector<pi> v;
	v.emplace_back(Meandian(a, b, c, d), e);
	v.emplace_back(Meandian(a, b, c, e), d);
	v.emplace_back(Meandian(a, b, d, e), c);
	v.emplace_back(Meandian(a, c, d, e), b);
	v.emplace_back(Meandian(b, c, d, e), a);
	sort(v.begin(), v.end());
	int sum = 0;
	for(int i=1; i<4; i++){
		sum += v[i].first;
	}
	sum /= 2;
	arr[v[2].second] = sum - v[2].first;
}

int main(){
	n = Init();
	memset(arr, -1, sizeof(arr));
	for(int i=0; i<n; i++){
		Q.push_back(i + 1);
	}
	while(Q.size() >= 5){
		resolve(Q[0], Q[1], Q[2], Q[3], Q[4]); 
		vector<int> tmp;
		for(int i=0; i<5; i++){
			if(arr[Q.front()] == -1) tmp.push_back(Q.front());
			Q.pop_front();
		}
		for(auto &i : tmp){
			Q.push_back(i);
		}
	}
	Solution(arr);
}
# 결과 실행 시간 메모리 Grader output
1 Incorrect 2 ms 376 KB number 2 is wrong (-1, should be 790)
2 Incorrect 2 ms 376 KB number 3 is wrong (-1, should be 408)
3 Incorrect 2 ms 252 KB number 1 is wrong (-1, should be 340)
4 Incorrect 2 ms 248 KB number 1 is wrong (-1, should be 336)
5 Incorrect 3 ms 248 KB number 1 is wrong (-1, should be 1426)
6 Incorrect 2 ms 252 KB number 2 is wrong (-1, should be 1400)
7 Incorrect 6 ms 376 KB number 2 is wrong (-1, should be 1388)
8 Incorrect 7 ms 248 KB number 1 is wrong (-1, should be 1832)
9 Incorrect 4 ms 248 KB number 1 is wrong (-1, should be 444)
10 Incorrect 7 ms 248 KB number 1 is wrong (-1, should be 1990)