제출 #1275268

#제출 시각아이디문제언어결과실행 시간메모리
1275268rafsanamin2020Arranging Shoes (IOI19_shoes)C++20
15 / 100
13 ms1964 KiB
#include <bits/stdc++.h> #include "shoes.h" using namespace std; // long long count_swaps(std::vector<int> s) // { // int N = s.size(), p = 0, n = 0; // queue<int> neg; // queue<int> pos; // int swp = 0; // for (int i = 0; i < N; i += 2) // { // if (s[i + (neg.size() % 2)] > 0) // { // neg.push(i); // } // if (s[i + 1 - (neg.size() % 2)] < 0) // { // } // } // return std::max(p, n); // } long long count_swaps(std::vector<int> s) { long long N = s.size() / 2; 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...