답안 #136805

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
136805 2019-07-26T09:53:20 Z Nucleist 저울 (IOI15_scales) C++14
0 / 100
4 ms 632 KB
#include "scales.h"
#include <bits/stdc++.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
void init(int T)
{
	for (int i = 0; i < T; ++i)
	{
		orderCoins();
	}
}
void orderCoins()
{
  int tab[6];
  bool tabi[6];
  int v = getLightest(0,1,2);
  int yo = getLightest(v,3,4);
  tabi[v]=true;tabi[yo]=true;
  int last=0;
  for (int i = 0; i < 6; ++i)
  {
  	if(!tabi[v]){last=i;break;}
  }
  int no = getLightest(last,yo,5);
  tab[no]=1;
  memset(tabi,0,sizeof tabi);
  tabi[no]=1;
  vector<int>now;
  for (int i = 0; i < 6; ++i)
  {
  	if(tabi[i]==0)now.pb(i);
  }
  int dol = getNextLightest(no,now[0],now[1],now[2]);
  int fol = getNextLightest(no,now[2],now[3],now[4]);
  for (int i = 0; i < 5; ++i)
  {
  	if(now[i]!=fol && now[i]!=dol){last=now[i];break;}
  }
  int ka;
  if(fol==dol){ka=fol;debug(fol);}
  else {
  	ka = getLightest(last,fol,dol);
  }
  tab[ka]=2;
  now.clear();
  for (int i = 0; i < 6; ++i)
  {
  	if(i!=ka && i!=no)now.pb(i);
  }
  int hi = getNextLightest(ka,now[0],now[1],now[2]);
  int fi = getNextLightest(ka,now[1],now[2],now[3]);
  for (int i = 0; i < 4; ++i)
  {
  	if(now[i]!=hi && now[i]!=fi){last=now[i];break;}
  }
  int doli;
  if(hi==fi)doli=hi;
  else
  {
  	doli = getLightest(last,hi,fi);
  }
  tab[doli]=3;
  now.clear();
  for (int i = 0; i < 6; ++i)
  {
  	if(i!=no && i!=doli && i!=ka)now.pb(i);
  }
  int nexti = getNextLightest(doli,now[0],now[1],now[2]);
  tab[nexti]=4;
  now.clear();
  for (int i = 0; i < 6; ++i)
  {
  	if(i!=no && i!=doli && i!=ka && i!=nexti)now.pb(i);
  }
  int nexta = getHeaviest(nexti,now[0],now[1]);
  if(nexta==now[0])
  {
  	tab[now[1]]=5;tab[now[0]]=6;
  }
  else {
  	tab[now[0]]=5;tab[now[1]]=6;}
  answer(tab);
  return ;
}
//code the AC sol !
// BS/queue/map
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
3 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
4 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
5 Runtime error 4 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
6 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
7 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
8 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
9 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
10 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
11 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
12 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
13 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
14 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
15 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
16 Runtime error 2 ms 632 KB Execution killed with signal 11 (could be triggered by violating memory limits)
17 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
18 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
19 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
20 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
21 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
22 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
23 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
24 Runtime error 2 ms 552 KB Execution killed with signal 11 (could be triggered by violating memory limits)
25 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
26 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
27 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
28 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
29 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
30 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
31 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
32 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
33 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
34 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
35 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
36 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
37 Runtime error 3 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
38 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
39 Runtime error 2 ms 376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
40 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)