SHARE
TWEET

Untitled

a guest Jul 20th, 2019 59 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4.  
  5. struct event {
  6.     int x, i, t, c;
  7. };
  8.  
  9. int main() {
  10.     ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
  11.     int N=0, K=0, M=0; cin >> N >> K >> M;
  12.     vector<event> events;
  13.  
  14.     event ev; int c=0, l=0, r=0;
  15.     for (int i=0; i<M; i++) {
  16.         cin >> c >> l >> r;
  17.         ev.x = min(l, r); ev.t = -1; ev.i = i; ev.c = c;
  18.         events.emplace_back(ev);
  19.         ev.x = min(l, r); ev.t = -1; ev.i = i; ev.c = c;
  20.         events.emplace_back(ev);
  21. }
  22.  
  23.     sort (events.begin(), events.end(), [](const event &a, const event &b)->bool{
  24.         if (a.x != b.x) return a.x < b.x;
  25.         if (a.t != b.t) return a.t < b.t;
  26.     });
  27.  
  28.     vector<int> colors(K+1);
  29.     for (auto event: events) {
  30.         int c=get<0>(events);
  31.         int x=get<1>(events);
  32.         int type=get<2>(events);
  33.     }
  34. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top