제출 #433329

#제출 시각아이디문제언어결과실행 시간메모리
433329pliam저울 (IOI15_scales)C++14
0 / 100
1 ms424 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; int known[7]; void init(int T) { /* ... */ } int find_max(){ vector<int> unknown; for(int i=1;i<=6;i++){ if(!known[i]){ unknown.push_back(i); } } int ans1=getHeaviest(unknown[0],unknown[1],unknown[2]); int ans2=getHeaviest(unknown[unknown.size()-1],unknown[unknown.size()-2],unknown[unknown.size()-3]); for(auto x:unknown){ if(x!=ans1&&x!=ans2){ return getHeaviest(x,ans1,ans2); } } } void orderCoins() { /* ... */ int* W = new int[6]; memset(known,0,sizeof(known)); W[5]=find_max(); known[W[5]]=true; W[4]=find_max(); known[W[4]]=true; W[3]=find_max(); known[W[3]]=true; vector<int> last; for(int i=1;i<=6;i++){ if(!known[i]) last.push_back(i); } W[0]=getLightest(last[0],last[1],last[2]); W[1]=getMedian(last[0],last[1],last[2]); W[2]=getHeaviest(last[0],last[1],last[2]); answer(W); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:7:15: warning: unused parameter 'T' [-Wunused-parameter]
    7 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'int find_max()':
scales.cpp:12:17: warning: control reaches end of non-void function [-Wreturn-type]
   12 |     vector<int> unknown;
      |                 ^~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...