Submission #328610

#TimeUsernameProblemLanguageResultExecution timeMemory
328610Vladth11Untitled (POI11_imp)C++14
0 / 100
2106 ms65536 KiB
#include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #define debug(x) cerr << #x << " " << x << "\n" #define debug_with_space(x) cerr << #x << " " << x << " " using namespace std; using namespace __gnu_pbds; typedef long long ll; typedef pair <ll, ll> pii; typedef pair <ll, pii> piii; typedef tree <pii, null_type, less <pii>, rb_tree_tag, tree_order_statistics_node_update> OST; const ll NMAX = 200001; const ll INF = (1 << 16) - 1; const ll MOD = 1000000007; const ll BLOCK = 101; const ll nr_of_bits = 20; bitset <3001> b[3001]; vector <int> sol; vector <int> v[3001]; int ok[3001]; queue <int> q; int main() { int n, m, i; cin >> n >> m; for(i = 1; i <= m; i++) { int x, y; cin >> x >> y; v[x].push_back(y); v[y].push_back(x); b[x][y].flip(); b[y][x].flip(); } for(i = 1; i <= n; i++) { ok[i] = 1; q.push(i); } while(!q.empty()) { int i = q.front(); q.pop(); if(ok[i] == 0) continue; if(b[i].count() < (n / 3) * 2 - 1) { ok[i] = 0; for(auto x : v[i]) { b[x][i].flip(); if(b[x].count() < (n / 3) * 2 - 1) { q.push(x); } } } } int cc = n / 3; for(i = 1 ;i <= n && cc; i++){ if(ok[i]){ cc--; cout << i << " "; } } return 0; }

Compilation message (stderr)

imp.cpp: In function 'int main()':
imp.cpp:46:25: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   46 |         if(b[i].count() < (n / 3) * 2 - 1) {
      |            ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
imp.cpp:50:33: warning: comparison of integer expressions of different signedness: 'std::size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   50 |                 if(b[x].count() < (n / 3) * 2 - 1) {
      |                    ~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~
#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...
#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...
#Verdict Execution timeMemoryGrader output
Fetching results...