제출 #551347

#제출 시각아이디문제언어결과실행 시간메모리
551347tabr팀들 (IOI15_teams)C++17
0 / 100
4091 ms16308 KiB
#include <bits/stdc++.h>
using namespace std;
#ifdef tabr
#include "library/debug.cpp"
#else
#define debug(...)
#endif

int n;
vector<pair<int, int>> c;

void init(int n_, int a[], int b[]) {
    n = n_;
    for (int i = 0; i < n; i++) {
        c.emplace_back(a[i], b[i]);
    }
    sort(c.begin(), c.end(), [&](auto i, auto j) {
        swap(i.first, i.second);
        swap(j.first, j.second);
        return i < j;
    });
}

int can(int m, int k[]) {
    if (accumulate(k, k + m, 0LL) > n) {
        return 0;
    }
    map<int, int> mp;
    for (int i = 0; i < m; i++) {
        mp[k[i]]++;
    }
    int i = 0;
    for (auto [x, y] : mp) {
        for (int j = 0; j < x * y; j++) {
            while (i < n && !(c[j].first <= x && x <= c[j].second)) {
                i++;
            }
            if (i == n) {
                return 0;
            }
            i++;
        }
    }
    return 1;
}

#ifdef tabr
int main() {
    ios::sync_with_stdio(false);
    cin.tie(0);

    return 0;
}
#endif
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...