Submission #836109

#TimeUsernameProblemLanguageResultExecution timeMemory
836109maomao90Counting Mushrooms (IOI20_mushrooms)C++17
0 / 100
0 ms208 KiB
// I can do all things through Christ who strengthens me
// Philippians 4:13

#include "mushrooms.h"
#include <bits/stdc++.h>
using namespace std;

#define REP(i, j, k) for (int i = j; i < (k); i++)
#define RREP(i, j, k) for (int i = j; i >= (k); i--)

template <class T>
inline bool mnto(T &a, const T b) {return a > b ? a = b, 1 : 0;}
template <class T>
inline bool mxto(T &a, const T b) {return a < b ? a = b, 1 : 0;}

typedef long long ll;
typedef long double ld;
#define FI first
#define SE second
typedef pair<int, int> ii;
typedef pair<ll, ll> pll;
#define ALL(x) x.begin(), x.end()
#define SZ(x) (int) x.size()
#define pb push_back
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<ii> vii;
typedef tuple<int, int, int> iii;
typedef vector<iii> viii;

#ifndef DEBUG
#define cerr if (0) cerr
#endif

const int INF = 1000000005;
const ll LINF = 1000000000000000005;
const int MAXN = 20005;

int n;

int count_mushrooms(int _n) {
    n = _n;
    int ans = 1;
    for (int j = 1; j < n; j += 2) {
        vi x;
        x.pb(j);
        x.pb(0);
        if (j + 1 < n) {
            x.pb(j + 1);
        }
        ans += 2 - use_machine(x);
    }
    return ans;
}
#Verdict Execution timeMemoryGrader output
Fetching results...