제출 #542992

#제출 시각아이디문제언어결과실행 시간메모리
542992Mohammed_AtalahArranging Shoes (IOI19_shoes)C++17
0 / 100
0 ms212 KiB
#include "shoes.h" #include <bits/stdc++.h> using namespace std; long long count_swaps(std::vector<int> s) { int n = s.size(); // map<int, set<int>> mp; // for (int i = 0; i < n; i++) { // mp[s[i]].insert(i); // } // vector<int> vis(n); // int e = 0; // int total = 0; // for (int i = 0; i < n; i++) { // cout << total << endl; // if (vis[i - 1] && i > 0) { // e--; // } // if (vis[i]) { // continue; // } // mp[s[i]].erase(mp[s[i]].begin()); // int idx = *mp[s[i] * -1].begin(); // mp[s[i] * -1].erase(mp[s[i] * -1].begin()); // total += idx - (i + e) - 1; // if (s[i] > 0) { // total++; // } // e++; // vis[idx] = 1; // } // return total; n--; return (n * (n + 1)) / 2 ; }
#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...