結果

問題 No.759 悪くない忘年会にしような!
ユーザー chocoruskchocorusk
提出日時 2018-12-07 02:06:13
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,257 bytes
コンパイル時間 728 ms
コンパイル使用メモリ 89,988 KB
実行使用メモリ 5,524 KB
最終ジャッジ日時 2023-10-12 03:27:27
合計ジャッジ時間 5,403 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 WA -
testcase_03 AC 3 ms
5,460 KB
testcase_04 WA -
testcase_05 AC 3 ms
5,276 KB
testcase_06 WA -
testcase_07 AC 3 ms
5,248 KB
testcase_08 WA -
testcase_09 AC 3 ms
5,276 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 3 ms
5,332 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 3 ms
5,252 KB
testcase_18 WA -
testcase_19 AC 3 ms
5,336 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 3 ms
5,324 KB
testcase_24 AC 3 ms
5,328 KB
testcase_25 AC 3 ms
5,228 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 3 ms
5,328 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 AC 84 ms
5,232 KB
testcase_66 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <cstring>
#include <string>
#include <iostream>
#include <cmath>
#include <bitset>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <deque>
#include <algorithm>
#include <unordered_map>
#include <unordered_set>
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
typedef pair<P, P> PP;
const int MAX_N=1<<14;
int m, mx[2*MAX_N-1];
void init(int m_){
	m=1;
	while(m<m_) m*=2;
	for(int i=1; i<=2*m-1; i++) mx[i]=-1;
}

void update(int k, int a){
	k+=m;
	mx[k]=max(mx[k], a);
	while(k>1){
		k>>=1;
		mx[k]=max(mx[2*k], mx[2*k+1]);
	}
}

int query(int a, int b){
	a+=m, b+=m;
	int ans=-1;
	for(;a<b; a>>=1, b>>=1){
		if(b&1){
			b--;
			ans=max(ans, mx[b]);
		}
		if(a&1){
			ans=max(ans, mx[a]);
			a++;
		}
	}
	return ans;
}

int main()
{
	int n;
	cin>>n;
	PP ptr[100000];
	for(int i=0; i<n; i++){
		int p, t, r; cin>>p>>t>>r;
		ptr[i]=PP(P(p, t), P(r, i));
	}
	sort(ptr, ptr+n, greater<PP>());
	bool nuee[100000]={};
	init(10001);
	for(int i=0; i<n; i++){
		int p=ptr[i].first.first, t=ptr[i].first.second, r=ptr[i].second.first, j=ptr[i].second.second;
		if(query(t, 10001)>=r) nuee[j]=1;
		update(t, r);
	}
	for(int i=0; i<n; i++){
		if(!nuee[i]) printf("%d\n", i+1);
	}
	return 0;
}
0