Submission #1088213

#TimeUsernameProblemLanguageResultExecution timeMemory
1088213browntoadScales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
// #include "scales.h"
using namespace std;
#define ll long long
// #define int ll
#define FOR(i, a, b) for (int i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define REP1(i, n) FOR(i, 1, n+1)
#define RREP(i, n) for (int i = (n)-1; i >= 0; i--)
#define pii pair<int, int>
#define f first
#define s second
#define pb push_back
#define ALL(x) (x).begin(), (x).end()
#define SZ(x) (int)((x).size())

const ll maxn = 1e5+5;

int tt;
void init(int T){
    tt = T;
}
void orderCoins(){
    vector<int> ww = {1, 2, 3, 4, 5, 6};
    random_shuffle(ALL(ww));

    int mnl = getLightest(ww[0], ww[1], ww[2]), mxl = getHeaviest(ww[0], ww[1], ww[2]);
    int mel;
    REP(i, 3) if (ww[i] != mnl && ww[i] != mxl) mel = ww[i];

    int mnr = getLightest(ww[3], ww[4], ww[5]), mxr = getHeaviest(ww[3], ww[4], ww[5]), mer;
    FOR(i, 3, 6) if (ww[i] != mnr && ww[i] != mxr) mer= ww[i];

    int t1 = getMedian(mnl, mxl, mnr);
    if (t1 == mxl){
        int fans[6] = {mnl, mel, mxl, mnr, mer, mxr};
        answer(fans);
        return;
    }
    int t2, t3, t4;
    if (t1 == mnr){
        t2 = getNextLightest(mnl, mnr, mxl, mxr);
        if (t2 == mnl){
            t3 = getNextLightest(mel, mxl, mer, mnr);
            if (t3 == mel){
                t4 = getMedian(mxl, mer, mxr);
                if (t4 == mer){
                    int fans[6] = {mnl, mnr, mel, mxl, mer, mxr};
                    answer(fans);
                }
                else{
                    int fans[6] = {mnl, mnr, mel, mer, mxl, mxr};
                    answer(fans);
                }
            }
            else if (t3 == mxl){
                int fans[6] = {mnl, mel, mnr, mxl, mer, mxr};
                answer(fans);
            }
            else {
                t4 = getMedian(mnl, mel, mnr);
                if (t4 == mel){
                    int fans[6] = {mnl, mel, mnr, mer, mxl, mxr};
                    answer(fans);
                }
                else{
                    int fans[6] = {mnl, mnr, mer, mel, mxl, mxr};
                    answer(fans);
                }
            }

        }
        else{
            t3 = getMedian(mnr, mel, mxr);
            if (t3 == mnr){
                int fans[6] = {mnl, mel, mnr, mer, mxr, mxl};
                answer(fans);
            }
            else if (t3 == mel){
                t4 = getMedian(mnr, mel, mer);
                if (t4 == mel){
                    int fans[6] = {mnl, mnr, mel, mer, mxr, mxl};
                    answer(fans);
                }
                else {
                    int fans[6] = {mnl, mnr, mer, mel, mxr, mxl};
                    answer(fans);
                }
            }
            else{
                int fans[6] = {mnl, mnr, mer, mxr, mel, mxl};
                answer(fans);
            }
        }
    }
    else {
        t2 = getNextLightest(mnl, mnr, mxl, mxr);
        if (t2 == mnl){
            int fans[6] = {mnr, mer, mxr, mnl, mel, mxl};
            answer(fans);
        }
        else if (t2 == mxl){
            t3 = getNextLightest(mel, mxr, mer, mnl);
            if (t3 == mer){
                t4 = getMedian(mxr, mel, mxl);
                if (t4 == mel){
                    int fans[6] = {mnr, mnl, mer, mxr, mel, mxl};
                    answer(fans);
                }
                else{
                    int fans[6] = {mnr, mnl, mer, mel, mxr, mxl};
                    answer(fans);
                }
            }
            else if (t3 == mxr){
                int fans[6] = {mnr, mer, mnl, mxr, mel, mxl};
                answer(fans);
            }
            else {
                t4 = getMedian(mnr, mer, mnl);
                if (t4 == mer){
                    int fans[6] = {mnr, mer, mnl, mel, mxr, mxl};
                    answer(fans);
                }
                else{
                    int fans[6] = {mnr, mnl, mel, mer, mxr, mxl};
                    answer(fans);
                }
            }

        }
        else{
            t3 = getMedian(mnl, mer, mxl);
            if (t3 == mnl){
                int fans[6] = {mnr, mer, mnl, mel, mxl, mxr};
                answer(fans);
            }
            else if (t3 == mer){
                t4 = getMedian(mnl, mer, mel);
                if (t4 == mer){
                    int fans[6] = {mnr, mnl, mer, mel, mxl, mxr};
                    answer(fans);
                }
                else {
                    int fans[6] = {mnr, mnl, mel, mer, mxl, mxr};
                    answer(fans);
                }
            }
            else{
                int fans[6] = {mnr, mnl, mel, mxl, mer, mxr};
                answer(fans);
            }
        }
    }
}

signed main(){

}


Compilation message (stderr)

scales.cpp: In function 'void orderCoins()':
scales.cpp:27:15: error: 'getLightest' was not declared in this scope
   27 |     int mnl = getLightest(ww[0], ww[1], ww[2]), mxl = getHeaviest(ww[0], ww[1], ww[2]);
      |               ^~~~~~~~~~~
scales.cpp:29:44: error: 'mxl' was not declared in this scope; did you mean 'mel'?
   29 |     REP(i, 3) if (ww[i] != mnl && ww[i] != mxl) mel = ww[i];
      |                                            ^~~
      |                                            mel
