| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 395594 | snasibov05 | Counting Mushrooms (IOI20_mushrooms) | C++14 | 1 ms | 208 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 <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
#define ll long long
#define double long double
#define ull unsigned long long
#define pii pair<int,int>
#define tiii tuple<int,int,int>
#define pll pair<long long, long long>
#define pdd pair<double, double>
#define s second
#define f first
#define pb push_back
#define oo 1000000000000000000ll
int count_mushrooms(int n) {
vector<int> ans(n);
ans[0] = 1;
for (int i = 1; i < n; i+=2) {
vector<int> v;
v.push_back(i);
v.push_back(0);
if(i != n-1) v.push_back(i+1);
int x = use_machine(v);
if (x == 0 && i != n-1) ans[i] = ans[i+1] = 1;
else if (x == 1 || i == n-1) ans[i] = 1;
}
int res = 0;
for (int i = 0; i < n; ++i) {
if (ans[i] == 1) res++;
}
return res;
}
/*
void solve() {
}
signed main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL);
int tst; tst = 1;
//cin >> tst;
while (tst--){
solve();
}
return 0;
}
*/
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
