Submission #668538

#TimeUsernameProblemLanguageResultExecution timeMemory
668538LittleCubeTeams (IOI15_teams)C++14
34 / 100
4030 ms16056 KiB
#include "teams.h" #include <bits/stdc++.h> #define pii pair<int, int> #define F first #define S second using namespace std; vector<pii> u, v; void init(int N, int A[], int B[]) { for (int i = 0; i < N; i++) u.emplace_back(pii(A[i], B[i])); } int can(int M, int K[]) { v = u; priority_queue<int, vector<int>, greater<int>> pq; for (int i = 0; i < M; i++) v.emplace_back(pii(K[i], 1e9)); sort(v.begin(), v.end()); for (auto [L, R] : v) { if (R >= 1e8) { while (!pq.empty() && pq.top() < L) pq.pop(); while (!pq.empty() && L > 0) { pq.pop(); L--; } if (L) return 0; } else pq.push(R); } return 1; }

Compilation message (stderr)

teams.cpp: In function 'int can(int, int*)':
teams.cpp:25:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   25 |  for (auto [L, R] : v)
      |            ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...