제출 #396994

#제출 시각아이디문제언어결과실행 시간메모리
396994Andyvanh1저울 (IOI15_scales)C++14
컴파일 에러
0 ms0 KiB
#include <iostream> #include <vector> #include <algorithm> #include <set> using namespace std; typedef long long ll; typedef vector<int> vi; #define vt vector void orderCoins(){ vi arr1(3); vi arr2(3); int x = getHeaviest(1,2,3); if(x==3){ arr1[2] = 3; }else if(x==2){ arr1[2] = 2; }else{ arr1[2] = 1; } int y = getLightest(1,2,3); if(y==3){ arr1[0] = 3; }else if(y==2){ arr1[0] = 2; }else{ arr1[0] = 1; } arr1[1] = 6-arr1[0]-arr1[2]; x = getHeaviest(4,5,6); if(x==4){ arr2[2] = 4; }else if(x==5){ arr2[2] = 5; }else{ arr2[2] = 6; } y = getLightest(4,5,6); if(y==4){ arr2[0] = 4; }else if(y==5){ arr2[0] = 5; }else{ arr2[0] = 6; } arr2[1] = 15-arr2[0]-arr2[2]; x = getHeaviest(arr1[0],arr1[2],arr2[2]); vi ans(6); for(int i = 0; i< 6; i++){ ans[i] =-1; } if(x==arr2[2]) { swap(arr1, arr2); } x = getNextLightest(arr1[0],arr1[1],arr1[2],arr2[0]); if(x==arr1[0]){ ans[arr2[0]-1]=0; }else if(x==arr1[1]){ ans[arr2[0]-1]=1; }else{ ans[arr2[0]-1]=2; } x = getNextLightest(arr1[0],arr1[1],arr1[2],arr2[1]); if(x==arr1[0]){ ans[arr2[1]-1]=1; }else if(x==arr1[1]){ ans[arr2[1]-1]=2; }else{ ans[arr2[1]-1]=3; } x = getNextLightest(arr1[0],arr1[1],arr1[2],arr2[2]); if(x==arr1[0]){ ans[arr2[2]-1]=2; }else if(x==arr1[1]){ ans[arr2[2]-1]=3; }else{ ans[arr2[2]-1]=4; } set<int> vals; for(int i = 0; i < 6; i++){ vals.insert(i); } for(int i = 0; i < 3; i++){ vals.erase(vals.find(ans[arr2[i]-1])); } int index = 0; for(auto it = vals.begin();it!=vals.end(); it++ ){ ans[arr1[index]-1] = *it; index++; } int reans[6]; for(int i = 0; i < 6; i++){ reans[ans[i]]=i; } answer(reans); return; } void init(int T){ }

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

scales.cpp: In function 'void orderCoins()':
scales.cpp:18:13: error: 'getHeaviest' was not declared in this scope
   18 |     int x = getHeaviest(1,2,3);
      |             ^~~~~~~~~~~
scales.cpp:26:13: error: 'getLightest' was not declared in this scope
   26 |     int y = getLightest(1,2,3);
      |             ^~~~~~~~~~~
scales.cpp:61:13: error: 'getNextLightest' was not declared in this scope
   61 |         x = getNextLightest(arr1[0],arr1[1],arr1[2],arr2[0]);
      |             ^~~~~~~~~~~~~~~
scales.cpp:111:9: error: 'answer' was not declared in this scope
  111 |         answer(reans);
      |         ^~~~~~
scales.cpp: In function 'void init(int)':
scales.cpp:119:15: warning: unused parameter 'T' [-Wunused-parameter]
  119 | void init(int T){
      |           ~~~~^