# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
304796 | Fdg | Counting Mushrooms (IOI20_mushrooms) | C++14 | 10 ms | 768 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include "mushrooms.h"
using namespace std;
const int VAL = 100;
vector<int> a, b;
void process(int x, bool isA) {
if (isA) a.push_back(x);
else b.push_back(x);
}
int count_mushrooms(int n) {
a.clear(); b.clear();
vector<int> v;
for (int i = 1; i < n; ++i)
v.push_back(i);
int ans = 0, pos = 0;
a.push_back(0);
while (a.size() < VAL && b.size() < VAL && pos + 5 <= (int) v.size()) {
if (a.size() > 2 && b.size() > 1) {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |