Submission #714598

# Submission time Handle Problem Language Result Execution time Memory
714598 2023-03-25T06:21:31 Z Ferid20072020 Plahte (COCI17_plahte) C++14
0 / 160
2000 ms 473820 KB
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
#pragma GCC optimize("O3,unroll-loops")
#pragma GCC target("avx,avx2,fma")

#include <bits/stdc++.h>

using namespace std;

#define ll          long long 
#define ull         unsigned long long 
#define ld          long double 
#define ui          unsigned int 
#define f           first
#define s           second
#define ins         insert
#define pb          push_back
#define mp          make_pair
#define ln          '\n'
#define int         ll
#define pii         pair<int , int> 
#define INF         LLONG_MAX
#define vv(a)       vector<a>
#define pp(a, b)    pair<a, b>
#define pq(a)       priority_queue<a>
#define qq(a)       queue<a>
#define ss(a)       set<a>
#define mss(a)      multiset<a>
#define mm(a, b)    map<a, b>
#define mmm(a , b)  multimap<a , b>
#define sz(x)       (x).size()
#define all(x)      (x).begin() , (x).end()
#define fastio                    \
    ios_base::sync_with_stdio(0); \
    cin.tie(0);                   \
    cout.tie(0);

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

void solve(){
    int n , q;
    cin >> n >> q;
    vector<pair<pii , pii>> a(n);
    for(int i=0 ; i<n ; i++){
        cin >> a[i].f.f >> a[i].f.s >> a[i].s.f >> a[i].s.s;
    }
    vv(set<int>) ans(n);
    for(int i=0 ; i<q ; i++){
        int x , y , color;
        cin >> x >> y >> color;
        for(int j=0 ; j<n ; j++){
            if(x >= a[j].f.f && y >= a[j].f.s && x <= a[j].s.f && y <= a[j].s.s){
                ans[j].ins(color);
            }
        }
    }
    for(int i=0 ; i<n ; i++){
        cout << ans[i].size() << ln;
    }
}


signed main(){
    fastio

    int t = 1;
    //cin >> t;
    while(t--){
        solve();
    }

    return 0;
}
# Verdict Execution time Memory Grader output
1 Execution timed out 2037 ms 167720 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2049 ms 319076 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2080 ms 473020 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2066 ms 473820 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2066 ms 417200 KB Time limit exceeded
2 Halted 0 ms 0 KB -