Submission #1162699

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
11626992025-03-06 14:42:17AndreasKCounting Mushrooms (IOI20_mushrooms)C++20
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "mushrooms.h"
using namespace std;
/*static char fmt_buffer[100000];
#define FMT_TO_STR(fmt, result) va_list vargs; va_start(vargs, fmt); \
vsnprintf(fmt_buffer, sizeof(fmt_buffer), fmt, vargs); \
va_end(vargs); fmt_buffer[sizeof(fmt_buffer)-1] = 0; \
std::string result(fmt_buffer);
static const int min_n = 2;
static const int max_n = 20000;
static const int max_qc = 20000;
static const int max_qs = 100000;
static const int species_A = 0;
static const int species_B = 1;
static int n;
static std::vector<int> species;
static int qc, qs;
static inline void error_if(bool cond, std::string message) {
if (cond) {
printf("%s\n", message.c_str());
exit(0);
}
}
static inline void wrong_if(bool cond, std::string message) {
error_if(cond, "Wrong Answer: "+message);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

mushrooms.cpp: In function 'int main()':
mushrooms.cpp:63:39: error: 'n' was not declared in this scope; did you mean 'yn'?
   63 |         check_input(1 == scanf("%d", &n), "Could not read n.");
      |                                       ^
      |                                       yn
mushrooms.cpp:63:9: error: 'check_input' was not declared in this scope
   63 |         check_input(1 == scanf("%d", &n), "Could not read n.");
      |         ^~~~~~~~~~~
mushrooms.cpp:64:21: error: 'min_n' was not declared in this scope
   64 |         check_input(min_n <= n, "n must not be less than %d, but it is %d.", min_n, n);
      |                     ^~~~~
mushrooms.cpp:65:26: error: 'max_n' was not declared in this scope
   65 |         check_input(n <= max_n, "n must not be greater than %d, but it is %d.", max_n, n);
      |                          ^~~~~
mushrooms.cpp:66:9: error: 'species' was not declared in this scope
   66 |         species.resize(n);
      |         ^~~~~~~
mushrooms.cpp:69:41: error: 'species_A' was not declared in this scope
   69 |                 check_input(species[i]==species_A || species[i] == species_B,
      |                                         ^~~~~~~~~
mushrooms.cpp:69:68: error: 'species_B' was not declared in this scope
   69 |                 check_input(species[i]==species_A || species[i] == species_B,
      |                                                                    ^~~~~~~~~
mushrooms.cpp:72:35: error: 'species_A' was not declared in this scope
   72 |         check_input(species[0] == species_A, "Species element [%d] must be %d.", 0, species_A);
      |                                   ^~~~~~~~~
mushrooms.cpp:75:9: error: 'qc' was not declared in this scope
   75 |         qc = 0;
      |         ^~
mushrooms.cpp:76:9: error: 'qs' was not declared in this scope
   76 |         qs = 0;
      |         ^~