제출 #252504

#제출 시각아이디문제언어결과실행 시간메모리
252504BlagojceTug of War (BOI15_tug)C++11
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h> 
#define fr(i, n, m) for(int i = (n); i < (m); i ++)
#define pb push_back
#define st first
#define nd second
#define pq priority_queue
#define all(x) begin(x), end(x)
#include <time.h>
#include <cmath>

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;

const int i_inf = 1e9;
const ll inf = 1e18;
const ll mod = 1000000007;
const ld eps = 1e-13;
const ld pi  = 3.14159265359;
 
mt19937 _rand(time(NULL));
clock_t timer = clock();
const int mxn = 5e5;

int l[mxn], r[mxn], s[mxn];

void subtask3(){
	int deg[2*n];
	memset(deg, 0, sizeof(deg));
	
	fr(i, 0, n){
		deg[l[i]]++;
		deg[r[i]+n]++;
	}
	fr(i, 0, 2*n){
		if(deg[i] % 2){
			cout<<"NO"<<endl;
			return;
		}
	}
	cout<<"YES"<<endl;
}

void solve(){
	int n;
	cin >> n;
	bool sub3 = true;
	fr(i, 0, n){
		cin >> l[i] >> r[i] >> s[i];
		--l[i], --r[i];
		if(s[i] != 1) sub3 = false;
	}
	
	
	
}
int main(){

	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	solve();
	
}

컴파일 시 표준 에러 (stderr) 메시지

tug.cpp: In function 'void subtask3()':
tug.cpp:29:12: error: 'n' was not declared in this scope
  int deg[2*n];
            ^
tug.cpp:30:9: error: 'deg' was not declared in this scope
  memset(deg, 0, sizeof(deg));
         ^~~