# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
867010 | HossamHero7 | The Collection Game (BOI21_swaps) | C++14 | 1 ms | 344 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;
typedef long long ll;
#include "swaps.h"
//#include "grader.cpp"
void solve(int n, int v) {
vector<vector<pair<int,int>>> ans(n*2);
vector<pair<int,int>> cnt(n);
for(int i=0;i<n;i++) cnt[i] = {0,i};
int idx = 0;
for(int i=1;i<=n;i++){
int idxx = idx;
for(int j=i+1;j<=n;j++){
ans[idxx].push_back({i,j});
idxx ++;
}
idx += 2;
}
for(int i=0;i<n*2;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].first ++;
else cnt[a].first ++;
}
}
sort(cnt.begin(),cnt.end());
vector<int> anss;
for(auto [_,i] : cnt) anss.push_back(i);
answer(anss);
}
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... |
# | 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... |
# | 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... |