結果

問題 No.759 悪くない忘年会にしような!
ユーザー chocoruskchocorusk
提出日時 2018-12-07 00:58:28
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,163 bytes
コンパイル時間 2,196 ms
コンパイル使用メモリ 90,624 KB
実行使用メモリ 252,084 KB
最終ジャッジ日時 2023-10-12 03:16:18
合計ジャッジ時間 38,328 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 140 ms
249,176 KB
testcase_01 AC 142 ms
249,436 KB
testcase_02 AC 143 ms
249,176 KB
testcase_03 AC 142 ms
248,988 KB
testcase_04 AC 140 ms
248,772 KB
testcase_05 AC 139 ms
248,708 KB
testcase_06 AC 140 ms
248,900 KB
testcase_07 AC 139 ms
248,572 KB
testcase_08 AC 140 ms
249,212 KB
testcase_09 AC 140 ms
248,656 KB
testcase_10 AC 139 ms
248,580 KB
testcase_11 AC 140 ms
248,884 KB
testcase_12 AC 138 ms
248,908 KB
testcase_13 AC 138 ms
248,576 KB
testcase_14 AC 139 ms
249,220 KB
testcase_15 AC 137 ms
248,668 KB
testcase_16 AC 185 ms
248,784 KB
testcase_17 AC 112 ms
249,328 KB
testcase_18 AC 106 ms
248,808 KB
testcase_19 AC 105 ms
248,796 KB
testcase_20 AC 104 ms
248,880 KB
testcase_21 AC 106 ms
249,348 KB
testcase_22 AC 108 ms
248,728 KB
testcase_23 AC 106 ms
249,140 KB
testcase_24 AC 106 ms
248,636 KB
testcase_25 AC 108 ms
249,408 KB
testcase_26 AC 107 ms
248,728 KB
testcase_27 AC 107 ms
249,472 KB
testcase_28 AC 106 ms
248,724 KB
testcase_29 AC 107 ms
249,400 KB
testcase_30 AC 105 ms
248,916 KB
testcase_31 AC 105 ms
249,404 KB
testcase_32 AC 108 ms
249,404 KB
testcase_33 AC 193 ms
249,308 KB
testcase_34 AC 120 ms
248,816 KB
testcase_35 AC 148 ms
249,236 KB
testcase_36 AC 187 ms
249,940 KB
testcase_37 AC 123 ms
249,668 KB
testcase_38 AC 197 ms
250,060 KB
testcase_39 AC 127 ms
249,440 KB
testcase_40 AC 172 ms
249,272 KB
testcase_41 AC 181 ms
249,096 KB
testcase_42 AC 198 ms
249,364 KB
testcase_43 AC 205 ms
250,012 KB
testcase_44 AC 1,102 ms
251,800 KB
testcase_45 AC 1,102 ms
251,884 KB
testcase_46 AC 1,091 ms
251,752 KB
testcase_47 AC 1,095 ms
251,988 KB
testcase_48 AC 1,083 ms
251,764 KB
testcase_49 AC 205 ms
249,300 KB
testcase_50 AC 208 ms
249,384 KB
testcase_51 AC 210 ms
249,628 KB
testcase_52 AC 203 ms
250,124 KB
testcase_53 AC 1,097 ms
251,744 KB
testcase_54 AC 1,104 ms
251,764 KB
testcase_55 AC 1,079 ms
251,872 KB
testcase_56 AC 1,084 ms
251,832 KB
testcase_57 AC 1,090 ms
251,856 KB
testcase_58 AC 1,094 ms
251,904 KB
testcase_59 AC 1,091 ms
252,084 KB
testcase_60 AC 1,106 ms
251,784 KB
testcase_61 AC 1,085 ms
251,864 KB
testcase_62 AC 1,089 ms
251,872 KB
testcase_63 TLE -
testcase_64 TLE -
testcase_65 AC 1,064 ms
251,724 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;
		}
	}
	for(int i=0; i<n; i++){
		if(!nuee[i]) printf("%d\n", i+1);
	}
	return 0;
}
0