# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
308478 | CaroLinda | Counting Mushrooms (IOI20_mushrooms) | C++14 | 258 ms | 512 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 "mushrooms.h"
#include <bits/stdc++.h>
#define debug printf
#define lp(i,a,b) for(int i = a ; i < b; i++)
#define pb push_back
#define ff first
#define ss second
#define mk make_pair
#define pii pair<int,int>
#define ll long long
#define all(x) x.begin(),x.end()
using namespace std ;
int count_mushrooms(int n)
{
if( n <= 226 )
{
vector<int> type(n,1) ;
for(int i = 1 ; i < n ; i++ )
{
int x = use_machine( {i,i-1} ) ;
type[i] = type[i-1] ;
if(x) type[i] ^= 1 ;
}
int cnt = 0 ;
lp(i,0,n) cnt += type[i] ;
return cnt ;
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |