結果

問題 No.759 悪くない忘年会にしような!
ユーザー chocoruskchocorusk
提出日時 2018-12-07 00:56:06
言語 C++11
(gcc 11.4.0)
結果
TLE  
(最新)
AC  
(最初)
実行時間 -
コード長 1,384 bytes
コンパイル時間 1,065 ms
コンパイル使用メモリ 95,420 KB
実行使用メモリ 252,200 KB
最終ジャッジ日時 2023-10-12 03:14:39
合計ジャッジ時間 41,930 ms
ジャッジサーバーID
(参考情報)
judge11 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 153 ms
248,492 KB
testcase_01 AC 152 ms
248,644 KB
testcase_02 AC 171 ms
249,288 KB
testcase_03 AC 150 ms
248,576 KB
testcase_04 AC 156 ms
249,256 KB
testcase_05 AC 155 ms
249,420 KB
testcase_06 AC 139 ms
249,264 KB
testcase_07 AC 141 ms
248,728 KB
testcase_08 AC 139 ms
248,732 KB
testcase_09 AC 138 ms
248,756 KB
testcase_10 AC 138 ms
248,968 KB
testcase_11 AC 139 ms
249,424 KB
testcase_12 AC 139 ms
248,564 KB
testcase_13 AC 139 ms
248,832 KB
testcase_14 AC 141 ms
249,408 KB
testcase_15 AC 138 ms
248,680 KB
testcase_16 AC 140 ms
248,732 KB
testcase_17 AC 138 ms
248,572 KB
testcase_18 AC 140 ms
248,772 KB
testcase_19 AC 141 ms
249,376 KB
testcase_20 AC 142 ms
249,428 KB
testcase_21 AC 141 ms
248,576 KB
testcase_22 AC 141 ms
248,632 KB
testcase_23 AC 141 ms
248,584 KB
testcase_24 AC 145 ms
248,592 KB
testcase_25 AC 141 ms
248,968 KB
testcase_26 AC 140 ms
248,856 KB
testcase_27 AC 141 ms
248,956 KB
testcase_28 AC 139 ms
248,708 KB
testcase_29 AC 138 ms
248,848 KB
testcase_30 AC 139 ms
248,584 KB
testcase_31 AC 140 ms
248,744 KB
testcase_32 AC 138 ms
249,380 KB
testcase_33 AC 230 ms
249,268 KB
testcase_34 AC 156 ms
248,596 KB
testcase_35 AC 185 ms
248,916 KB
testcase_36 AC 220 ms
249,488 KB
testcase_37 AC 156 ms
248,996 KB
testcase_38 AC 238 ms
249,884 KB
testcase_39 AC 159 ms
249,756 KB
testcase_40 AC 210 ms
249,236 KB
testcase_41 AC 219 ms
249,212 KB
testcase_42 AC 235 ms
249,520 KB
testcase_43 AC 246 ms
249,572 KB
testcase_44 AC 1,179 ms
251,796 KB
testcase_45 AC 1,218 ms
251,792 KB
testcase_46 AC 1,192 ms
251,768 KB
testcase_47 AC 1,182 ms
251,912 KB
testcase_48 AC 1,193 ms
251,812 KB
testcase_49 AC 245 ms
249,288 KB
testcase_50 AC 246 ms
249,380 KB
testcase_51 AC 245 ms
249,972 KB
testcase_52 AC 247 ms
250,220 KB
testcase_53 AC 1,193 ms
251,820 KB
testcase_54 AC 1,200 ms
251,888 KB
testcase_55 AC 1,205 ms
251,772 KB
testcase_56 AC 1,245 ms
252,084 KB
testcase_57 AC 1,215 ms
251,848 KB
testcase_58 AC 1,214 ms
251,776 KB
testcase_59 AC 1,211 ms
252,044 KB
testcase_60 AC 1,219 ms
251,676 KB
testcase_61 AC 1,208 ms
251,880 KB
testcase_62 AC 1,183 ms
251,696 KB
testcase_63 TLE -
testcase_64 TLE -
testcase_65 AC 1,200 ms
251,992 KB
testcase_66 TLE -
権限があれば一括ダウンロードができます

ソースコード

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;

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;
		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;
		}
		map<int, int> mp;
		for(auto j:v[i]){
			auto itr=mp.find(t[j]);
			if(itr==mp.end()) mp[t[j]]=j;
			else{
				if(r[itr->second]>r[j]) nuee[j]=1;
				else{
					nuee[itr->second]=1;
					itr->second=j;
				}
			}
		}
	}
	for(int i=0; i<n; i++){
		if(!nuee[i]) printf("%d\n", i+1);
	}
	return 0;
}
0