제출 #364974

#제출 시각아이디문제언어결과실행 시간메모리
364974rocks03저울 (IOI15_scales)C++14
컴파일 에러
0 ms0 KiB
//#pragma GCC target("avx2") //#pragma GCC optimization("O3") //#pragma GCC optimization("unroll-loops") #include<bits/stdc++.h> using namespace std; #define ll long long #define pii pair<int, int> #define pll pair<ll, ll> #define ff first #define ss second #define pb push_back #define SZ(x) ((int)(x).size()) #define all(x) x.begin(), x.end() #define rep(i, a, b) for(int i = (a); i < (b); i++) #define Re(i, a, b) for(int i = (a); i >= (b); i--) int solution[6]; void init(int T){ } void answer(int []); void ordina3(int& x, int& y, int& z){ int c = getHeaviest(x, y, z); int a = getLightest(x, y, z); int b; int arr[] = {x, y, z}; for(int i = 0; i < 3; i++){ if(a != arr[i] && c != arr[i]) b = arr[i]; } x = a, y = b, z = c; } void orderCoins(){ for(int i = 0; i < 6; i++){ solution[i] = i + 1; } ordina3(solution[0], solution[1], solution[2]); ordina3(solution[3], solution[4], solution[5]); vector<int> my_ans; int l = 0, r = 3; while(1){ if(2 - l + 1 + 5 - r + 1 == 3){ for(int i = 0; i < 6; i++){ if(l <= i && i <= 2){ my_ans.pb(solution[i]); } if(r <= i && i <= 5){ my_ans.pb(solution[i]); } } ordina3(my_ans[3], my_ans[4], my_ans[5]); break; } if(l + 1 <= 2){ int x1 = solution[l], x2 = solution[l + 1], x3 = solution[r]; int x = getLightest(x1, x2, x3); if(x1 == x){ my_ans.pb(solution[l++]); } else if(x3 == x){ my_ans.pb(solution[r++]); } } else if(r + 1 <= 5){ int x1 = solution[l], x2 = solution[r], x3 = solution[r + 1]; int x = getLightest(x1, x2, x3); if(x1 == x){ my_ans.pb(solution[l++]); } else if(x2 == x){ my_ans.pb(solution[r++]); } } else assert(false); } for(int i = 0; i < 6; i++){ solution[i] = my_ans[i]; } answer(solution); }

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

scales.cpp: In function 'void init(int)':
scales.cpp:19:15: warning: unused parameter 'T' [-Wunused-parameter]
   19 | void init(int T){
      |           ~~~~^
scales.cpp: In function 'void ordina3(int&, int&, int&)':
scales.cpp:26:13: error: 'getHeaviest' was not declared in this scope
   26 |     int c = getHeaviest(x, y, z);
      |             ^~~~~~~~~~~
scales.cpp:27:13: error: 'getLightest' was not declared in this scope
   27 |     int a = getLightest(x, y, z);
      |             ^~~~~~~~~~~
scales.cpp: In function 'void orderCoins()':
scales.cpp:59:21: error: 'getLightest' was not declared in this scope
   59 |             int x = getLightest(x1, x2, x3);
      |                     ^~~~~~~~~~~
scales.cpp:67:21: error: 'getLightest' was not declared in this scope
   67 |             int x = getLightest(x1, x2, x3);
      |                     ^~~~~~~~~~~