제출 #1033210

#제출 시각아이디문제언어결과실행 시간메모리
1033210nvujica저울 (IOI15_scales)C++14
0 / 100
1 ms440 KiB
#include <bits/stdc++.h> #include "scales.h" #define ll long long #define fi first #define se second using namespace std; const int maxn = 1e5 + 10; //vector <vector<int> > v; // //int MIN(int a, int b, int c){ // return min(min(a, b), c); //} // //int MAX(int a, int b, int c){ // return max(max(a, b), c); //} // //int MID(int a, int b, int c){ // return a + b + c - MIN(a, b, c) - MAX(a, b, c); //} //int getMedian(int A, int B, int C){ // cout << "mid " << A << ' ' << B << ' ' << C << endl; // int odg; // cin >> odg; // return odg; //} //int getHeaviest(int A, int B, int C){ // cout << "max " << A << ' ' << B << ' ' << C << endl; // int odg; // cin >> odg; // return odg; //} //int getLightest(int A, int B, int C){ // cout << "min " << A << ' ' << B << ' ' << C << endl; // int odg; // cin >> odg; // return odg; //} //int getNextLightest(int A, int B, int C, int D){ // cout << "next " << A << ' ' << B << ' ' << C << ' ' << D << endl; // int odg; // cin >> odg; // return odg; //} void init(int T){ } void orderCoins(){ // vector <int> p; // for(int i = 1; i <= 6; i++){ // p.push_back(i); // } // // do{ // v.push_back(p); // }while(next_permutation(p.begin(), p.end())); int min123 = getLightest(1, 2, 3); int mid123 = getMedian(1, 2, 3); int max123 = 6 - min123 - mid123; int min456 = getLightest(4, 5, 6); int mid456 = getMedian(4, 5, 6); int max456 = 15 - min456 - mid456; vector <int> a[5]; int poz[7]; poz[min123] = 1; poz[mid123] = 2; poz[max123] = 3; int arr[7]; arr[1] = min123; arr[2] = mid123; arr[3] = max123; a[poz[getNextLightest(min123, mid123, max123, min456)]].push_back(min456); a[poz[getNextLightest(min123, mid123, max123, mid456)]].push_back(mid456); a[poz[getNextLightest(min123, mid123, max123, max456)]].push_back(max456); if(getLightest(min123, min456, mid123) == min123) swap(a[1], a[4]); int w[6], w2[6]; int cnt = 0; for(int i = 1; i <= 4; i++){ for(int j = 0; j < a[i].size(); j++){ w[cnt++] = a[i][j]; } if(i < 4) w[cnt++] = arr[i]; } // for(int i = 0; i < 6; i++){ // w2[w[i] - 1] = i + 1; // } // for(int i = 0; i < 6; i++){ // cout << w[i] << ' '; // } // cout << endl; answer(w); } //int main(){ // orderCoins(); //}

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

scales.cpp: In function 'void init(int)':
scales.cpp:51:15: warning: unused parameter 'T' [-Wunused-parameter]
   51 | void init(int T){
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:92:20: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   92 |   for(int j = 0; j < a[i].size(); j++){
      |                  ~~^~~~~~~~~~~~~
scales.cpp:88:12: warning: unused variable 'w2' [-Wunused-variable]
   88 |  int w[6], w2[6];
      |            ^~
#Verdict Execution timeMemoryGrader output
Fetching results...