This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
/*
* Author : shora
*/
#include "shoes.h"
#include <bits/stdc++.h>
#define print(_v) for (auto &_ : _v) {cerr << _ << ' ';} cerr << endl;
using namespace std;
using ll = long long;
const int oo = 1e9;
ll n;
namespace task_2 {
ll solve(vector<int>& a) {
return 2;
}
}
namespace task_3 {
bool check(vector<int>& a) {
for (int i = 0; i < n; ++i)
if (a[i] > 0 || a[i] != -a[i+n])
return 0;
return 1;
}
}
long long count_swaps(std::vector<int> a) {
n = a.size() / 2;
return n * (n-1) / 2;
if (n == 1) return a[0] < 0;
if (task_3::check(a)) return n * (n-1);
if (n <= 8) return task_2::solve(a);
return -1;
}
# | 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... |