Submission #1070555

#TimeUsernameProblemLanguageResultExecution timeMemory
1070555kiethm07Arranging Shoes (IOI19_shoes)C++14
50 / 100
1068 ms3292 KiB
#include <bits/stdc++.h> #define pii pair<int,int> #define iii pair<int,pii> #define fi first #define se second #define vi vector<int> #define vii vector<pii> #define pb(i) push_back(i) #define all(x) x.begin(),x.end() #define TEXT "a" using namespace std; typedef long long ll; typedef unsigned long long ull; typedef long double ld; const int inf = 1e9 + 7; const ld eps = 1e-8; const double pi = acos(-1); ll count_swaps(vector<int> a){ int n = a.size(); ll res = 0; for (int i = 0; i < n; i += 2){ int p; for (p = i + 1; p < n; p++){ if (a[p] == -a[i]) break; } for (int j = p - 1; j > i; j--){ swap(a[j], a[j + 1]); res++; } if (a[i] > 0){ swap(a[i],a[i + 1]); res++; } } return res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...