Submission #370393

# Submission time Handle Problem Language Result Execution time Memory
370393 2021-02-24T01:23:19 Z casperwang Xoractive (IZhO19_xoractive) C++14
Compilation error
0 ms 0 KB
#include "interactive.h"
using namespace std;
#define debug(args) kout("[ " + string(#args) + " ]", args)
void kout() { cerr << endl; }
template <class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ',kout(b...); }
template <class T> void pary(T L, T R) { while (L != R) cerr << *L << " \n"[++L==R]; }

vector<int> guess(int n) {
	vector <int> ans;
	for (int i = 1; i <= n; i++) {
		ans.push_back(ask(i));
	}
	return ans;
}

Compilation message

Xoractive.cpp: In function 'void kout()':
Xoractive.cpp:4:15: error: 'cerr' was not declared in this scope
    4 | void kout() { cerr << endl; }
      |               ^~~~
Xoractive.cpp:2:1: note: 'std::cerr' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
    1 | #include "interactive.h"
  +++ |+#include <iostream>
    2 | using namespace std;
Xoractive.cpp:4:23: error: 'endl' was not declared in this scope
    4 | void kout() { cerr << endl; }
      |                       ^~~~
Xoractive.cpp:2:1: note: 'std::endl' is defined in header '<ostream>'; did you forget to '#include <ostream>'?
    1 | #include "interactive.h"
  +++ |+#include <ostream>
    2 | using namespace std;
Xoractive.cpp: In function 'void kout(T, U ...)':
Xoractive.cpp:5:57: error: 'cerr' was not declared in this scope
    5 | template <class T, class ...U> void kout(T a, U ...b) { cerr << a << ' ',kout(b...); }
      |                                                         ^~~~
Xoractive.cpp:5:57: note: 'std::cerr' is defined in header '<iostream>'; did you forget to '#include <iostream>'?
Xoractive.cpp: In function 'void pary(T, T)':
Xoractive.cpp:6:57: error: 'cerr' was not declared in this scope
    6 | template <class T> void pary(T L, T R) { while (L != R) cerr << *L << " \n"[++L==R]; }
      |                                                         ^~~~
Xoractive.cpp:6:57: note: 'std::cerr' is defined in header '<iostream>'; did you forget to '#include <iostream>'?