Submission #959816

# Submission time Handle Problem Language Result Execution time Memory
959816 2024-04-09T07:19:40 Z marinaluca Game (IOI14_game) C++17
Compilation error
0 ms 0 KB
#include "game.h"
#include <bits/stdc++.h>
/**#pragma GCC optimize ("O4")
#pragma GCC optimize ("fast-math")
#pragma GCC optimize ("unroll-loops")
**/
#define XX first
#define YY second
#define all(x) begin(x), end (x)
#define REP (i, a, b) for (int i = (a); i < (b); ++ i)
#define FOR (i, a, b) for (int i = (a); i <= (b); ++ i)
#define FRE (i, b, a) for (int i = (b); i >= (a); -- i)
#define left Left
#define right Right

using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef double dbl;
typedef long double ldbl;

template <class A, class B>
    bool maxim (A& x, B& y){
        if (x < y)
            return x = y, true;
        else
            return false;
    }

template <class A, class B>
    bool minim (A& x, B& y){
        if (x > y)  
            return x = y, true;
        else
            return false;
    }
    
/*END OF TEMPLATE XD*/

const int NMAX = 1506;

int city[NMAX + 1];
int distance[NMAX + 1];
int n;

 void initialize (int m){
     n = m;
     REP (i, 0, n)
        city[i] = false;
 }
 
 int hasEdge (int u, int v){
     return (++ city[u > v ? u : v]) == (u > v ? u : v);
 }

Compilation message

game.cpp: In function 'void initialize(int)':
game.cpp:10:14: error: 'i' was not declared in this scope
   10 | #define REP (i, a, b) for (int i = (a); i < (b); ++ i)
      |              ^
game.cpp:48:6: note: in expansion of macro 'REP'
   48 |      REP (i, 0, n)
      |      ^~~
game.cpp:10:17: error: 'a' was not declared in this scope
   10 | #define REP (i, a, b) for (int i = (a); i < (b); ++ i)
      |                 ^
game.cpp:48:6: note: in expansion of macro 'REP'
   48 |      REP (i, 0, n)
      |      ^~~
game.cpp:10:20: error: 'b' was not declared in this scope
   10 | #define REP (i, a, b) for (int i = (a); i < (b); ++ i)
      |                    ^
game.cpp:48:6: note: in expansion of macro 'REP'
   48 |      REP (i, 0, n)
      |      ^~~