# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
584262 | LucaIlie | Counting Mushrooms (IOI20_mushrooms) | C++17 | 221 ms | 356 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>
using namespace std;
int count_mushrooms( int n ) {
int k = n, bs, nrA, p;
vector <int> a, s( n );
s[0] = 0;
nrA = 1;
for ( int i = 1; i < k; i++ ) {
s[i] = use_machine( { 0, i } );
nrA += (s[i] == 0);
}
/*if ( nrA > k / 2 ) {
bs = nrA + 1;
p = 0;
} else {
bs = k - nrA + 1;
p = 1;
}
for ( int i = 0; i < k; i++ ) {
if ( s[i] == p )
a.push_back( i );
}
for ( int i = k; i < n; i += bs ) {
int j;
vector <int> m;
j = i;
m.push_back( j );
for ( int l: a ) {
m.push_back( l );
m.push_back( j );
j++;
if ( j == n )
break;
}
if ( p )
nrA += use_machine( m ) / 2;
else
nrA += j - i + 1 + use_machine( m ) / 2;
}*/
return nrA;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |