답안 #792022

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
792022 2023-07-24T13:57:22 Z burythelightdeepwithin Meandian (CEOI06_meandian) C++14
0 / 100
1 ms 320 KB
#include <bits/stdc++.h>
#include "libmean.h"

using namespace std;

const int N = 103;
int ans[N], ans2[N];
int n;

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    n = Init();
    for (int i = 1; i <= (n-4); i++){
        int tmp = 0, mx = 0, mn = INT_MAX;
        int take[7], pt = 1, last = 0;
        while(pt <= 5){
            if (last == n){
                break;
            }
            for (int i = last; i <= n; i++){
                if (ans[i] == 0){
                    take[pt] = i;
                    pt++;
                    last = i;
                    break;
                }
            }
        }
        for (int j = 1; j <= 5; j++){
            int q[5], ptr = 0;
            for (int k = 1; k <= 5; k++){
                if (k == j){
                    continue;
                }
                ptr++;
                q[ptr] = take[k];
            }
            int w = Meandian(q[1], q[2], q[3], q[4]);
            tmp += w;
            mx = max(mx, w);
            mn = min(mn, w);
        }
        tmp -= (mx+mn);
        int f = tmp - (mx*2), t = tmp - (mn*2), s = tmp - f - t;
        for (int j = 1; j <= 5; j++){
            int q[5], ptr = 0;
            for (int k = 1; k <= 5; k++){
                if (k == j){
                    continue;
                }
                ptr++;
                q[ptr] = take[k];
            }
            int w = Meandian(q[1], q[2], q[3], q[4]);
            if (w != mx && w != mn){
                ans[take[j]] = s;
            }
        }
    }
    for (int i = 1; i <= n; i++){
        if (ans[i] == 0){
            ans[i] = -1;
        }
        ans2[i-1] = ans[i];
    }
    Solution(ans2);
}

# 결과 실행 시간 메모리 Grader output
1 Runtime error 0 ms 208 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 0 ms 208 KB Execution killed with signal 13
6 Runtime error 0 ms 208 KB Execution killed with signal 13
7 Runtime error 0 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 1 ms 320 KB Execution killed with signal 13