Submission #1041253

#TimeUsernameProblemLanguageResultExecution timeMemory
1041253elotelo966게임 (IOI14_game)C++17
Compilation error
0 ms0 KiB
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,fma")
#include <bits/stdc++.h>
#include "game.h"
using namespace std;
 
#define OYY LLONG_MAX
#define mod 998244353
#define faster ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define FOR for(int i=1;i<=n;i++)
#define mid (start+end)/2
#define lim 200005
#define fi first
#define se second

int dizi[lim];

void initialize(int n) {
	for(int i=0;i<n;i++){
		dizi[i]=2;
	}
}

int hasEdge(int u, int v) {
	if(dizi[x]==2 && dizi[y]==2){
		dizi[x]--;
		dizi[y]--;
		return 1;
	}
	else if((dizi[x]==2 || dizi[y]==2) && (dizi[x]!=0 && dizi[y]!=0)){
		dizi[x]--;
		dizi[y]--;
		return 1;
	}
    return 0;
}

Compilation message (stderr)

game.cpp: In function 'int hasEdge(int, int)':
game.cpp:25:10: error: 'x' was not declared in this scope
   25 |  if(dizi[x]==2 && dizi[y]==2){
      |          ^
game.cpp:25:24: error: 'y' was not declared in this scope
   25 |  if(dizi[x]==2 && dizi[y]==2){
      |                        ^