제출 #39900

#제출 시각아이디문제언어결과실행 시간메모리
39900mohammad_kilani저울 (IOI15_scales)C++14
45.45 / 100
0 ms2024 KiB
#include "scales.h" #include <bits/stdc++.h> using namespace std; void init(int T) { } vector <int> get(int a,int b,int c){ int cur1 = getLightest(a,b,c); int cur2 = getMedian(a,b,c); int cur3; if(a != cur1 && a != cur2) cur3 = a; if(b != cur1 && b != cur2) cur3 = b; if(c != cur1 && c != cur2) cur3 = c; vector<int> v; v.push_back(cur1); v.push_back(cur2); v.push_back(cur3); return v; } void orderCoins() { int val[7]; vector< int > v[2]; v[0] = get(1,2,3); v[1] = get(4,5,6); int idx = 0; int idx1 = 0 , idx2 = 0; int w[6]; while(idx < 3){ int a = getLightest(v[0][idx1],v[1][idx2],(idx1 == 2 ? v[1][idx2 + 1] : v[0][idx1 + 1])); w[idx++] = a; if(a == v[0][idx1]) idx1++; else idx2++; } vector<int> tmp; while(idx1 < v[0].size()) tmp.push_back(v[0][idx1++]); while(idx2 < v[1].size()) tmp.push_back(v[1][idx2++]); tmp = get(tmp[0],tmp[1],tmp[2]); for(int i=0;i<tmp.size();i++) w[idx++] = tmp[i]; answer(w); }

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

scales.cpp:6:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:41:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(idx1 < v[0].size()) tmp.push_back(v[0][idx1++]);
                ^
scales.cpp:42:16: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     while(idx2 < v[1].size()) tmp.push_back(v[1][idx2++]);
                ^
scales.cpp:44:18: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for(int i=0;i<tmp.size();i++) w[idx++] = tmp[i];
                  ^
scales.cpp:25:9: warning: unused variable 'val' [-Wunused-variable]
     int val[7];
         ^
#Verdict Execution timeMemoryGrader output
Fetching results...