結果
| 問題 |
No.759 悪くない忘年会にしような!
|
| コンテスト | |
| ユーザー |
kriii
|
| 提出日時 | 2018-12-09 02:51:44 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 991 bytes |
| コンパイル時間 | 627 ms |
| コンパイル使用メモリ | 62,196 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-15 08:18:12 |
| 合計ジャッジ時間 | 4,826 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 48 |
ソースコード
#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;
}
kriii