답안 #201003

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
201003 2020-02-09T04:49:48 Z Nordway 코알라 (APIO17_koala) C++14
33 / 100
113 ms 504 KB
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include "koala.h"
#define x first
#define y second
#define pb push_back
#define mp make_pair
#define all(v) v.begin(),v.end()
#define sz(v) (int)v.size()
#define up_b upper_bound
#define low_b lower_bound
#define nl '\n'

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef long double ld;

typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;

int b[100],r[100];

int minValue(int n,int w){
  b[0]=1;
  playRound(b,r);
  for(int i=0;i<n;i++){
    if(r[i]==0)return i;
  }
}

int maxValue(int n,int w){
  vector<int>v;
  for(int i=0;i<n;i++)v.pb(i);
  while(sz(v)>1){
    int k=w/sz(v);
    for(int i=0;i<n;i++)b[i]=0;
    for(int i:v)b[i]=k;
    v.clear();
    playRound(b,r);
    for(int i=0;i<n;i++)
      if(r[i]>k)v.pb(i);
  }
  return v[0];
}

int greaterValue(int n,int w){
  int L=1,R=8;
  while(L<=R){
    int m=(L+R)/2;
    b[0]=m;
    b[1]=m;
    playRound(b,r);
    bool f=(r[0]>b[0]),s=(r[1]>b[1]);
    if(f!=s){
      if(f)return 0;
      if(s)return 1;
    }
    if(f==0)R=m;
    else L=m+1;
  }
}

void allValues(int n,int w,int *p){
  return ;
}

Compilation message

koala.cpp: In function 'int minValue(int, int)':
koala.cpp:30:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
koala.cpp: In function 'int greaterValue(int, int)':
koala.cpp:62:1: warning: control reaches end of non-void function [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Correct 10 ms 248 KB Output is correct
2 Correct 12 ms 376 KB Output is correct
3 Correct 10 ms 380 KB Output is correct
4 Correct 10 ms 336 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 23 ms 376 KB Output is correct
2 Correct 22 ms 376 KB Output is correct
3 Correct 23 ms 376 KB Output is correct
4 Correct 21 ms 248 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Partially correct 92 ms 248 KB Output is partially correct
2 Partially correct 113 ms 504 KB Output is partially correct
3 Partially correct 94 ms 356 KB Output is partially correct
4 Partially correct 97 ms 376 KB Output is partially correct
5 Partially correct 92 ms 248 KB Output is partially correct
6 Partially correct 99 ms 376 KB Output is partially correct
7 Partially correct 91 ms 248 KB Output is partially correct
8 Partially correct 95 ms 356 KB Output is partially correct
9 Partially correct 97 ms 248 KB Output is partially correct
10 Partially correct 91 ms 248 KB Output is partially correct
# 결과 실행 시간 메모리 Grader output
1 Incorrect 4 ms 248 KB Output isn't correct
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Incorrect 5 ms 376 KB Output isn't correct
2 Halted 0 ms 0 KB -