# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
424203 | chirathnirodha | Counting Mushrooms (IOI20_mushrooms) | C++17 | 2 ms | 296 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
//Coded by Chirath Nirodha
#include "mushrooms.h"
#include<bits/stdc++.h>
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define P push
#define I insert
typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;
using namespace std;
const ll mod=1e9+7;
int count_mushrooms(int n) {
vector<int> a,b;
a.push_back(0);
vector<int> m;
m.PB(0);m.PB(1);
for(int i=1;i<min(n,100);i++){
m[1]=i;
int x=use_machine(m);
if(x==0)a.PB(i);
else b.PB(i);
}
int ans=a.size();
int cur=min(n,100);
if(a.size()>=b.size()){
while(cur<n){
m.clear();
for(int i=0;i<a.size();i++){
m.PB(a[i]);
if(cur==n)break;
m.PB(cur);
cur++;
}
int x=use_machine(m);
ans+=a.size()-1-x/2;
}
}
else{
while(cur<n){
m.clear();
for(int i=0;i<b.size();i++){
m.PB(b[i]);
if(cur==n)break;
m.PB(cur);
cur++;
}
int x=use_machine(m);
ans+=x/2;
}
}
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |