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;
#define ll long long
//#define int long long
#define pb push_back
#define pob pop_back
//#define pb push
#define endl '\n'
#define ld long double
/*#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops,avx,avx2,ssse3,tune-native")*/
#define applejuice ios::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);
const ll mod=1e9+7;
const ll inf=1e18;
const ll mxsz=204;
const ld pi=acos(-1.0);
ll count_swaps(vector<int>s){
int n=s.size()/2;
/*cout<<n<<endl;
for (auto x:s)cout<<x<<" ";*/
if (n==1){
if (s[0]<0)return 0;
else return 1;
}
return (ll)n*(n-1)/2;
}
/*4
-2 -1 -3 -2 2 1 3 2*/
/*
signed main(){
applejuice;
int n;
cin>>n;
vector<int>a(2*n);
for (int i=0;i<2*n-1;i++){
cin>>a[i];
}
cout<<count_swaps(a)<<endl;
return 0;
}*/
# | 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... |