Submission #768085

# Submission time Handle Problem Language Result Execution time Memory
768085 2023-06-27T12:37:16 Z Filya Examination (JOI19_examination) C++14
100 / 100
242 ms 30044 KB
//♥God will make a way♥

//#include <bits/stdc++.h>
#define _CRT_SECURE_NO_WARNINGS
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <cstring>
#include <cassert>
#include <set>
#include <map>
#include <unordered_map>
#include <vector>
#include <stack>
#include <queue>
#include <iomanip>
#include <bitset>
#include <stdio.h>
#include <climits>
#include <numeric>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
//template <typename T>
//using ordered_set = tree <T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
/////////////////////define/////////////////////
#define ci(x) if(x) cout << "YES" << '\n'; else cout << "NO" << '\n';
#define cii(x) if(check(x))
#define MOD 1000000007
#define MOD2 998244353
#define oo 1e9
#define ool 1e18L
#define pii pair<int, int>
#define pll pair<long long, long long>
#define mii map<int, int>
#define vi vector<int>
#define vpi vector<pair<int, int>>
#define vll vector <ll>
#define ff first
#define ss second
#define mp make_pair
#define ll long long
#define ld long double
#define pb push_back
#define eb emplace_back
#define pob pop_back
#define lb lower_bound
#define ub upper_bound
#define bs binary_search
#define sz(x) (int((x).size()))
#define all(x) (x).begin(), (x).end()
#define alll(x) (x), (x) + n
#define clr(x) (x).clear();
#define fri(x) for(int i = 0; i < x; ++i)
#define frj(x) for(int j = 0; j < x; ++j)
#define frp(x) for(int p = 0; p < x; ++p)
#define frr(a, b) for(int i = a; i < b; ++i)
#define frrj(a, b) for(int j = a; j < b; ++j)
#define fra(x) for(int i = 0; i < x; ++i) cin >> a[i];
#define frb(x) for(int i = 0; i < x; ++i) cin >> b[i];
#define frs(x) for(auto it = x.begin(); it != x.end(); ++it)
#define fr(x) for(auto it : x) //el
#define fastio ios_base::sync_with_stdio(false); cin.tie(0);
#define dbg(x) cerr << #x << ": " << x << endl;
#define ce(x) cout << x << endl;
#define uniq(x) x.resize(unique(all(x)) - x.begin()); //make all one after sorting
#define blt __builtin_popcount
/////////////////////print array, vector, deque, set, multiset, pair, map /////////////////////
void print(long long t) {cerr << t;}
void print(int t) {cerr << t;}
void print(string t) {cerr << t;}
void print(char t) {cerr << t;}
void print(double t) {cerr << t;}
void print(long double t) {cerr << t;}
void print(unsigned long long t) {cerr << t;}
template <class T, class V> void print(pair <T, V> p) {cerr << "{"; print(p.first); cerr << ","; print(p.second); cerr << "}";}
template <class T, class V> void print(T v[],V n) {cerr << "["; for(int i = 0; i < n; i++) {print(v[i]); cerr << " "; } cerr << "]"; cout << endl;}
template <class T> void print(vector <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
template <class T> void print(set <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
template <class T> void print(multiset <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
template <class T> void print(stack <T> v) {cerr << "[ "; stack<T> s = v; while(s.size()) {T i = s.top(); print(i); s.pop(); cerr << " ";} cerr << "]"; cout << endl;}
template <class T> void print(queue <T> v) {cerr << "[ "; queue<T> s = v; while(s.size()) {T i = s.front(); print(i); s.pop(); cerr << " ";} cerr << "]"; cout << endl;}
template <class T> void print(deque <T> v) {cerr << "[ "; deque<T> s = v; while(s.size()) {T i = s.front(); print(i); s.pop_front(); cerr << " ";} cerr << "]"; cout << endl;}
template <class T, class V> void print(map <T, V> v) {cerr << "[ "; for (auto i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
template <class T, class V> void print(unordered_map <T, V> v) {cerr << "[ "; for (auto i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
/////////////////////code/////////////////////
pii a[200005]; 
pair<pii, pii> b[200005];
int ans[200005];
struct segtree {
    vector <long long> tree;
    int size = 1;
    void init(int n) { //make tree
        while(size < n) size *= 2;
        tree.assign(2 * size - 1, 0);
    }
    void build(vector<int> &a, int x, int lx, int rx) {
        if(rx - lx == 1) {
            if(lx < a.size()) tree[x] = a[lx];
        }
        else {
            int m = (lx + rx) / 2;
            build(a, 2 * x + 1, lx, m);
            build(a, 2 * x + 2, m, rx);
            tree[x] = tree[2 * x + 1] + tree[2 * x + 2];
        }
    }
    void build(vector<int> &a) {
        init(a.size());
        build(a, 0, 0, size);
    }
    void set(int i, int v, int x, int lx, int rx) {
        if(rx - lx == 1) {
            tree[x] += v;
            return;
        }
        int m = (lx + rx) / 2;
        if(i < m) set(i, v, 2 * x + 1, lx, m);
        else set(i, v, 2 * x + 2, m, rx);
        tree[x] = tree[2 * x + 1] + tree[2 * x + 2];
    }
    void set(int i, int v) { //set i-th to v
        set(i, v, 0, 0, size);
    }
    long long sum(int l, int r, int x, int lx, int rx) {
        if(l >= rx || lx >= r) return 0;
        if(lx >= l && rx <= r) return tree[x];
        int m = (lx + rx) / 2;
        return sum(l, r, 2 * x + 1, lx, m) + sum(l, r, 2 * x + 2, m, rx);
    }
    long long sum(int l, int r) {
        return sum(l, r, 0, 0, size);
    }
} fx, fy;
struct event{
    int x, y, z, id, type;
    bool operator<(event other){
        if(z == other.z) return (type < other.type);
        return z > other.z;
    }
};
vector<event> v;
int main() {
    fastio;
    int n, q, x, y, z; cin >> n >> q;
    vi compress;
    fri(n) {
        cin >> x >> y;
        v.pb({x, y, x+y, 0, 0});
        compress.pb(x); compress.pb(y);
    }
    int maxi = 400001;
    fx.init(maxi+1); fy.init(maxi+1);
    fri(q) {
        cin >> x >> y >> z;
        v.pb({x, y, max(x+y, z), i, 1});
        compress.pb(x); compress.pb(y);
    }
    sort(all(v));
    sort(all(compress)); uniq(compress);
    int cnt = 0;
    fri(v.size()) {
        v[i].x = lb(all(compress), v[i].x) - compress.begin();
        v[i].y = lb(all(compress), v[i].y) - compress.begin();
    }
    for(auto it : v) {
        if(it.type) {
            //a miavorac b = a+b - a hatac b
            ans[it.id] = fx.sum(it.x, maxi) + fy.sum(it.y, maxi) - cnt;
        } else {
            cnt++;
            fx.set(it.x, 1);
            fy.set(it.y, 1);
        }
    }
    fri(q) cout << ans[i] << '\n';
}

Compilation message

examination.cpp: In member function 'void segtree::build(std::vector<int>&, int, int, int)':
examination.cpp:101:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  101 |             if(lx < a.size()) tree[x] = a[lx];
      |                ~~~^~~~~~~~~~
examination.cpp: In function 'int main()':
examination.cpp:56:33: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<event>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   56 | #define fri(x) for(int i = 0; i < x; ++i)
      |                               ~~^~~~~~~~~
   57 | #define frj(x) for(int j = 0; j < x; ++j)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   58 | #define frp(x) for(int p = 0; p < x; ++p)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   59 | #define frr(a, b) for(int i = a; i < b; ++i)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   60 | #define frrj(a, b) for(int j = a; j < b; ++j)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   61 | #define fra(x) for(int i = 0; i < x; ++i) cin >> a[i];
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   62 | #define frb(x) for(int i = 0; i < x; ++i) cin >> b[i];
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   63 | #define frs(x) for(auto it = x.begin(); it != x.end(); ++it)
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   64 | #define fr(x) for(auto it : x) //el
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   65 | #define fastio ios_base::sync_with_stdio(false); cin.tie(0);
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   66 | #define dbg(x) cerr << #x << ": " << x << endl;
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   67 | #define ce(x) cout << x << endl;
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
   68 | #define uniq(x) x.resize(unique(all(x)) - x.begin()); //make all one after sorting
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   69 | #define blt __builtin_popcount
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   70 | /////////////////////print array, vector, deque, set, multiset, pair, map /////////////////////
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   71 | void print(long long t) {cerr << t;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   72 | void print(int t) {cerr << t;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
   73 | void print(string t) {cerr << t;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   74 | void print(char t) {cerr << t;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  
   75 | void print(double t) {cerr << t;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   76 | void print(long double t) {cerr << t;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   77 | void print(unsigned long long t) {cerr << t;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   78 | template <class T, class V> void print(pair <T, V> p) {cerr << "{"; print(p.first); cerr << ","; print(p.second); cerr << "}";}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   79 | template <class T, class V> void print(T v[],V n) {cerr << "["; for(int i = 0; i < n; i++) {print(v[i]); cerr << " "; } cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   80 | template <class T> void print(vector <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   81 | template <class T> void print(set <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   82 | template <class T> void print(multiset <T> v) {cerr << "[ "; for (T i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   83 | template <class T> void print(stack <T> v) {cerr << "[ "; stack<T> s = v; while(s.size()) {T i = s.top(); print(i); s.pop(); cerr << " ";} cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   84 | template <class T> void print(queue <T> v) {cerr << "[ "; queue<T> s = v; while(s.size()) {T i = s.front(); print(i); s.pop(); cerr << " ";} cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   85 | template <class T> void print(deque <T> v) {cerr << "[ "; deque<T> s = v; while(s.size()) {T i = s.front(); print(i); s.pop_front(); cerr << " ";} cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   86 | template <class T, class V> void print(map <T, V> v) {cerr << "[ "; for (auto i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   87 | template <class T, class V> void print(unordered_map <T, V> v) {cerr << "[ "; for (auto i : v) {print(i); cerr << " ";} cerr << "]"; cout << endl;}
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   88 | /////////////////////code/////////////////////
      | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   89 | pii a[200005];
      | ~~~~~~~~~~~~~~                   
   90 | pair<pii, pii> b[200005];
      | ~~~~~~~~~~~~~~~~~~~~~~~~~        
   91 | int ans[200005];
      | ~~~~~~~~~~~~~~~~                 
   92 | struct segtree {
      | ~~~~~~~~~~~~~~~~                 
   93 |     vector <long long> tree;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~     
   94 |     int size = 1;
      |     ~~~~~~~~~~~~~                
   95 |     void init(int n) { //make tree
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   96 |         while(size < n) size *= 2;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~
   97 |         tree.assign(2 * size - 1, 0);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
   98 |     }
      |     ~                            
   99 |     void build(vector<int> &a, int x, int lx, int rx) {
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  100 |         if(rx - lx == 1) {
      |         ~~~~~~~~~~~~~~~~~~       
  101 |             if(lx < a.size()) tree[x] = a[lx];
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  102 |         }
      |         ~                        
  103 |         else {
      |         ~~~~~~                   
  104 |             int m = (lx + rx) / 2;
      |             ~~~~~~~~~~~~~~~~~~~~~~
  105 |             build(a, 2 * x + 1, lx, m);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  106 |             build(a, 2 * x + 2, m, rx);
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~
  107 |             tree[x] = tree[2 * x + 1] + tree[2 * x + 2];
      |             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  108 |         }
      |         ~                        
  109 |     }
      |     ~                            
  110 |     void build(vector<int> &a) {
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  111 |         init(a.size());
      |         ~~~~~~~~~~~~~~~          
  112 |         build(a, 0, 0, size);
      |         ~~~~~~~~~~~~~~~~~~~~~    
  113 |     }
      |     ~                            
  114 |     void set(int i, int v, int x, int lx, int rx) {
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  115 |         if(rx - lx == 1) {
      |         ~~~~~~~~~~~~~~~~~~       
  116 |             tree[x] += v;
      |             ~~~~~~~~~~~~~        
  117 |             return;
      |             ~~~~~~~              
  118 |         }
      |         ~                        
  119 |         int m = (lx + rx) / 2;
      |         ~~~~~~~~~~~~~~~~~~~~~~   
  120 |         if(i < m) set(i, v, 2 * x + 1, lx, m);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  121 |         else set(i, v, 2 * x + 2, m, rx);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  122 |         tree[x] = tree[2 * x + 1] + tree[2 * x + 2];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  123 |     }
      |     ~                            
  124 |     void set(int i, int v) { //set i-th to v
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  125 |         set(i, v, 0, 0, size);
      |         ~~~~~~~~~~~~~~~~~~~~~~   
  126 |     }
      |     ~                            
  127 |     long long sum(int l, int r, int x, int lx, int rx) {
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  128 |         if(l >= rx || lx >= r) return 0;
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  129 |         if(lx >= l && rx <= r) return tree[x];
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  130 |         int m = (lx + rx) / 2;
      |         ~~~~~~~~~~~~~~~~~~~~~~   
  131 |         return sum(l, r, 2 * x + 1, lx, m) + sum(l, r, 2 * x + 2, m, rx);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  132 |     }
      |     ~                            
  133 |     long long sum(int l, int r) {
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  134 |         return sum(l, r, 0, 0, size);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  135 |     }
      |     ~                            
  136 | } fx, fy;
      | ~~~~~~~~~                        
  137 | struct event{
      | ~~~~~~~~~~~~~                    
  138 |     int x, y, z, id, type;
      |     ~~~~~~~~~~~~~~~~~~~~~~       
  139 |     bool operator<(event other){
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 
  140 |         if(z == other.z) return (type < other.type);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  141 |         return z > other.z;
      |         ~~~~~~~~~~~~~~~~~~~      
  142 |     }
      |     ~                            
  143 | };
      | ~~                               
  144 | vector<event> v;
      | ~~~~~~~~~~~~~~~~                 
  145 | int main() {
      | ~~~~~~~~~~~~                     
  146 |     fastio;
      |     ~~~~~~~                      
  147 |     int n, q, x, y, z; cin >> n >> q;
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  148 |     vi compress;
      |     ~~~~~~~~~~~~                 
  149 |     fri(n) {
      |     ~~~~~~~~                     
  150 |         cin >> x >> y;
      |         ~~~~~~~~~~~~~~           
  151 |         v.pb({x, y, x+y, 0, 0});
      |         ~~~~~~~~~~~~~~~~~~~~~~~~ 
  152 |         compress.pb(x); compress.pb(y);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  153 |     }
      |     ~                            
  154 |     int maxi = 400001;
      |     ~~~~~~~~~~~~~~~~~~           
  155 |     fx.init(maxi+1); fy.init(maxi+1);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  156 |     fri(q) {
      |     ~~~~~~~~                     
  157 |         cin >> x >> y >> z;
      |         ~~~~~~~~~~~~~~~~~~~      
  158 |         v.pb({x, y, max(x+y, z), i, 1});
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  159 |         compress.pb(x); compress.pb(y);
      |         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  160 |     }
      |     ~                            
  161 |     sort(all(v));
      |     ~~~~~~~~~~~~~                
  162 |     sort(all(compress)); uniq(compress);
      |     ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  163 |     int cnt = 0;
      |     ~~~~~~~~~~~~                 
  164 |     fri(v.size()) {
      |     ~~~~~~~~~~~~                 
examination.cpp:164:5: note: in expansion of macro 'fri'
  164 |     fri(v.size()) {
      |     ^~~
# Verdict Execution time Memory Grader output
1 Correct 8 ms 16712 KB Output is correct
2 Correct 7 ms 16712 KB Output is correct
3 Correct 7 ms 16712 KB Output is correct
4 Correct 7 ms 16724 KB Output is correct
5 Correct 6 ms 16724 KB Output is correct
6 Correct 6 ms 16724 KB Output is correct
7 Correct 12 ms 17108 KB Output is correct
8 Correct 13 ms 17096 KB Output is correct
9 Correct 12 ms 17104 KB Output is correct
10 Correct 10 ms 17108 KB Output is correct
11 Correct 10 ms 17108 KB Output is correct
12 Correct 9 ms 17012 KB Output is correct
13 Correct 12 ms 17116 KB Output is correct
14 Correct 13 ms 17108 KB Output is correct
15 Correct 12 ms 17184 KB Output is correct
16 Correct 11 ms 17064 KB Output is correct
17 Correct 10 ms 17088 KB Output is correct
18 Correct 9 ms 16980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 216 ms 26476 KB Output is correct
2 Correct 195 ms 26600 KB Output is correct
3 Correct 191 ms 26596 KB Output is correct
4 Correct 140 ms 26672 KB Output is correct
5 Correct 135 ms 26572 KB Output is correct
6 Correct 100 ms 25960 KB Output is correct
7 Correct 183 ms 26572 KB Output is correct
8 Correct 180 ms 26676 KB Output is correct
9 Correct 173 ms 26572 KB Output is correct
10 Correct 123 ms 26416 KB Output is correct
11 Correct 122 ms 26460 KB Output is correct
12 Correct 98 ms 25572 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 216 ms 26476 KB Output is correct
2 Correct 195 ms 26600 KB Output is correct
3 Correct 191 ms 26596 KB Output is correct
4 Correct 140 ms 26672 KB Output is correct
5 Correct 135 ms 26572 KB Output is correct
6 Correct 100 ms 25960 KB Output is correct
7 Correct 183 ms 26572 KB Output is correct
8 Correct 180 ms 26676 KB Output is correct
9 Correct 173 ms 26572 KB Output is correct
10 Correct 123 ms 26416 KB Output is correct
11 Correct 122 ms 26460 KB Output is correct
12 Correct 98 ms 25572 KB Output is correct
13 Correct 195 ms 26536 KB Output is correct
14 Correct 193 ms 26476 KB Output is correct
15 Correct 198 ms 26400 KB Output is correct
16 Correct 142 ms 26456 KB Output is correct
17 Correct 145 ms 26432 KB Output is correct
18 Correct 104 ms 26188 KB Output is correct
19 Correct 194 ms 26472 KB Output is correct
20 Correct 193 ms 26492 KB Output is correct
21 Correct 192 ms 26560 KB Output is correct
22 Correct 124 ms 26440 KB Output is correct
23 Correct 124 ms 26324 KB Output is correct
24 Correct 85 ms 25808 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 8 ms 16712 KB Output is correct
2 Correct 7 ms 16712 KB Output is correct
3 Correct 7 ms 16712 KB Output is correct
4 Correct 7 ms 16724 KB Output is correct
5 Correct 6 ms 16724 KB Output is correct
6 Correct 6 ms 16724 KB Output is correct
7 Correct 12 ms 17108 KB Output is correct
8 Correct 13 ms 17096 KB Output is correct
9 Correct 12 ms 17104 KB Output is correct
10 Correct 10 ms 17108 KB Output is correct
11 Correct 10 ms 17108 KB Output is correct
12 Correct 9 ms 17012 KB Output is correct
13 Correct 12 ms 17116 KB Output is correct
14 Correct 13 ms 17108 KB Output is correct
15 Correct 12 ms 17184 KB Output is correct
16 Correct 11 ms 17064 KB Output is correct
17 Correct 10 ms 17088 KB Output is correct
18 Correct 9 ms 16980 KB Output is correct
19 Correct 216 ms 26476 KB Output is correct
20 Correct 195 ms 26600 KB Output is correct
21 Correct 191 ms 26596 KB Output is correct
22 Correct 140 ms 26672 KB Output is correct
23 Correct 135 ms 26572 KB Output is correct
24 Correct 100 ms 25960 KB Output is correct
25 Correct 183 ms 26572 KB Output is correct
26 Correct 180 ms 26676 KB Output is correct
27 Correct 173 ms 26572 KB Output is correct
28 Correct 123 ms 26416 KB Output is correct
29 Correct 122 ms 26460 KB Output is correct
30 Correct 98 ms 25572 KB Output is correct
31 Correct 195 ms 26536 KB Output is correct
32 Correct 193 ms 26476 KB Output is correct
33 Correct 198 ms 26400 KB Output is correct
34 Correct 142 ms 26456 KB Output is correct
35 Correct 145 ms 26432 KB Output is correct
36 Correct 104 ms 26188 KB Output is correct
37 Correct 194 ms 26472 KB Output is correct
38 Correct 193 ms 26492 KB Output is correct
39 Correct 192 ms 26560 KB Output is correct
40 Correct 124 ms 26440 KB Output is correct
41 Correct 124 ms 26324 KB Output is correct
42 Correct 85 ms 25808 KB Output is correct
43 Correct 233 ms 30000 KB Output is correct
44 Correct 229 ms 30032 KB Output is correct
45 Correct 219 ms 30044 KB Output is correct
46 Correct 149 ms 28488 KB Output is correct
47 Correct 149 ms 28444 KB Output is correct
48 Correct 101 ms 26008 KB Output is correct
49 Correct 226 ms 29924 KB Output is correct
50 Correct 242 ms 29980 KB Output is correct
51 Correct 217 ms 29832 KB Output is correct
52 Correct 145 ms 28344 KB Output is correct
53 Correct 134 ms 27580 KB Output is correct