# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
425003 | chirathnirodha | Counting Mushrooms (IOI20_mushrooms) | C++17 | 13 ms | 344 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);
int cur=1;
vector<int> m;
int ac=1,bc=0;
while(cur<n){
m.clear();
if(a.size()>=b.size()){
int tc=0;
for(int i=0;i<a.size();i++){
if(cur==n)break;
m.PB(cur);tc++;
m.PB(a[i]);
cur++;
}
int x=use_machine(m);
if(x%2==1)b.PB(m[0]);
else a.PB(m[0]);
bc+=(x+1)/2;
ac+=tc-(x+1)/2;
}
else{
int tc=0;
for(int i=0;i<b.size();i++){
if(cur==n)break;
m.PB(cur);tc++;
m.PB(b[i]);
cur++;
}
int x=use_machine(m);
if(x%2==1)a.PB(m[0]);
else b.PB(m[0]);
ac+=(x+1)/2;
bc+=tc-(x+1)/2;
}
}
return ac;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |