Submission #430167

#TimeUsernameProblemLanguageResultExecution timeMemory
430167alishahali1382Counting Mushrooms (IOI20_mushrooms)C++14
25 / 100
175 ms304 KiB
#include "mushrooms.h" #include <bits/stdc++.h> #pragma GCC optimize("O2") using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; typedef vector<int> vi; #define debug(x) {cerr<<#x<<"="<<x<<"\n";} #define debug2(x, y) {cerr<<"{"<<#x<<", "<<#y<<"}={"<<x<<", "<<y<<"}\n";} #define debugp(p) {cerr<<#p<<"={"<<p.first<<", "<<p.second<<"}\n";} #define debugv(abcd) {cerr<<#abcd<<": "; for (auto dcba:abcd) cerr<<dcba<<", ";cerr<<"\n";} #define pb push_back #define all(x) x.begin(), x.end() #define SZ(x) ((int)x.size()) const int inf=1000000100; // 1e9 const ll INF=10000000001000000; // 1e16 const int mod=1000000007; const int MAXN=20010; int n, m, k, x, y, a, b, t, ans; int A[MAXN]; inline int ask(vi vec){ return use_machine(vec);} int count_mushrooms(int _n){ n=_n; ans=1; for (int i=1; i<n; i+=2){ if (i==n-1){ ans+=1-ask({0, i}); continue ; } ans+=2-ask({i, 0, i+1}); } return ans; }
#Verdict Execution timeMemoryGrader output
Fetching results...