結果

問題 No.759 悪くない忘年会にしような!
ユーザー chocoruskchocorusk
提出日時 2018-12-07 01:57:57
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,292 bytes
コンパイル時間 811 ms
コンパイル使用メモリ 90,432 KB
実行使用メモリ 5,456 KB
最終ジャッジ日時 2023-10-12 03:26:20
合計ジャッジ時間 5,647 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 3 ms
4,960 KB
testcase_01 AC 3 ms
4,860 KB
testcase_02 AC 3 ms
4,916 KB
testcase_03 AC 2 ms
4,912 KB
testcase_04 AC 3 ms
4,968 KB
testcase_05 AC 3 ms
4,888 KB
testcase_06 AC 3 ms
4,892 KB
testcase_07 AC 2 ms
4,860 KB
testcase_08 AC 3 ms
4,936 KB
testcase_09 AC 3 ms
4,880 KB
testcase_10 AC 3 ms
4,912 KB
testcase_11 AC 2 ms
4,872 KB
testcase_12 AC 2 ms
4,864 KB
testcase_13 AC 3 ms
4,916 KB
testcase_14 AC 3 ms
4,888 KB
testcase_15 AC 3 ms
5,068 KB
testcase_16 AC 2 ms
4,908 KB
testcase_17 AC 2 ms
4,924 KB
testcase_18 AC 3 ms
5,008 KB
testcase_19 AC 2 ms
4,864 KB
testcase_20 AC 3 ms
5,064 KB
testcase_21 AC 3 ms
4,912 KB
testcase_22 AC 3 ms
5,060 KB
testcase_23 AC 3 ms
4,932 KB
testcase_24 AC 3 ms
4,860 KB
testcase_25 AC 3 ms
4,908 KB
testcase_26 AC 2 ms
4,876 KB
testcase_27 AC 3 ms
4,912 KB
testcase_28 AC 2 ms
4,968 KB
testcase_29 AC 3 ms
4,860 KB
testcase_30 AC 3 ms
5,000 KB
testcase_31 AC 3 ms
4,868 KB
testcase_32 AC 3 ms
4,912 KB
testcase_33 AC 11 ms
4,968 KB
testcase_34 AC 4 ms
4,928 KB
testcase_35 AC 7 ms
5,080 KB
testcase_36 AC 10 ms
4,920 KB
testcase_37 AC 5 ms
4,880 KB
testcase_38 AC 12 ms
5,008 KB
testcase_39 AC 4 ms
4,864 KB
testcase_40 AC 9 ms
4,908 KB
testcase_41 AC 10 ms
4,892 KB
testcase_42 AC 13 ms
4,924 KB
testcase_43 AC 13 ms
4,912 KB
testcase_44 AC 108 ms
5,248 KB
testcase_45 AC 109 ms
5,248 KB
testcase_46 AC 109 ms
5,456 KB
testcase_47 AC 109 ms
5,316 KB
testcase_48 AC 108 ms
5,248 KB
testcase_49 AC 13 ms
4,948 KB
testcase_50 AC 13 ms
5,032 KB
testcase_51 AC 13 ms
4,912 KB
testcase_52 AC 13 ms
4,948 KB
testcase_53 AC 109 ms
5,256 KB
testcase_54 AC 110 ms
5,252 KB
testcase_55 AC 109 ms
5,272 KB
testcase_56 AC 109 ms
5,256 KB
testcase_57 AC 110 ms
5,248 KB
testcase_58 AC 108 ms
5,260 KB
testcase_59 AC 109 ms
5,260 KB
testcase_60 AC 110 ms
5,316 KB
testcase_61 AC 109 ms
5,320 KB
testcase_62 AC 109 ms
5,324 KB
testcase_63 AC 105 ms
5,248 KB
testcase_64 AC 105 ms
5,292 KB
testcase_65 AC 98 ms
5,272 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, int> Pi;
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=0; i<2*m-1; i++) mx[i]=-1;
}

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

int query(int a, int b, int k, int l, int r){
	if(r<=a || b<=l) return -1;
	if(a<=l && r<=b){
		return mx[k];
	}else{
		int vl=query(a, b, k*2+1, l, (l+r)/2);
		int vr=query(a, b, k*2+2, (l+r)/2, r);
		return max(vl, vr);
	}
}

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