| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 985548 | LucaIlie | Arranging Shoes (IOI19_shoes) | C++17 | 22 ms | 5712 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "shoes.h"
using namespace std;
#define nmax 100000
int v[nmax];
int n;
int find_pair( int l ) {
int i;
if( v[l] < 0 ) {
for( i = l + 1; i < n; i++ ) {
if( v[i] + v[l] == 0 )
break;
}
swap( v[l + 1], v[i] );
return i - l - 1;
} else {
for( i = l + 1; i < n; i++ ) {
if( v[i] + v[l] == 0 )
break;
}
swap( v[l + 1], v[i] );
return i - l;
}
}
long long count_swaps( vector<int> s) {
int i, l, rez = 0;
n = s.size();
for( i = 0; i < n; i++ )
v[i] = s[i];
for( l = 0; l < n; l += 2 ) {
rez += find_pair( l );
}
return rez;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
