Submission #982052

# Submission time Handle Problem Language Result Execution time Memory
982052 2024-05-13T18:25:55 Z asdasdqwer Plahte (COCI17_plahte) C++14
0 / 160
2000 ms 5016 KB
#include <bits/stdc++.h>
using namespace std;

#define pii array<int,2>
#define tii array<int,3>

signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    int n,m;cin>>n>>m;
    vector<array<pii, 2>> v(n);
    for (auto &x:v) {
        cin>>x[0][0]>>x[0][1]>>x[1][0]>>x[1][1];
    }

    vector<tii> pts(m);
    vector<int> al;
    for (auto &x:pts) {
        cin>>x[0]>>x[1]>>x[2];
        al.push_back(x[2]);
    }

    sort(al.begin(), al.end());
    al.erase(unique(al.begin(), al.end()), al.end());
    map<int,int> mp;
    for (int i=0;i<(int)al.size();i++) {
        mp[al[i]]=i;
    }

    for (auto &x:pts) {
        x[2] = mp[x[2]];
    }

    for (auto &x:v) {
        vector<int> cnt(m);
        for (auto &y : pts) {
            if (x[0][0] > y[0] || y[0] > x[1][0]) continue;
            if (x[0][1] > y[1] || y[1] > x[1][1]) continue;
            cnt[y[2]]++;
        }

        int res=0;
        for (auto &x:cnt) {
            if (x > 0) {
                res++;
            }
        }

        cout<<res<<"\n";
    }
}
# Verdict Execution time Memory Grader output
1 Execution timed out 2013 ms 2492 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2019 ms 2436 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2037 ms 3348 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2037 ms 5016 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 2036 ms 4844 KB Time limit exceeded
2 Halted 0 ms 0 KB -