제출 #307824

#제출 시각아이디문제언어결과실행 시간메모리
307824Vimmer버섯 세기 (IOI20_mushrooms)C++14
25 / 100
125 ms384 KiB
#include <bits/stdc++.h>
#include "mushrooms.h"
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>

#define N 100005
#define PB push_back
#define sz(x) int(x.size())
#define F first
#define M ll(1e9 + 7)
#define S second
#define all(x) x.begin(), x.end()
#define endl '\n'

//#pragma GCC optimize("unroll-loops")
//#pragma GCC optimize("-O3")
//#pragma GCC optimize("Ofast")
//#pragma GCC optimize("fast-math")
//#pragma GCC optimize("no-stack-protector")

using namespace std;
//using namespace __gnu_pbds;

typedef long long ll;
//typedef tree <int, null_type, less_equal <int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

ll mlt(ll x, ll y) {return (x * y) % M;}
ll sm(ll x, ll y) {return (x + y) % M;}

int count_mushrooms(int n)
{
	vector<int> m; m.clear();

    int ans = 1;

    for (int i = 1; i < n; i += 2) {if (i + 1 < n) {m.PB(i); m.PB(0); m.PB(i + 1); ans += 2 - use_machine(m); m.clear();} else {m.PB(i); m.PB(0); ans += 1 - use_machine(m);}}

    return ans;
}

//int main()
//{
//    iostream::sync_with_stdio(0); ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
//
//    //freopen("fcolor.in", "r", stdin); freopen("fcolor.out", "w", stdout);
//
//
//}
#Verdict Execution timeMemoryGrader output
Fetching results...