# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
821288 | vjudge1 | Ancient Books (IOI17_books) | C++14 | 74 ms | 284 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>
#include "books.h"
#define fi first
#define se second
#define ll long long
using namespace std ;
ll ans = 1e18 ;
int sz ;
vector<int> now ;
bool check()
{
vector<int> gr = now ;
sort(gr.begin(), gr.end()) ;
return (now == gr) ;
}
void rec(int ind, int cnt, int sum, int with)
{
if(with == -1 && check())
{
ans = min(ans, (ll)sum + ind) ;
return ;
}
if(cnt == 16)
return ;
if(with != -1)
{
swap(now[ind], with) ;
rec(ind, cnt + 1, sum, with) ;
swap(now[ind], with) ;
}
# | 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... |