Submission #955669

#TimeUsernameProblemLanguageResultExecution timeMemory
955669IUA_HasinArranging Shoes (IOI19_shoes)C++17
45 / 100
19 ms3416 KiB
#include <bits/stdc++.h> #define endl "\n" #define finp for(int i=0; i<n; i++) #define fknp for(int k=0; k<n; k++) #define yeap cout<<"YES"<<endl #define nope cout<<"NO"<<endl #define inpintn int n; cin>>n #define inpintarrn int arr[n]; for(int i=0; i<n; i++){cin>>arr[i];} #define inpllarrn long long arr[n]; for(int i=0; i<n; i++){cin>>arr[i];} #define ll long long using namespace std; #include "shoes.h" long long count_swaps(std::vector<int> s) { ll n = s.size(); ll ind = 0; ll ans = 0; for(int i=0; i<n; i++){ if(s[i]<0){ ll dist = abs(i-ind); ans = ans+dist; ind = ind+2; } } return ans; }
#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...