답안 #791990

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
791990 2023-07-24T13:30:27 Z burythelightdeepwithin Meandian (CEOI06_meandian) C++14
0 / 100
10 ms 208 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;
        for (int j = i; j <= i+4; j++){
            int q[5], ptr = 0;
            for (int k = i; k <= i+4; k++){
                if (k == j){
                    continue;
                }
                ptr++;
                q[ptr] = 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 = i; j <= i+4; j++){
            int q[5], ptr = 0;
            for (int k = i; k <= i+4; k++){
                if (k == j){
                    continue;
                }
                ptr++;
                q[ptr] = k;
            }
            int w = Meandian(q[1], q[2], q[3], q[4]);
            if (w == mx){
                ans[j] = f;
            } else if (w == mn){
                ans[j] = t;
            } else {
                ans[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 Incorrect 1 ms 208 KB number 1 is wrong (1728, should be -1)
2 Incorrect 0 ms 208 KB number 1 is wrong (1482, should be -1)
3 Incorrect 1 ms 208 KB number 1 is wrong (644, should be 340)
4 Incorrect 1 ms 208 KB number 2 is wrong (1290, should be 1688)
5 Incorrect 2 ms 208 KB number 1 is wrong (1222, should be 1426)
6 Incorrect 2 ms 208 KB number 1 is wrong (1400, should be -1)
7 Incorrect 4 ms 208 KB number 1 is wrong (320, should be -1)
8 Incorrect 7 ms 208 KB number 1 is wrong (1806, should be 1832)
9 Incorrect 7 ms 208 KB number 1 is wrong (1476, should be 444)
10 Incorrect 10 ms 208 KB number 1 is wrong (1464, should be 1990)