답안 #745563

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
745563 2023-05-20T11:35:08 Z grogu 코알라 (APIO17_koala) C++14
0 / 100
100 ms 1108 KB
#include "koala.h"
#define here cerr<<"===========================================\n"
#define dbg(x) cerr<<#x<<": "<<x<<endl;
#include <bits/stdc++.h>
#define ld double
#define ll long long
#define ull unsigned long long
#define llinf 100000000000000000LL // 10^17
#define iinf 2000000000 // 2*10^9
#define pb push_back
#define popb pop_back
#define fi first
#define sc second
#define endl '\n'
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pld pair<ld,ld>
#define all(a) a.begin(),a.end()
#define ceri(a,l,r) {cerr<<#a<<": ";for(ll i_ = l;i_<=r;i_++) cerr<<a[i_]<< " ";cerr<<endl;}
#define cer(a) {cerr<<#a<<": ";for(ll x_ : a) cerr<<x_<< " ";cerr<<endl;}
using namespace std;

int minValue(int N, int W) {
    // TODO: Implement Subtask 1 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    return 0;
}

int maxValue(int N, int W) {
    // TODO: Implement Subtask 2 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    return 0;
}

int greaterValue(int N, int W) {
    // TODO: Implement Subtask 3 solution here.
    // You may leave this function unmodified if you are not attempting this
    // subtask.
    return 0;
}
int B[100];
int R[100];
void reshi(vector<ll> v,int n,int w,int *ans,int l,int r){
    if(l==r) ans[v[0]] = l;
    else{
        int c = (w-n+r-1)/(r-l+1)+1;
        dbg(c);
        for(ll i = 0;i<100;i++) B[i] = 0;
        for(ll x : v) B[x] = c;
        playRound(B,R);
        vector<ll> le,gr;
        for(ll x : v){
            if(R[x]>c) gr.pb(x);
            else le.pb(x);
        }
        reshi(le,n,w,ans,l,l+le.size()-1);
        reshi(gr,n,w,ans,r-gr.size()+1,r);

    }
}
void allValues(int N, int W, int *P) {
    vector<ll> v(N);
    iota(all(v),0);
    reshi(v,N,W,P,1,N);
    return;
}
/**
4 1
6 6
5 3 2 1 6 4
**/
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 1 ms 256 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 0 ms 208 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 3 ms 336 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 100 ms 1108 KB Output isn't correct
2 Halted 0 ms 0 KB -