| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 800597 | firewater | 저울 (IOI15_scales) | C++14 | 1 ms | 468 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "scales.h"
#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#define ll long long
using namespace std;
// int getHeaviest(int A, int B, int C) 
// int getMedian(int A, int B, int C) 
// int getLightest(int A, int B, int C) 
// int getNextLightest(int A, int B, int C, int D) 
#define N 100
int w,a[N],b[N],v[N],p[N],ans[6];
void init(int T) {
    /* ... */
}
void orderCoins() {
    /* ... */
    a[1]=getLightest(1,2,3);
    a[2]=getMedian(1,2,3);
    a[3]=6-a[1]-a[2];
    a[4]=getLightest(4,5,6);
    a[5]=getMedian(4,5,6);
    a[6]=15-a[4]-a[5];
    for(int i=1;i<=6;++i)
        v[a[i]]=i;
    if(getLightest(a[1],a[2],a[4])==a[4]){
        ans[0]=a[4];
        ans[1]=getLightest(a[1],a[5],a[6]);
    }
    else{
        ans[0]=a[1];
        ans[1]=getLightest(a[2],a[3],a[4]);
    }
    if(getHeaviest(a[3],a[5],a[6])==a[3]){
        ans[5]=a[3];
        ans[4]=getHeaviest(a[1],a[2],a[6]);
    }
    else{
        ans[5]=a[6];
        ans[4]=getHeaviest(a[3],a[4],a[5]);
    }
    
    p[ans[0]]=p[ans[1]]=p[ans[4]]=p[ans[5]]=1;
    w=0;
    for(int i=1;i<=6;++i)
        if(!p[i])
            b[++w]=i;
    if((b[1]<=3)==(b[2]<=3)){
        if(v[b[1]]<v[b[2]])ans[2]=b[1],ans[3]=b[2];
        else ans[2]=b[2],ans[3]=b[1];
    }
    else{
        ans[2]=getLightest(b[1],b[2],ans[5]);
        ans[3]=b[1]+b[2]-ans[2];
    }
    answer(ans);
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
