제출 #1101124

#제출 시각아이디문제언어결과실행 시간메모리
1101124vjudge1로봇 (IOI13_robots)C++17
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
typedef double db;
#define vc vector
#define vci vc<ll>
#define vcs vc<string>
#define pb push_back
#define ins insert
#define ii pair<ll,ll>
#define str to_string
#define fi first
#define se second
#define mii unordered_map<ll, ll>
#define len (ll)size

int main() {
    ios_base::sync_with_stdio(false); cin.tie(NULL);
	ll n;
	cin >> n;
	ll x, h;
	ll bef = INT_MIN, res = 0, px = INT_MAX;
	while(n--) {
		cin >> x >> h;
		if(x - h > bef) bef = x, res++;
		else if(x > bef) bef = x + h, res++;
		else if(x - h > px) bef = x;
		else bef = x + h;
		px = x;
	}
	cout << res << endl;
    return 0;
}

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

/usr/bin/ld: /tmp/cc6X0AZf.o: in function `main':
robots.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccpjGCng.o:grader.c:(.text.startup+0x0): first defined here
/usr/bin/ld: /tmp/ccpjGCng.o: in function `main':
grader.c:(.text.startup+0x1b1): undefined reference to `putaway'
collect2: error: ld returned 1 exit status