| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 120192 | pavel | Scales (IOI15_scales) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <vector>
#include <algorithm>
#include <cstdio>
#include "scales.h"
using namespace std;
void init(int T) {
/* ... */
}
vector<int> graph[10];
void orderCoins() {
int W[6], wi=0;
int a = getLightest(1, 2, 3);
for(int i=1;i<=3;++i) if(a!=i) graph[a].push_back(i);
int b = getLightest(4, 5, 6);
for(int i=4;i<=6;++i) if(b!=i) graph[b].push_back(i);
if(getLightest(a, graph[a][0], b)==b) swap(a,b);
W[wi++]=a;
int x=getLightest(b, graph[a][0], graph[a][1]);
W[wi++]=x;
if(x==b){
graph[a].insert(graph[a].end(), graph[b].begin(), graph[b].end());
}else{
graph[a].erase(find(graph[a].begin(), graph[a].end(), x));
x = getLightest(graph[a][0], b, graph[b][0]);
W[wi++]=x;
if(x!=b){
graph[a].erase
W[wi++]=b;
}
graph[a].insert
}
}
