Submission #546858

#TimeUsernameProblemLanguageResultExecution timeMemory
546858brunnorezendesCounting Mushrooms (IOI20_mushrooms)C++17
Compilation error
0 ms0 KiB
#include "mushrooms.h"
#include <bits/stdc++.h>

using namespace std;

int count_mushrooms(int n){
	int x=0, i:
	vector <int> v(2);
	v[0] = 0;
	for(i=1;i<n;i++){
		v[1] = i;
		x += use_machine(v);
	}
	return n-x;
}

Compilation message (stderr)

mushrooms.cpp: In function 'int count_mushrooms(int)':
mushrooms.cpp:7:12: error: found ':' in nested-name-specifier, expected '::'
    7 |  int x=0, i:
      |            ^
      |            ::
mushrooms.cpp:7:11: error: 'i' has not been declared
    7 |  int x=0, i:
      |           ^
mushrooms.cpp:8:9: error: qualified-id in declaration before '<' token
    8 |  vector <int> v(2);
      |         ^
mushrooms.cpp:9:2: error: 'v' was not declared in this scope
    9 |  v[0] = 0;
      |  ^
mushrooms.cpp:10:6: error: 'i' was not declared in this scope
   10 |  for(i=1;i<n;i++){
      |      ^