# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
143105 | 2019-08-13T01:33:06 Z | daniel920712 | Arranging Shoes (IOI19_shoes) | C++14 | 2 ms | 376 KB |
#include <iostream> #include <stdio.h> #include <vector> using namespace std; long long count_swaps(std::vector<int> S) { vector<int> S1; long long ans1=0,ans2=0,N=S.size(),i,j,k; int t; for(i=0;i<N;i++) S1.push_back(S[i]); for(i=0;i<N/2;i++) { for(j=2*i;j<N;j++) { if(S[j]<0) { for(k=j;k>2*i;k--) { ans1++; swap(S[k],S[k-1]); } break; } } for(j=2*i+1;j<N;j++) { if(S[j]==t) { for(k=j;k>2*i+1;k--) { ans1++; swap(S[k],S[k-1]); } break; } } } return ans1; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 376 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 256 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 252 KB | Output is correct |
2 | Incorrect | 2 ms | 348 KB | Output isn't correct |
3 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 376 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 256 KB | Output is correct |
3 | Incorrect | 2 ms | 376 KB | Output isn't correct |
4 | Halted | 0 ms | 0 KB | - |