제출 #1311369

#제출 시각아이디문제언어결과실행 시간메모리
1311369aleksandreArranging Shoes (IOI19_shoes)C++20
0 / 100
1 ms336 KiB
#include "shoes.h"
long long count_swaps(std::vector<int> s) {
	long long swaps = 0;
	int n = s.size();
	for (int i = 0; i < n; i++) {
		if (s[i] < 0) {
			for (int j = i + 1; j < n; j++) {
				if (s[j] > 0) {
					std::swap(s[i], s[j]);
					swaps++;
					break;
				}
			}
		}
	}
	return swaps;
}
#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...