結果
問題 |
No.759 悪くない忘年会にしような!
|
ユーザー |
![]() |
提出日時 | 2018-12-07 02:38:37 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 90 ms / 2,000 ms |
コード長 | 1,066 bytes |
コンパイル時間 | 945 ms |
コンパイル使用メモリ | 90,452 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-14 03:10:50 |
合計ジャッジ時間 | 4,545 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 64 |
ソースコード
#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; typedef pair<P, P> PP; int bit[10002]; int n0; int rt[10002]; int max(int i){ int s=0; while(i>0){ s=max(s, bit[i]); i-=(i&(-i)); } return s; } void update(int i, int x){ if(rt[i]>=x) return; rt[i]=x; while(i<=n0){ bit[i]=max(bit[i], x); i+=(i&(-i)); } } int main() { int n; cin>>n; PP ptr[100000]; for(int i=0; i<n; i++){ int p, t, r; cin>>p>>t>>r; r++; ptr[i]=PP(P(p, t), P(r, i)); } sort(ptr, ptr+n, greater<PP>()); bool nuee[100000]={}; n0=10001; for(int i=0; i<n; i++){ int p=ptr[i].first.first, t=ptr[i].first.second, r=ptr[i].second.first, j=ptr[i].second.second; if(max(10001-t)>=r) nuee[j]=1; update(10001-t, r); } for(int i=0; i<n; i++) if(!nuee[i]) printf("%d\n", i+1); return 0; }