結果

問題 No.759 悪くない忘年会にしような!
ユーザー kriiikriii
提出日時 2018-12-09 02:51:44
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 991 bytes
コンパイル時間 647 ms
コンパイル使用メモリ 61,864 KB
実行使用メモリ 5,356 KB
最終ジャッジ日時 2023-10-13 11:18:35
合計ジャッジ時間 6,878 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,352 KB
testcase_01 AC 2 ms
4,352 KB
testcase_02 AC 1 ms
4,352 KB
testcase_03 AC 1 ms
4,352 KB
testcase_04 WA -
testcase_05 AC 1 ms
4,348 KB
testcase_06 AC 1 ms
4,348 KB
testcase_07 AC 1 ms
4,348 KB
testcase_08 AC 2 ms
4,348 KB
testcase_09 WA -
testcase_10 AC 2 ms
4,348 KB
testcase_11 WA -
testcase_12 AC 2 ms
4,348 KB
testcase_13 AC 2 ms
4,348 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
4,348 KB
testcase_17 AC 2 ms
4,352 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 1 ms
4,352 KB
testcase_24 AC 1 ms
4,352 KB
testcase_25 WA -
testcase_26 AC 1 ms
4,352 KB
testcase_27 AC 1 ms
4,352 KB
testcase_28 WA -
testcase_29 WA -
testcase_30 AC 2 ms
4,348 KB
testcase_31 WA -
testcase_32 AC 1 ms
4,352 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 WA -
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 WA -
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
testcase_53 WA -
testcase_54 WA -
testcase_55 WA -
testcase_56 WA -
testcase_57 WA -
testcase_58 WA -
testcase_59 WA -
testcase_60 WA -
testcase_61 WA -
testcase_62 WA -
testcase_63 WA -
testcase_64 WA -
testcase_65 WA -
testcase_66 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <algorithm>
#include <map>
using namespace std;

struct v{
	int a,b,c,i;
	bool operator <(const v &t)const{
		if (a != t.a) return a < t.a;
		if (b != t.b) return b < t.b;
		if (c != t.c) return c < t.c;
		return i < t.i;
	}
}V[100100];

map<int, pair<int, int> > hi;
bool chk[100100];

void push(int x, int y, int i)
{
	auto I = hi.lower_bound(x);
	if (I != hi.end()){
		if (y <= I->second.first){
			while (I != hi.end()){
				auto J = I; I++;
				if (J->second.first >= y){
					hi.erase(J);
				}
				else break;
			}
		}
	}

	while (I != hi.begin()){
		auto J = I; J--;
		if (J->second.first <= y){
			chk[J->second.second] = 1;
			hi.erase(J);
		}
		else break;
	}
	
	hi[x] = {y,i};
}

int main()
{
	int N; scanf ("%d",&N);
	for (int i=0;i<N;i++){
		int a,b,c; scanf ("%d %d %d",&a,&b,&c);
		V[i] = {a,b,c,i+1};
	}
	sort(V,V+N);

	for (int i=0;i<N;i++){
		push(V[i].b,V[i].c,V[i].i);
	}

	for (int i=1;i<=N;i++) if (!chk[i]) printf ("%d\n",i);

	return 0;
}
0