# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
140153 | PedroBigMan | 저울 (IOI15_scales) | C++14 | 2 ms | 380 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "scales.h"
#include <iostream>
#include <vector>
#include <cmath>
#include <algorithm>
#include <string>
using namespace std;
typedef int ll;
typedef unsigned long long int ull;
typedef long double ld;
#define REP(i,a,b) for(ll i=a; i<b; i++)
#define pb push_back
#define mp make_pair
#define pl pair<ll,ll>
#define ff first
#define ss second
#define INF ((ll) pow(2,63) -1)
#define gH getHeaviest
#define gL getLightest
#define gM getMedian
#define gNL getNextLightest
ll insig;
#define In(vecBRO, LENBRO) REP(IBRO,0,LENBRO) {cin>>insig; vecBRO.pb(insig);}
void Out(vector<ll> x) {REP(i,0,x.size()) {cout<<x[i]<<" ";} cout<<endl;}
ll Q;
/*void answer(ll x[])
{
REP(i,0,6) {cout<<x[i]<<" ";}
cout<<endl;
}
ll gH(ll x,ll y,ll z)
{
cout<<"gH "<<x<<" "<<y<<" "<<z<<" "<<endl;
ll answ; cin>>answ; return answ;
}
ll gL(ll x,ll y,ll z)
{
cout<<"gL "<<x<<" "<<y<<" "<<z<<" "<<endl;
ll answ; cin>>answ; return answ;
}
ll gM(ll x,ll y,ll z)
{
cout<<"gM "<<x<<" "<<y<<" "<<z<<" "<<endl;
ll answ; cin>>answ; return answ;
}
ll gNL(ll x,ll y,ll z)
{
cout<<"gNL "<<x<<" "<<y<<" "<<z<<" "<<endl;
ll answ; cin>>answ; return answ;
}*/
void init(int T)
{
}
void orderCoins()
{
vector<ll> t1, t2; REP(i,0,3) {t1.pb(0); t2.pb(0);}
ll q1,q2;
q1 = gH(1,2,3); q2 = gL(1,2,3);
t1[0]=q2; t1[2]=q1;
REP(i,1,4)
{
if(q1!=i && q2!=i) {t1[1]=i;}
}
ll q3, q4;
q3 = gH(4,5,6); q4 = gL(4,5,6);
t2[0]=q4; t2[2]=q3;
REP(i,4,7)
{
if(q3!=i && q4!=i) {t2[1]=i;}
}
ll q5 = gH(t1[2],t2[1],t2[2]); ll q6, q7,q8;
ll ans[6];
if(q5 == t1[2])
{
vector<ll> r1=t1; vector<ll> r2=t2;
REP(i,0,3) {t1[i]=r2[i]; t2[i]=r1[i];}
ans[5]=t2[2];
q6 = gM(t1[2],t2[0],t2[1]);
if(q6==t1[2])
{
ans[4]=t2[1]; ans[3]=t1[2];
q7=gM(t1[0],t1[1],t2[0]);
if(q7==t1[0])
{
ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t1[1];
}
else if(q7==t1[1])
{
ans[0]=t1[0]; ans[1]=t1[1]; ans[2]=t2[0];
}
else if(q7==t2[0])
{
ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t1[1];
}
q8=gM(1,2,3);
answer(ans);
}
else if(q6==t2[0])
{
ans[4]=t2[1]; ans[3]=t2[0]; ans[2]=t1[2]; ans[1]=t1[1]; ans[0]=t1[0];
q7 = gM(1,2,3); q8=gM(1,2,3);
answer(ans);
}
else if(q6==t2[1])
{
ans[4]=t1[2];
q7=gM(t1[0],t1[1],t2[0]);
q8=gM(t1[0],t1[1],t2[1]);
if(q7==t1[0] && q8==t1[0])
{
ans[0]=t2[0]; ans[1]=t2[1]; ans[2]=t1[0]; ans[3]=t1[1];
}
else if(q7==t1[0] && q8==t1[1])
{
ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t1[1]; ans[3]=t2[1];
}
else if(q7==t1[0] && q8==t2[1])
{
ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t2[1]; ans[3]=t1[1];
}
else if(q7==t1[1] && q8==t1[1])
{
ans[0]=t1[0]; ans[1]=t1[1]; ans[2]=t2[0]; ans[3]=t2[1];
}
else if(q7==t2[0] && q8==t1[1])
{
ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t1[1]; ans[3]=t2[1];
}
else if(q7==t2[0] && q8==t2[1])
{
ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t2[1]; ans[3]=t1[1];
}
answer(ans);
}
}
else if(q5 == t2[2])
{
ans[5]=t2[2];
q6 = gM(t1[2],t2[0],t2[1]);
if(q6==t1[2])
{
ans[4]=t2[1]; ans[3]=t1[2];
q7=gM(t1[0],t1[1],t2[0]);
if(q7==t1[0])
{
ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t1[1];
}
else if(q7==t1[1])
{
ans[0]=t1[0]; ans[1]=t1[1]; ans[2]=t2[0];
}
else if(q7==t2[0])
{
ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t1[1];
}
q8=gM(1,2,3);
answer(ans);
}
else if(q6==t2[0])
{
ans[4]=t2[1]; ans[3]=t2[0]; ans[2]=t1[2]; ans[1]=t1[1]; ans[0]=t1[0];
q7 = gM(1,2,3); q8=gM(1,2,3);
answer(ans);
}
else if(q6==t2[1])
{
ans[4]=t1[2];
q7=gM(t1[0],t1[1],t2[0]);
q8=gM(t1[0],t1[1],t2[1]);
if(q7==t1[0] && q8==t1[0])
{
ans[0]=t2[0]; ans[1]=t2[1]; ans[2]=t1[0]; ans[3]=t1[1];
}
else if(q7==t1[0] && q8==t1[1])
{
ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t1[1]; ans[3]=t2[1];
}
else if(q7==t1[0] && q8==t2[1])
{
ans[0]=t2[0]; ans[1]=t1[0]; ans[2]=t2[1]; ans[3]=t1[1];
}
else if(q7==t1[1] && q8==t1[1])
{
ans[0]=t1[0]; ans[1]=t1[1]; ans[2]=t2[0]; ans[3]=t2[1];
}
else if(q7==t2[0] && q8==t1[1])
{
ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t1[1]; ans[3]=t2[1];
}
else if(q7==t2[0] && q8==t2[1])
{
ans[0]=t1[0]; ans[1]=t2[0]; ans[2]=t2[1]; ans[3]=t1[1];
}
answer(ans);
}
}
return ;
}
/*int main()
{
vector<ll> coins; In(coins,6);
orderCoins();
return 0;
}*/
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |