Submission #399198

#TimeUsernameProblemLanguageResultExecution timeMemory
399198daanolavCarnival Tickets (IOI20_tickets)C++14
Compilation error
0 ms0 KiB
#include <iostream> using namespace std; #define INF 1<<29 #define MAXN 301; #define MAXM 301; int n,m,k,temp; int[MAXN][MAXM] x; int64 find_maximum(int k, int[][] x) { return 1; } void allocate_tickets(int[][] s) { } void main() { ios_base::sync_with_stdio(false); cin.tie(NULL); cin >> n >> m >> k; for(int i = 0; i < n; ++i) { for(int j = 0; j < m; ++j) { cin >> temp; x[i][j] = temp; } } cout << find_maximum(k,x); return 0; }

Compilation message (stderr)

tickets.cpp:6:14: error: expected identifier before numeric constant
    6 | #define MAXN 301;
      |              ^~~
tickets.cpp:10:5: note: in expansion of macro 'MAXN'
   10 | int[MAXN][MAXM] x;
      |     ^~~~
tickets.cpp:10:5: error: expected ']' before numeric constant
   10 | int[MAXN][MAXM] x;
      |     ^
      |     ]
tickets.cpp:10:9: error: expected unqualified-id before ']' token
   10 | int[MAXN][MAXM] x;
      |         ^
tickets.cpp:10:15: error: expected unqualified-id before ']' token
   10 | int[MAXN][MAXM] x;
      |               ^
tickets.cpp:12:1: error: 'int64' does not name a type; did you mean 'int64_t'?
   12 | int64 find_maximum(int k, int[][] x) {
      | ^~~~~
      | int64_t
tickets.cpp:16:29: error: multidimensional array must have bounds for all dimensions except the first
   16 | void allocate_tickets(int[][] s) {
      |                             ^
tickets.cpp:16:31: error: expected ',' or '...' before 's'
   16 | void allocate_tickets(int[][] s) {
      |                               ^
tickets.cpp:21:1: error: '::main' must return 'int'
   21 | void main() {
      | ^~~~
tickets.cpp: In function 'int main()':
tickets.cpp:31:13: error: 'x' was not declared in this scope
   31 |             x[i][j] = temp;
      |             ^
tickets.cpp:35:28: error: 'x' was not declared in this scope
   35 |     cout << find_maximum(k,x);
      |                            ^
tickets.cpp:35:13: error: 'find_maximum' was not declared in this scope
   35 |     cout << find_maximum(k,x);
      |             ^~~~~~~~~~~~