scales.cpp:32:47: error: 'mxr' was not declared in this scope; did you mean 'mnr'?
   32 |     FOR(i, 3, 6) if (ww[i] != mnr && ww[i] != mxr) mer= ww[i];
      |                                               ^~~
      |                                               mnr
scales.cpp:32:52: error: 'mer' was not declared in this scope; did you mean 'mnr'?
   32 |     FOR(i, 3, 6) if (ww[i] != mnr && ww[i] != mxr) mer= ww[i];
      |                                                    ^~~
      |                                                    mnr
scales.cpp:34:29: error: 'mxl' was not declared in this scope; did you mean 'mel'?
   34 |     int t1 = getMedian(mnl, mxl, mnr);
      |                             ^~~
      |                             mel
scales.cpp:34:14: error: 'getMedian' was not declared in this scope
   34 |     int t1 = getMedian(mnl, mxl, mnr);
      |              ^~~~~~~~~
scales.cpp:36:44: error: 'mer' was not declared in this scope; did you mean 'mnr'?
   36 |         int fans[6] = {mnl, mel, mxl, mnr, mer, mxr};
      |                                            ^~~
      |                                            mnr
scales.cpp:36:49: error: 'mxr' was not declared in this scope; did you mean 'mnr'?
   36 |         int fans[6] = {mnl, mel, mxl, mnr, mer, mxr};
      |                                                 ^~~
      |                                                 mnr
scales.cpp:37:9: error: 'answer' was not declared in this scope
   37 |         answer(fans);
      |         ^~~~~~
scales.cpp:42:45: error: 'mxr' was not declared in this scope; did you mean 'mnr'?
   42 |         t2 = getNextLightest(mnl, mnr, mxl, mxr);
      |                                             ^~~
      |                                             mnr
scales.cpp:42:14: error: 'getNextLightest' was not declared in this scope
   42 |         t2 = getNextLightest(mnl, mnr, mxl, mxr);
      |              ^~~~~~~~~~~~~~~
scales.cpp:44:44: error: 'mer' was not declared in this scope; did you mean 'mnr'?
   44 |             t3 = getNextLightest(mel, mxl, mer, mnr);
      |                                            ^~~
      |                                            mnr
scales.cpp:49:21: error: 'answer' was not declared in this scope
   49 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:53:21: error: 'answer' was not declared in this scope
   53 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:58:17: error: 'answer' was not declared in this scope
   58 |                 answer(fans);
      |                 ^~~~~~
scales.cpp:64:21: error: 'answer' was not declared in this scope
   64 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:68:21: error: 'answer' was not declared in this scope
   68 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:76:47: error: 'mer' was not declared in this scope; did you mean 'mnr'?
   76 |                 int fans[6] = {mnl, mel, mnr, mer, mxr, mxl};
      |                                               ^~~
      |                                               mnr
scales.cpp:77:17: error: 'answer' was not declared in this scope
   77 |                 answer(fans);
      |                 ^~~~~~
scales.cpp:80:42: error: 'mer' was not declared in this scope; did you mean 'mnr'?
   80 |                 t4 = getMedian(mnr, mel, mer);
      |                                          ^~~
      |                                          mnr
scales.cpp:83:21: error: 'answer' was not declared in this scope
   83 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:87:21: error: 'answer' was not declared in this scope
   87 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:91:42: error: 'mer' was not declared in this scope; did you mean 'mnr'?
   91 |                 int fans[6] = {mnl, mnr, mer, mxr, mel, mxl};
      |                                          ^~~
      |                                          mnr
scales.cpp:92:17: error: 'answer' was not declared in this scope
   92 |                 answer(fans);
      |                 ^~~~~~
scales.cpp:97:45: error: 'mxr' was not declared in this scope; did you mean 'mnr'?
   97 |         t2 = getNextLightest(mnl, mnr, mxl, mxr);
      |                                             ^~~
      |                                             mnr
scales.cpp:97:14: error: 'getNextLightest' was not declared in this scope
   97 |         t2 = getNextLightest(mnl, mnr, mxl, mxr);
      |              ^~~~~~~~~~~~~~~
scales.cpp:99:33: error: 'mer' was not declared in this scope; did you mean 'mnr'?
   99 |             int fans[6] = {mnr, mer, mxr, mnl, mel, mxl};
      |                                 ^~~
      |                                 mnr
scales.cpp:100:13: error: 'answer' was not declared in this scope
  100 |             answer(fans);
      |             ^~~~~~
scales.cpp:103:44: error: 'mer' was not declared in this scope; did you mean 'mnr'?
  103 |             t3 = getNextLightest(mel, mxr, mer, mnl);
      |                                            ^~~
      |                                            mnr
scales.cpp:108:21: error: 'answer' was not declared in this scope
  108 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:112:21: error: 'answer' was not declared in this scope
  112 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:117:17: error: 'answer' was not declared in this scope
  117 |                 answer(fans);
      |                 ^~~~~~
scales.cpp:123:21: error: 'answer' was not declared in this scope
  123 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:127:21: error: 'answer' was not declared in this scope
  127 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:133:33: error: 'mer' was not declared in this scope; did you mean 'mnr'?
  133 |             t3 = getMedian(mnl, mer, mxl);
      |                                 ^~~
      |                                 mnr
scales.cpp:136:17: error: 'answer' was not declared in this scope
  136 |                 answer(fans);
      |                 ^~~~~~
scales.cpp:142:21: error: 'answer' was not declared in this scope
  142 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:146:21: error: 'answer' was not declared in this scope
  146 |                     answer(fans);
      |                     ^~~~~~
scales.cpp:151:17: error: 'answer' was not declared in this scope
  151 |                 answer(fans);
      |                 ^~~~~~