Submission #1292860

#TimeUsernameProblemLanguageResultExecution timeMemory
1292860lambd47Counting Mushrooms (IOI20_mushrooms)C++20
25 / 100
28 ms400 KiB
#include "mushrooms.h" #include<bits/stdc++.h> using namespace std; #define L(i,j,k) for(int i=(j);i<=(k);i++) #define R(i,j,k) for(int i=(j);i>=(k);i--) #define sz(v) ((int)(v).size()) #define all(v) (v).begin(),(v).end() //use_machinej int count_mushrooms(int n) { int resp=1; for(int i=1;i<=n-1;i+=2){ vector<int> aux; if(i==n-1){ aux.push_back(0); aux.push_back(i); resp+=1^(use_machine(aux)); } else{ aux.push_back(i); aux.push_back(0); aux.push_back(i+1); resp+=2-use_machine(aux); } } return resp; }
#Verdict Execution timeMemoryGrader output
Fetching results...