제출 #1147988

#제출 시각아이디문제언어결과실행 시간메모리
1147988alexddScales (IOI15_scales)C++20
0 / 100
0 ms320 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; void init(int T) { } vector<int> scoate(vector<int> v, int val) { vector<int> newv; for(int x:v) if(x!=val) newv.push_back(x); return newv; } void pune(int newsol[], int sol[], int poz) { for(int i=0;i<6;i++) { newsol[i] = sol[poz]; poz++; if(poz==6) poz=0; } } void strong(bool bl) { if(!bl)while(1); } void orderCoins() { int sol[6],newsol[6]; vector<int> ramase = {1,2,3,4,5,6}; sol[0] = 1; ramase = scoate(ramase, sol[0]); int x = getNextLightest(ramase[0],ramase[1],ramase[2],sol[0]); x = getNextLightest(x,ramase[3],ramase[4],sol[0]); sol[1] = x; ramase = scoate(ramase, sol[1]); x = getNextLightest(ramase[0],ramase[1],ramase[2],sol[1]); x = getNextLightest(x,ramase[3],sol[0],sol[1]); strong(x!=sol[0]); sol[2] = x; ramase = scoate(ramase, sol[2]); x = getNextLightest(ramase[0],ramase[1],ramase[2],sol[2]); sol[3] = x; ramase = scoate(ramase, sol[3]); x = getNextLightest(ramase[0],ramase[1],sol[2],sol[3]); strong(x!=sol[2]); sol[4] = x; ramase = scoate(ramase, sol[4]); strong((int)ramase.size()==1); sol[5] = ramase[0]; x = getLightest(sol[0],sol[1],sol[2]); if(x != sol[0]) { if(x == sol[1]) { pune(newsol,sol,1); } else { strong(x == sol[2]); pune(newsol,sol,2); } } else { x = getLightest(sol[3],sol[4],sol[5]); if(x == sol[3]) { for(int i=0;i<6;i++) newsol[i] = sol[i]; } else if(x == sol[4]) { pune(newsol,sol,4); } else { strong(x == sol[5]); pune(newsol,sol,5); } } //for(int i=0;i<6;i++) newsol[i] = i+1; answer(newsol); }
#Verdict Execution timeMemoryGrader output
Fetching results...