結果

問題 No.759 悪くない忘年会にしような!
ユーザー hirokazu1020hirokazu1020
提出日時 2018-12-07 01:21:08
言語 C++11
(gcc 11.4.0)
結果
TLE  
実行時間 -
コード長 1,724 bytes
コンパイル時間 967 ms
コンパイル使用メモリ 111,992 KB
実行使用メモリ 8,704 KB
最終ジャッジ日時 2023-10-12 03:23:23
合計ジャッジ時間 5,787 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#define _CRT_SECURE_NO_WARNINGS
#include<iostream>
#include<sstream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<cmath>
#include<string>
#include<vector>
#include<set>
#include<map>
#include<queue>
#include<numeric>
#include<functional>
#include<algorithm>
#include<bitset>
#include<tuple>
#include<unordered_set>
#include<unordered_map>
#include<random>
#include<array>
#include<cassert>
using namespace std;
#define INF (1<<29)
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define all(v) v.begin(),v.end()
#define uniq(v) v.erase(unique(all(v)),v.end())


class BITmin {
	std::vector<int> bit;
public:
	BITmin(int size) :bit(size + 1, INT_MAX) {
	}
	void add(int i, int x) {
		//i++;
		while (i < (int)bit.size()) {
			bit[i] = std::min(bit[i], x);
			i += i & -i;
		}
	}
	int min(int a)const {//[0,a]
		//a++;
		int res = INT_MAX;
		while (0 < a) {
			res = std::min(res, bit[a]);
			a -= a & -a;
		}
		return res;
	}
};



int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	int n;
	cin >> n;
	map<int, vector<tuple<int, int, int>>> mp;
	rep(i,n) {
		int x, y, z;
		cin >> x >> y >> z;
		mp[10000 - x].emplace_back(10000 - y, 10000 - z, i + 1);
	}

	vector<int> ans;
	BITmin bit(10001 + 1);
	map<int, vector<tuple<int, int, int>>>::iterator it;
	for (it = mp.begin(); it != mp.end(); ++it) {
		for (const auto &t : it->second) {
			bit.add(get<0>(t) + 1, get<1>(t));
			bit.add(get<0>(t), get<1>(t) + 1);
		}
		for (const auto &t : it->second) {
			if (bit.min(get<0>(t)) > get<1>(t)) {
				ans.push_back(get<2>(t));
			}
		}
		for (const auto &t : it->second) {
			bit.add(get<0>(t), get<1>(t));
		}
	}

	sort(all(ans));
	for (int i: ans) {
		cout << i << endl;
	}
	

	return 0;
}
0