結果

問題 No.759 悪くない忘年会にしような!
ユーザー chocoruskchocorusk
提出日時 2018-12-07 01:12:35
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 1,169 ms / 2,000 ms
コード長 1,621 bytes
コンパイル時間 1,259 ms
コンパイル使用メモリ 97,864 KB
実行使用メモリ 252,000 KB
最終ジャッジ日時 2023-10-12 03:20:51
合計ジャッジ時間 35,061 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 158 ms
248,796 KB
testcase_01 AC 155 ms
248,792 KB
testcase_02 AC 153 ms
248,900 KB
testcase_03 AC 157 ms
249,460 KB
testcase_04 AC 159 ms
248,672 KB
testcase_05 AC 159 ms
248,684 KB
testcase_06 AC 157 ms
248,784 KB
testcase_07 AC 155 ms
248,896 KB
testcase_08 AC 155 ms
248,720 KB
testcase_09 AC 157 ms
248,572 KB
testcase_10 AC 155 ms
248,752 KB
testcase_11 AC 142 ms
249,436 KB
testcase_12 AC 102 ms
248,716 KB
testcase_13 AC 103 ms
249,496 KB
testcase_14 AC 102 ms
249,460 KB
testcase_15 AC 102 ms
248,616 KB
testcase_16 AC 101 ms
249,036 KB
testcase_17 AC 101 ms
248,932 KB
testcase_18 AC 104 ms
249,180 KB
testcase_19 AC 104 ms
248,936 KB
testcase_20 AC 104 ms
249,420 KB
testcase_21 AC 103 ms
248,640 KB
testcase_22 AC 102 ms
248,948 KB
testcase_23 AC 102 ms
248,748 KB
testcase_24 AC 100 ms
248,664 KB
testcase_25 AC 102 ms
248,820 KB
testcase_26 AC 100 ms
248,564 KB
testcase_27 AC 118 ms
248,824 KB
testcase_28 AC 156 ms
249,224 KB
testcase_29 AC 156 ms
248,732 KB
testcase_30 AC 157 ms
248,780 KB
testcase_31 AC 156 ms
249,276 KB
testcase_32 AC 157 ms
248,724 KB
testcase_33 AC 239 ms
249,628 KB
testcase_34 AC 170 ms
248,788 KB
testcase_35 AC 201 ms
249,048 KB
testcase_36 AC 239 ms
249,932 KB
testcase_37 AC 175 ms
249,312 KB
testcase_38 AC 250 ms
249,240 KB
testcase_39 AC 173 ms
248,828 KB
testcase_40 AC 223 ms
249,832 KB
testcase_41 AC 230 ms
249,192 KB
testcase_42 AC 250 ms
249,728 KB
testcase_43 AC 261 ms
250,060 KB
testcase_44 AC 1,155 ms
251,812 KB
testcase_45 AC 1,083 ms
251,872 KB
testcase_46 AC 1,153 ms
251,892 KB
testcase_47 AC 1,169 ms
251,860 KB
testcase_48 AC 1,168 ms
251,772 KB
testcase_49 AC 267 ms
250,016 KB
testcase_50 AC 261 ms
249,936 KB
testcase_51 AC 259 ms
250,024 KB
testcase_52 AC 258 ms
249,328 KB
testcase_53 AC 1,109 ms
251,780 KB
testcase_54 AC 1,169 ms
251,992 KB
testcase_55 AC 1,084 ms
252,000 KB
testcase_56 AC 1,137 ms
251,864 KB
testcase_57 AC 1,156 ms
251,892 KB
testcase_58 AC 1,141 ms
251,836 KB
testcase_59 AC 1,141 ms
251,868 KB
testcase_60 AC 1,163 ms
251,776 KB
testcase_61 AC 1,137 ms
251,852 KB
testcase_62 AC 1,153 ms
251,836 KB
testcase_63 AC 1,155 ms
251,896 KB
testcase_64 AC 1,059 ms
251,868 KB
testcase_65 AC 1,128 ms
251,780 KB
testcase_66 AC 1,167 ms
251,900 KB
権限があれば一括ダウンロードができます

ソースコード

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;
int main()
{
	int n;
	cin>>n;
	vector<int> v[10001], vt[10001], vr[10001];
	int t[100000], r[100000];
	for(int i=0; i<n; i++){
		int p; scanf("%d %d %d", &p, &t[i], &r[i]);
		vt[t[i]].push_back(i);
		vr[r[i]].push_back(i);
		v[p].push_back(i);
	}
	bitset<100000> bt[10002], br[10002], bp;
	for(int i=10000; i>=0; i--){
		bt[i]=bt[i+1], br[i]=br[i+1];
		for(auto j:vt[i]){
			bt[i][j]=1;
		}
		for(auto j:vr[i]){
			br[i][j]=1;
		}
	}
	bool nuee[100001]={};
	for(int i=10000; i>=0; i--){
		for(auto j:v[i]){
			if((bp&bt[t[j]]&br[r[j]]).count()) nuee[j]=1;
		}
		for(auto j:v[i]) bp[j]=1;
		vector<Pi> v0;
		for(auto j:v[i]){
			if(nuee[j]) continue;
			v0.push_back({{t[j], r[j]}, j});
		}
		sort(v0.begin(), v0.end());
		int prt=-1, mx=-1;
		for(int j=v0.size()-1; j>=0; j--){
			if(prt==v0[j].first.first){
				nuee[v0[j].second]=1;
				mx=max(v0[j].first.second, mx);
			}else{
				prt=v0[j].first.first;
				if(v0[j].first.second<=mx){
					nuee[v0[j].second]=1;
				}
				mx=max(v0[j].first.second, mx);
			}
		}
		/*for(auto j:v[i]){
		    if(nuee[j]) continue;
			if((bp&bt[t[j]+1]&br[r[j]]).count()) nuee[j]=1;
			else if((bp&bt[t[j]]&br[r[j]+1]).count()) nuee[j]=1;
		}*/
	}
	for(int i=0; i<n; i++){
		if(!nuee[i]) printf("%d\n", i+1);
	}
	return 0;
}
0