제출 #124745

#제출 시각아이디문제언어결과실행 시간메모리
124745arthurconmySalesman (IOI09_salesman)C++14
0 / 100
230 ms14316 KiB
// check ctrl+v :^)
/* Arthur Conmy IOI template - minimal! */
#include <iostream>
#include <fstream>
#include <vector>
#include <string>
#include <cmath>
#include <algorithm>
#include <map>
#include <queue>
#include <bitset>
#include <random>
#include <stack>
#include <deque>
#include <chrono>
using namespace std;
using ll = long long;
using vi = vector<int>;
using pii = pair<int,int>;
#define pb push_back
#define ff first
#define ss second
#define REP(i,a,b) \
for(int i = int(a); i<=int(b); i++)

int n,u,d,s;
ll st[2][1048576]; // first is up, second is down monkaS for memory again!
ll dp[500001];

int query(int l, int r, int tree)
{
	ll ans=0;
	l+=1048576;
	r+=1048576;
	l--;
	r--;

	while(l<=r) // we know there's inequality in the case of the query RMQ(i,i)
	{
		if(l%2 == 1)
		{
			ans=max(ans,st[tree][l++]);
		}

		if(r%2 == 1)
		{
			ans=max(ans,st[tree][r--]);
		}

		l/=2;
		r/=2;
	}

	return ans;
}

void update(int pos, ll new_val, int tree)
{
	pos+=1048576;
	pos--;
	st[tree][pos]=max(st[tree][pos],new_val);
	pos/=2;

	while(pos>0)
	{
		st[tree][pos] = max(st[tree][pos+pos],st[tree][pos+pos+1]);
		pos/=2;
	}
}

int main()
{
	#ifdef ARTHUR_LOCAL
		ifstream cin("input.txt");
	#endif

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

	cin>>n>>u>>d>>s;

	vector<tuple<int,int,int>> fairs;

	REP(i,1,n)
	{
		int t,l,m;
		cin>>t>>l>>m;
		fairs.pb({t,l,m});
	}

	sort(fairs.begin(),fairs.end());

	REP(i,0,1000000)
	{
		st[0][i]+=i;
	}
}
#Verdict Execution timeMemoryGrader output
Fetching results...