Submission #303286

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3032862020-09-20 07:09:23model_codeCounting Mushrooms (IOI20_mushrooms)C++17
92.24 / 100
15 ms384 KiB
/*
* Solution with two mixed phases of dynamic size
* By "mixed" we mean that new types are also detected in the second phase.
* By "dynamic" we mean that #queries in the first phase is computed dynamically based on the current results.
*
* Author: Kian Mirjalali
*/
#include "mushrooms.h"
#include <cmath>
#include <algorithm>
#include <functional>
using namespace std;
#define allOf(c) ((c).begin()), ((c).end())
template<class C>
inline int largest_element_index(const vector<C>& v) {
return max_element(allOf(v), [](const C& c1, const C& c2) {return c1.size()<c2.size();}) - v.begin();
}
/**
* @returns ceil(a/b) for integers a, b
*/
template<class T>
inline T ceildiv(T a, T b) {
return (a+b-1)/b;
}
/**
* Finds minimum input of a function in range [begin, end).
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...