제출 #290777

#제출 시각아이디문제언어결과실행 시간메모리
290777kshitij_sodani저울 (IOI15_scales)C++14
23.81 / 100
1 ms288 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; #define a first #define b second #define pb push_back void init(int T) { /* ... */ } void orderCoins() { /* ... */ vector<int> cur; int aa=1; int bb=2; int cc=3; cur.pb(getLightest(aa,bb,cc)); cur.pb(getMedian(aa,bb,cc)); for(int i=1;i<=3;i++){ if(i!=cur[0] and i!=cur[1]){ cur.pb(i); } } for(int i=4;i<=6;i++){ if(getLightest(i,cur[0],cur[1])==i){ reverse(cur.begin(),cur.end()); cur.pb(i); reverse(cur.begin(),cur.end()); } else{ int st=0; vector<int> cur2; for(int ii=0;ii<cur.size()-1;ii++){ if(getMedian(i,cur[ii],cur[ii+1])==i){ st=1; for(int j=0;j<=ii;j++){ cur2.pb(cur[j]); } cur2.pb(i); for(int j=ii+1;j<cur.size();j++){ cur2.pb(cur[j]); } //cur=cur2; //break; } } if(st==0){ cur.pb(i); } else{ cur=cur2; } } } int ww[6]; for(int i=0;i<6;i++){ ww[i]=cur[i]; } answer(ww); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:8:15: warning: unused parameter 'T' [-Wunused-parameter]
    8 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:35:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   35 |    for(int ii=0;ii<cur.size()-1;ii++){
      |                 ~~^~~~~~~~~~~~~
scales.cpp:42:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   42 |      for(int j=ii+1;j<cur.size();j++){
      |                     ~^~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...