# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
143087 | 2019-08-13T01:11:01 Z | daniel920712 | Arranging Shoes (IOI19_shoes) | C++14 | 31 ms | 2012 KB |
#include <iostream> #include <stdio.h> #include <vector> using namespace std; long long count_swaps(std::vector<int> S) { long long ans=0,N=S.size(),i,j,k; int t; /*for(i=0;i<N/2;i++) { for(j=2*i;j<N;j++) { if(S[j]<0) { ans+=(j-2*i); t=0-S[j]; for(k=j;k>2*i;k--) swap(S[k],S[k-1]); break; } } for(j=2*i+1;j<N;j++) { if(S[j]==t) { ans+=(j-2*i-1); t=0-S[j]; for(k=j;k>2*i+1;k--) swap(S[k],S[k-1]); break; } } }*/ ans=(N/2)*(N/2-1)/2; return ans; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 31 ms | 1932 KB | Output is correct |
6 | Correct | 31 ms | 1912 KB | Output is correct |
7 | Correct | 31 ms | 1912 KB | Output is correct |
8 | Correct | 30 ms | 2012 KB | Output is correct |
9 | Correct | 31 ms | 1912 KB | Output is correct |
10 | Correct | 31 ms | 1912 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 348 KB | Output is correct |
2 | Incorrect | 2 ms | 256 KB | Output isn't correct |