# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
306616 | chubyxdxd | 버섯 세기 (IOI20_mushrooms) | C++17 | 13 ms | 384 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "mushrooms.h"
#include <bits/stdc++.h>
#define pb push_back
using namespace std;
int count_mushrooms(int n){
int ans=1;
vector<int> A;
vector<int> B;
A.pb(0);
int j;
for(int i=1;i<n;i++){
if(A.size()>=105 or B.size()>=105)break;
j=i;
vector<int> m;
m.pb(0);
m.pb(i);
int f=use_machine(m);
if(f==1)B.pb(i);
else A.pb(i);
}
//cout<<123<<endl;
/*
for(auto i:A)cout<<i<<" ";
cout<<endl;
for(auto i:B)cout<<i<<" ";
cout<<endl;*/
if(A.size()>=105){
ans=n;
int i=j+1;
vector<int> m;
while(i<n){
int l=0;
m.clear();
while(m.size()<210 and i<n){
m.pb(A[l]);
l++;
m.pb(i);
i++;
}
//for(auto i:m)cout<<i<<" ";
//cout<<endl;
int f=use_machine(m);
f=(f+1)/2;
ans-=f;
}
ans-=int(B.size());
return ans;
}
ans=0;
int i=j+1;
vector<int> m;
while(i<n){
m.clear();
int l=0;
while(m.size()<210 and i<n){
m.pb(B[l]);
l++;
m.pb(i);
i++;
}
//for(auto i:B)cout<<i<<" ";
//cout<<endl;
int f=use_machine(m);
f=(f+1)/2;
ans+=f;
}
ans+=int(A.size());
return ans;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |