Submission #273167

# Submission time Handle Problem Language Result Execution time Memory
273167 2020-08-19T04:21:41 Z 임성재(#5106) A Game with Grundy (CCO20_day1problem1) C++17
Compilation error
0 ms 0 KB
#include<bits/stdC++.h>
using namespace std;

#define fast ios::sync_with_stdio(false); cin.tie(0);
#define fi first
#define se second
#define em emplace
#define eb emplace_back
#define mp make_pair
#define all(v) (v).begin(), (v).end()

typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int inf = 1e9;
const ll INF = 1e18;

int n;
ll l, r, y;
ll x[100010];
ll v[100010];
ll h[100010];
ll ans[100010];
vector<pll> p;

int main() {
	fast;

	cin >> n;

	cin >> l >> r >> y;

	for(int i=1; i<=n; i++) {
		cin >> x[i] >> v[i] >> h[i];

		ll t = h[i] * y / v[i];

		if(t * v[i] == h[i] * y) t--;

		p.eb(x[i]-t, 1);
		p.eb(x[i]+t+1, -1);
	}

	p.eb(l, 0);
	p.eb(r+1, 0);

	sort(all(p));

	ll pre = l-1, cnt = 0;

	for(auto i : p) {
		if(i.fi > r + 1) break;
		if(pre >= l) ans[cnt] += (i.fi - pre);

		cnt += i.se;
		pre = i.fi;
	}

	for(int i=0; i<=n; i++) {
		if(i) ans[i] += ans[i-1];
		cout << ans[i] << "\n";
	}
}

Compilation message

Main.cpp:1:9: fatal error: bits/stdC++.h: No such file or directory
    1 | #include<bits/stdC++.h>
      |         ^~~~~~~~~~~~~~~
compilation terminated.