Submission #558091

#TimeUsernameProblemLanguageResultExecution timeMemory
558091emuyumiScales (IOI15_scales)C++17
0 / 100
1 ms308 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { } const vector<tuple<int, int, int>> cliques = { {1, 3, 5}, {1, 3, 6}, {1, 4, 5}, {1, 4, 6}, {2, 3, 5}, {2, 3, 6}, {2, 4, 5}, {2, 4, 6} }; void orderCoins() { vector<vector<int>> adj(7); vector<int> deg(7); for (auto [a, b, c] : cliques){ int lo = getLightest(a, b, c); int hi = getHeaviest(a, b, c); int mi = a ^ b ^ c ^ lo ^ hi; adj[lo].push_back(mi); deg[mi]++; adj[lo].push_back(hi); deg[hi]++; adj[mi].push_back(hi); deg[hi]++; } queue<int> q; for (int i = 1; i <= 6; ++i){ if (!deg[i]) q.push(i); } vector<int> ord; while (!q.empty()){ int v = q.front(); q.pop(); ord.push_back(v); for (int to : adj[v]){ deg[to]--; if (!deg[to]) q.push(to); } } answer(ord.data()); }

Compilation message (stderr)

scales.cpp: In function 'void init(int)':
scales.cpp:5:15: warning: unused parameter 'T' [-Wunused-parameter]
    5 | void init(int T) {
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...