제출 #1017886

#제출 시각아이디문제언어결과실행 시간메모리
1017886amirhoseinfar1385저울 (IOI15_scales)C++17
0 / 100
1 ms424 KiB
#include "scales.h" #include<bits/stdc++.h> using namespace std; vector<int>ret; void init(int T) { /* ... */ ret.resize(7); } void jab(int u,int ind){ for(int i=1;i<=6;i++){ if(ret[i]==u){ swap(ret[i],ret[ind]); return ; } } } void ghabl(int u,int v){ vector<int>fake; fake.push_back(0); for(int i=1;i<=6;i++){ if(ret[i]==u){ continue; } if(ret[i]==v){ fake.push_back(u); } fake.push_back(ret[i]); } ret=fake; } void orderCoins() { /* ... */ int res[] = {1, 2, 3, 4, 5, 6}; for(int i=1;i<=6;i++){ ret[i]=i; } int h1=getHeaviest(1,2,3); int l1=getLightest(1,2,3); int h2=getHeaviest(4,5,6); int l2=getLightest(4,5,6); jab(h1,3); jab(l1,1); jab(h2,6); jab(l2,4); int r=6; int wh=7,tof=-1; while(r>=4){ int z=getMedian(ret[2],ret[3],ret[r]); if(z==ret[r]){ wh=r; tof=ret[3]; break; } wh--; r--; } for(int i=4;i<=wh-1;i++){ int z=getNextLightest(1,2,3,ret[i]); ghabl(ret[i],z); } if(tof!=-1){ ghabl(wh,tof); } for(int i=0;i<6;i++){ res[i]=ret[i+1]; } answer(res); }

컴파일 시 표준 에러 (stderr) 메시지

scales.cpp: In function 'void init(int)':
scales.cpp:6:15: warning: unused parameter 'T' [-Wunused-parameter]
    6 | void init(int T) {
      |           ~~~~^
#Verdict Execution timeMemoryGrader output
Fetching results...