# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
408964 | 2021-05-19T23:53:10 Z | ly20 | The Collection Game (BOI21_swaps) | C++17 | 1 ms | 200 KB |
// // --- Sample implementation for the task swaps --- // // To compile this program with the sample grader, place: // swaps.h swaps_sample.cpp sample_grader.cpp // in a single folder and run: // g++ swaps_sample.cpp sample_grader.cpp // in this folder. // #include "swaps.h" #include <bits/stdc++.h> using namespace std; const int MAXN = 510; int tb[MAXN][MAXN]; vector < pair <int, int> > ts; bool cmp(int a, int b) { ts.push_back(make_pair(min(b, a), max(b, a))); return a < b; } vector <int> rs; int marc1[MAXN], marc2[MAXN * 100]; void solve(int N, int V) { // TODO implement this function int n = N, v = V; for(int i = 1; i <= n; i++) { rs.push_back(i); } sort(rs.begin(), rs.end(), cmp); bool a = true; //random_shuffle(ts.begin(), ts.end()); /*for(int i = 0; i < ts.size(); i++) { printf("%d %d\n", ts[i].first, ts[i].second); }*/ sort(ts.begin(), ts.end()); while(a) { a = false; for (int i = 1; i <= n; i++) marc1[i] = 0; vector <int> vs; for(int j = 0; j < ts.size(); j++) { if(j > 0 && ts[j] == ts[j - 1]) continue; if(marc2[j] == 1) continue; if(marc1[ts[j].first] == 1 || marc1[ts[j].second] == 1) continue; marc1[ts[j].first] = 1; marc1[ts[j].second] = 1; a = true; schedule(ts[j].first, ts[j].second); marc2[j] = 1; } if(a) visit(); } answer(rs); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 200 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |