Submission #1035301

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10353012024-07-26 09:05:24vjudge1Political Development (BOI17_politicaldevelopment)C++17
4 / 100
3114 ms312668 KiB
#include <bits/stdc++.h>
using namespace std;
const int N = 5e4;
mt19937 rng(time(nullptr) + 69);
int n, k, cnt[N];
vector<int> rem, adj[N];
bitset<N> bt[N], curr;
bool solve(int tot, int x, int y) {
//cerr << tot << " " << x << " " << y << " " << curr.count() << endl;
if (curr.count() < tot) return 0;
else if (!x) return 1;
// tengo que pillar x mas, mayores que y, tengo curr odiados
vector<int> temp;
int sz = rem.size();
for (int i = sz-1; i >= 0; i--) {
if (rem[i] <= y) break;
temp.push_back(rem[i]);
}
shuffle(temp.begin(), temp.end(), rng);
sz = temp.size();
if (sz < x-1) return 0;
for (int i = 0; i < sz; i++) {
bitset<N> prv = curr;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

politicaldevelopment.cpp: In function 'bool solve(int, int, int)':
politicaldevelopment.cpp:14:20: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   14 |   if (curr.count() < tot) return 0;
      |       ~~~~~~~~~~~~~^~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...