結果

問題 No.759 悪くない忘年会にしような!
ユーザー hirokazu1020hirokazu1020
提出日時 2018-12-07 01:23:56
言語 C++11
(gcc 11.4.0)
結果
AC  
実行時間 167 ms / 2,000 ms
コード長 1,667 bytes
コンパイル時間 1,001 ms
コンパイル使用メモリ 112,144 KB
実行使用メモリ 6,596 KB
最終ジャッジ日時 2023-10-12 03:23:29
合計ジャッジ時間 5,648 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,352 KB
testcase_01 AC 2 ms
4,348 KB
testcase_02 AC 1 ms
4,348 KB
testcase_03 AC 2 ms
4,352 KB
testcase_04 AC 2 ms
4,352 KB
testcase_05 AC 2 ms
4,348 KB
testcase_06 AC 2 ms
4,352 KB
testcase_07 AC 2 ms
4,352 KB
testcase_08 AC 1 ms
4,352 KB
testcase_09 AC 2 ms
4,348 KB
testcase_10 AC 2 ms
4,352 KB
testcase_11 AC 1 ms
4,348 KB
testcase_12 AC 2 ms
4,352 KB
testcase_13 AC 2 ms
4,352 KB
testcase_14 AC 2 ms
4,352 KB
testcase_15 AC 2 ms
4,352 KB
testcase_16 AC 1 ms
4,348 KB
testcase_17 AC 1 ms
4,356 KB
testcase_18 AC 2 ms
4,348 KB
testcase_19 AC 2 ms
4,348 KB
testcase_20 AC 2 ms
4,352 KB
testcase_21 AC 2 ms
4,348 KB
testcase_22 AC 2 ms
4,352 KB
testcase_23 AC 1 ms
4,352 KB
testcase_24 AC 2 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 2 ms
4,348 KB
testcase_30 AC 2 ms
4,352 KB
testcase_31 AC 2 ms
4,356 KB
testcase_32 AC 2 ms
4,348 KB
testcase_33 AC 7 ms
4,348 KB
testcase_34 AC 2 ms
4,348 KB
testcase_35 AC 4 ms
4,348 KB
testcase_36 AC 6 ms
4,348 KB
testcase_37 AC 3 ms
4,348 KB
testcase_38 AC 7 ms
4,348 KB
testcase_39 AC 3 ms
4,352 KB
testcase_40 AC 7 ms
4,348 KB
testcase_41 AC 7 ms
4,352 KB
testcase_42 AC 7 ms
4,348 KB
testcase_43 AC 8 ms
4,348 KB
testcase_44 AC 63 ms
6,476 KB
testcase_45 AC 60 ms
6,528 KB
testcase_46 AC 59 ms
6,500 KB
testcase_47 AC 59 ms
6,560 KB
testcase_48 AC 58 ms
6,596 KB
testcase_49 AC 8 ms
4,348 KB
testcase_50 AC 8 ms
4,348 KB
testcase_51 AC 8 ms
4,352 KB
testcase_52 AC 8 ms
4,348 KB
testcase_53 AC 58 ms
6,500 KB
testcase_54 AC 59 ms
6,500 KB
testcase_55 AC 59 ms
6,516 KB
testcase_56 AC 60 ms
6,512 KB
testcase_57 AC 60 ms
6,508 KB
testcase_58 AC 58 ms
6,472 KB
testcase_59 AC 58 ms
6,520 KB
testcase_60 AC 59 ms
6,524 KB
testcase_61 AC 61 ms
6,540 KB
testcase_62 AC 59 ms
6,504 KB
testcase_63 AC 167 ms
5,356 KB
testcase_64 AC 165 ms
5,488 KB
testcase_65 AC 34 ms
4,912 KB
testcase_66 AC 152 ms
5,388 KB
権限があれば一括ダウンロードができます

ソースコード

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 {//[1,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(10003);
	for (auto 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