# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
867052 | 2023-10-27T15:34:01 Z | HossamHero7 | The Collection Game (BOI21_swaps) | C++14 | 1 ms | 344 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; #include "swaps.h" //#include "grader.cpp" bool vis[500][501]; void solve(int n, int v) { vector<vector<pair<int,int>>> ans(n); vector<pair<int,int>> cnt(n); for(int i=0;i<n;i++) cnt[i] = {0,i+1}; for(int i=1;i<=n;i++){ for(int j=i+1;j<=n;j++){ for(int k=0;k<n;k++){ if(vis[k][i] || vis[k][j]) continue; ans[k].push_back({i,j}); vis[k][i] = vis[k][j] = 1; break; } } } for(int i=0;i<n;i++){ if(ans[i].empty()) break; for(auto [a,b] : ans[i]) schedule(a,b); vector<int> ret = visit(); for(int j=0;j<ans[i].size();j++){ auto [a,b] = ans[i][j]; if(ret[j]) cnt[b-1].first ++; else cnt[a-1].first ++; } } sort(cnt.begin(),cnt.end()); vector<int> anss; for(auto [_,i] : cnt) anss.push_back(i); answer(anss); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 344 KB | Not correct |
2 | Halted | 0 ms | 0 KB | - |