# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
143916 | Nucleist | Arranging Shoes (IOI19_shoes) | C++14 | 1083 ms | 1932 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#include "shoes.h"
using namespace std;
#define flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define debug(x) cerr << " - " << #x << ": " << x << endl;
#define debugs(x, y) cerr << " - " << #x << ": " << x << " " << #y << ": " << y << endl;
#define all(x) (x).begin(),(x).end()
#define sz(x) (ll)x.size()
#define ll long long
#define INF 1000000000
#define pb push_back
struct greateri
{
template<class T>
bool operator()(T const &a, T const &b) const { return a > b; }
};
ll count_swaps(vector<int>gg)
{
//flash;
ll ans=0;
ll index=0;
for (ll i = 0; i < gg.size(); i+=2)
{
for (ll j = i; j < gg.size(); ++j)
{
if(gg[j]<0)
{
//debugs(j,i);
ll newi=j;
while(gg[i]>0)
{
ll k = gg[newi-1];
gg[newi-1]=gg[newi];
gg[newi]=k;
newi--;
ans++;
}
break;
}
}
for (ll j = i+1; j < gg.size(); ++j)
{
if(gg[j]==(-gg[i]))
{
ll nexi=j;
while(gg[i+1]!=(-gg[i]))
{
ll k = gg[nexi-1];
gg[nexi-1]=gg[nexi];
gg[nexi]=k;
nexi--;
ans++;
}
break;
}
}
}
return ans;
}
//code the AC sol !
// BS/queue/map
컴파일 시 표준 에러 (stderr) 메시지
# | 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... |