제출 #923237

#제출 시각아이디문제언어결과실행 시간메모리
923237Roumak77Arranging Shoes (IOI19_shoes)C++17
10 / 100
1059 ms3164 KiB
#pragma GCC optimize ("O3") #pragma GCC optimize ("unroll-loops") #pragma GCC optimize("-Ofast") #include <bits/stdc++.h> #include <algorithm> #include <iostream> #include <vector> #include <limits> #include <cmath> #include <stack> #include <queue> #include <map> #include <math.h> using namespace std; using ll = long long; int64_t count_swaps(vector<int> shoes){ ll length = shoes.size(); vector<bool> list_n(length, 0); ll total = 0; for(int i = 0; i < length; i++){ if(list_n[i] == 1){ continue; } ll curr_counter = 0; ll curr_val = shoes[i]; if(curr_val > 0){ curr_val++; } for(int j = i + 1; j < length; j++){ if(shoes[j] == -curr_val){ list_n[j] = 1; break; }else{ if(list_n[j] == 0){ curr_counter++; } } } total += curr_counter; } return total; }
#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...