結果

問題 No.759 悪くない忘年会にしような!
ユーザー 👑 kmjpkmjp
提出日時 2018-12-07 00:10:20
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 183 ms / 2,000 ms
コード長 1,472 bytes
コンパイル時間 4,926 ms
コンパイル使用メモリ 158,840 KB
実行使用メモリ 13,120 KB
最終ジャッジ日時 2023-10-12 02:53:49
合計ジャッジ時間 7,141 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 5 ms
10,676 KB
testcase_01 AC 5 ms
10,480 KB
testcase_02 AC 5 ms
10,500 KB
testcase_03 AC 4 ms
10,640 KB
testcase_04 AC 5 ms
10,556 KB
testcase_05 AC 4 ms
10,724 KB
testcase_06 AC 4 ms
10,640 KB
testcase_07 AC 5 ms
10,480 KB
testcase_08 AC 4 ms
10,548 KB
testcase_09 AC 4 ms
10,504 KB
testcase_10 AC 4 ms
10,480 KB
testcase_11 AC 4 ms
10,488 KB
testcase_12 AC 5 ms
10,536 KB
testcase_13 AC 5 ms
10,540 KB
testcase_14 AC 5 ms
10,504 KB
testcase_15 AC 5 ms
10,500 KB
testcase_16 AC 5 ms
10,640 KB
testcase_17 AC 5 ms
10,508 KB
testcase_18 AC 5 ms
10,656 KB
testcase_19 AC 5 ms
10,588 KB
testcase_20 AC 5 ms
10,676 KB
testcase_21 AC 5 ms
10,540 KB
testcase_22 AC 5 ms
10,476 KB
testcase_23 AC 5 ms
10,540 KB
testcase_24 AC 4 ms
10,548 KB
testcase_25 AC 5 ms
10,492 KB
testcase_26 AC 5 ms
10,600 KB
testcase_27 AC 5 ms
10,540 KB
testcase_28 AC 5 ms
10,724 KB
testcase_29 AC 5 ms
10,516 KB
testcase_30 AC 5 ms
10,784 KB
testcase_31 AC 5 ms
10,480 KB
testcase_32 AC 5 ms
10,528 KB
testcase_33 AC 8 ms
10,812 KB
testcase_34 AC 6 ms
10,528 KB
testcase_35 AC 7 ms
10,676 KB
testcase_36 AC 8 ms
10,776 KB
testcase_37 AC 5 ms
10,588 KB
testcase_38 AC 8 ms
10,876 KB
testcase_39 AC 6 ms
10,692 KB
testcase_40 AC 8 ms
10,704 KB
testcase_41 AC 8 ms
10,824 KB
testcase_42 AC 9 ms
10,876 KB
testcase_43 AC 9 ms
10,892 KB
testcase_44 AC 37 ms
12,884 KB
testcase_45 AC 40 ms
12,888 KB
testcase_46 AC 39 ms
13,120 KB
testcase_47 AC 37 ms
12,928 KB
testcase_48 AC 39 ms
12,900 KB
testcase_49 AC 9 ms
10,932 KB
testcase_50 AC 9 ms
10,844 KB
testcase_51 AC 10 ms
10,844 KB
testcase_52 AC 9 ms
10,808 KB
testcase_53 AC 36 ms
13,008 KB
testcase_54 AC 37 ms
12,896 KB
testcase_55 AC 37 ms
12,888 KB
testcase_56 AC 38 ms
12,896 KB
testcase_57 AC 38 ms
12,888 KB
testcase_58 AC 38 ms
12,936 KB
testcase_59 AC 38 ms
13,068 KB
testcase_60 AC 37 ms
12,884 KB
testcase_61 AC 38 ms
12,876 KB
testcase_62 AC 38 ms
12,908 KB
testcase_63 AC 183 ms
12,720 KB
testcase_64 AC 175 ms
12,584 KB
testcase_65 AC 36 ms
12,972 KB
testcase_66 AC 161 ms
13,100 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N;
int X[101010],Y[101010],Z[101010];
vector<int> ev[303030];

map<int,int> M;
int ng[303030];
void solve() {
	int i,j,k,l,r,x,y; string s;
	
	M[-1]=1<<20;
	M[1<<20]=-1;
	cin>>N;
	FOR(i,N) {
		cin>>X[i]>>Y[i]>>Z[i];
		ev[Z[i]].push_back(i);
	}
	
	for(i=10000;i>=0;i--) if(ev[i].size()) {
		FORR(e,ev[i]) {
			auto it=M.lower_bound(X[e]);
			if(it->second>=Y[e]) ng[e]=1;
		}
		FORR(e,ev[i]) {
			x=X[e];
			y=Y[e];
			auto k=M.lower_bound(x);
			if(k->second>=y) continue;
			while(prev(M.lower_bound(x))->second<=y) {
				auto p=*prev(M.lower_bound(x));
				M.erase(p.first);
			}
			M[x]=y;
		}
		FORR(e,ev[i]) {
			auto it=M.lower_bound(X[e]);
			if(it->second>Y[e]) ng[e]=1;
			it=M.lower_bound(X[e]+1);
			if(it->second>=Y[e]) ng[e]=1;
		}
	}
	
	
	FOR(i,N) if(ng[i]==0) cout<<(i+1)<<endl;
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}
0