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 "messy.h"
#include <bits/stdc++.h>
typedef long long ll;
#define FOR(i,x,y) for(ll i=x; i<y; i++)
#define FORNEG(i,x,y) for(lli = x; i>y; i--)
using namespace std;
string sus(ll n, ll a, ll b){
string ans = "";
FOR(i,0,n){
if (i==a || i==b) ans += '1';
else ans += '0';
}
return ans;
}
map<string, bool> checked;
bool checks(string x){
if (checked.count(x)) return checked[x];
else return checked[x] = check_element(x);
}
std::vector<int> restore_permutation(int n, int w, int r) {
ll cur = n;
FOR(i,0,n){
if (cur > 0){
add_element(sus(n, i, i));
}
FOR(j,1,cur){
add_element(sus(n, i, i+j));
}
cur-=2;
}
compile_set();
vector<int> ans;
FOR(i,0,n){
ll temp = 0;
FOR(j,0,n){
temp += checks(sus(n, i, j));
}
ans.push_back(n-temp);
}
return ans;
}
# | 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... |