# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
43879 | ngkan146 | Zagonetka (COI18_zagonetka) | C++11 | 209 ms | 732 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
int n, a[105];
int rev[105];
int edge[105][105];
int b[105];
// topo sort
int degin[105];
bool check(vector<int> &lst,int bound){
for(int i=1;i<=n;i++)
b[i] = a[i],
degin[i] = 0;
for(auto x: lst)
for(auto y: lst)
degin[y] += edge[x][y];
queue <int> q;
for(auto x: lst)
if (!degin[x]) q.push(x);
while(q.size()){
int u = q.front();
q.pop();
b[u] = bound--;
for(auto v:lst){
if (edge[u][v]){
degin[v] --;
if (!degin[v])
q.push(v);
}
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |