# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
73054 | MKopchev | 저울 (IOI15_scales) | C++14 | 1123 ms | 525312 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
#include "scales.h"
using namespace std;
void init(int T)
{
srand(time(0));
}
vector< vector<int> > possible,help;
vector<int> all;
void orderCoins()
{
for(int i=0;i<6;i++)
all.push_back(i+1);
do
{
possible.push_back(all);
}
while(next_permutation(all.begin(),all.end()));
while(possible.size()>1)
{
int a=rand()%6,b=rand()%6,c=rand()%6;
if(a==b||b==c||c==a)continue;
if(rand()%2)
{
int ans=getHeaviest(a+1,b+1,c+1);
ans--;
help={};
for(auto k:possible)
{
if(ans==a&&k[a]>k[b]&&k[a]>k[c])help.push_back(k);
if(ans==b&&k[b]>k[c]&&k[b]>k[a])help.push_back(k);
if(ans==c&&k[c]>k[a]&&k[c]>k[b])help.push_back(k);
}
possible=help;
}
else
{
int ans=getLightest(a+1,b+1,c+1);
ans--;
help={};
for(auto k:possible)
{
if(ans==a&&k[a]<k[b]&&k[a]<k[c])help.push_back(k);
if(ans==b&&k[b]<k[c]&&k[b]<k[a])help.push_back(k);
if(ans==c&&k[c]<k[a]&&k[c]<k[b])help.push_back(k);
}
possible=help;
}
}
int W[6]={possible[0][0],possible[0][1],possible[0][2],possible[0][3],possible[0][4],possible[0][5]};
answer(W);
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |