Submission #1207511

#TimeUsernameProblemLanguageResultExecution timeMemory
1207511kilikumaScales (IOI15_scales)C++20
0 / 100
0 ms320 KiB
#include "scales.h"
#include <bits/stdc++.h>

using namespace std;

void init(int T) {
    // Initialization if needed
}

void orderCoins() {
    int W[6]; 

    int heaviestABC = getHeaviest(1, 2, 3);
    int a, b, c;
    if (heaviestABC == 1) {
        a = 2; b = 3; c = 1;
    } else if (heaviestABC == 2) {
        a = 1; b = 3; c = 2;
    } else {
        a = 1; b = 2; c = 3;
    }

    int heaviestDEF = getHeaviest(4, 5, 6);
    int d, e, f;
    if (heaviestDEF == 4) {
        d = 5; e = 6; f = 4;
    } else if (heaviestDEF == 5) {
        d = 4; e = 6; f = 5;
    } else {
        d = 4; e = 5; f = 6;
    }

    int nextLight = getNextLightest(a, c, f, d);
    if (nextLight == a) {
        int medianBDA = getMedian(b, d, a);
        if (medianBDA == d) {
            int lightestADE = getLightest(a, d, e);
            if (lightestADE == a) {
                if (getMedian(e, d, a) == d) {
                    W[0] = e; W[1] = b; W[2] = d; W[3] = a; W[4] = c; W[5] = f;
                } else {
                    W[0] = b; W[1] = d; W[2] = e; W[3] = a; W[4] = c; W[5] = f;
                }
            } else if (lightestADE == d) {
                if (getMedian(a, e, c) == e) {
                    W[0] = b; W[1] = d; W[2] = a; W[3] = e; W[4] = c; W[5] = f;
                } else if (getMedian(a, e, c) == a) {
                    W[0] = b; W[1] = d; W[2] = e; W[3] = a; W[4] = c; W[5] = f;
                } else {
                    W[0] = b; W[1] = d; W[2] = a; W[3] = c; W[4] = e; W[5] = f;
                }
            } else { 
                W[0] = e; W[1] = b; W[2] = d; W[3] = a; W[4] = c; W[5] = f;
            }
        } else if (medianBDA == b) {
            int lightestBDE = getLightest(b, d, e);
            if (lightestBDE == d) {
                if (getMedian(b, e, a) == e) {
                    W[0] = d; W[1] = b; W[2] = e; W[3] = a; W[4] = c; W[5] = f;
                } else if (getMedian(b, e, a) == b) {
                    W[0] = d; W[1] = e; W[2] = b; W[3] = a; W[4] = c; W[5] = f;
                } else {
                    W[0] = d; W[1] = b; W[2] = a; W[3] = e; W[4] = c; W[5] = f;
                }
            } else if (lightestBDE == b) {
                W[0] = e; W[1] = d; W[2] = b; W[3] = a; W[4] = c; W[5] = f;
            } else { 
                W[0] = e; W[1] = d; W[2] = b; W[3] = a; W[4] = c; W[5] = f;
            }
        } else { 
        }
    } else if (nextLight == c) {
        int medianADB = getMedian(a, d, b);
        if (medianADB == a) {
            if (getLightest(a, d, b) == d) {
                int lightestADE = getLightest(a, d, e);
                if (lightestADE == a) {
                    if (getMedian(e, d, a) == d) {
                        W[0] = e; W[1] = d; W[2] = a; W[3] = b; W[4] = c; W[5] = f;
                    } else {
                        W[0] = d; W[1] = e; W[2] = a; W[3] = b; W[4] = c; W[5] = f;
                    }
                } else if (lightestADE == d) {
                    if (getMedian(a, e, b) == e) {
                        W[0] = d; W[1] = a; W[2] = e; W[3] = b; W[4] = c; W[5] = f;
                    } else if (getMedian(a, e, b) == a) {
                        W[0] = d; W[1] = e; W[2] = a; W[3] = b; W[4] = c; W[5] = f;
                    } else {
                        W[0] = d; W[1] = a; W[2] = b; W[3] = e; W[4] = c; W[5] = f;
                    }
                } else { 
                    W[0] = e; W[1] = d; W[2] = a; W[3] = b; W[4] = c; W[5] = f;
                }
            } else { 
                int lightestBDE = getLightest(b, d, e);
                if (lightestBDE == b) {
                    if (getMedian(b, d, e) == d) {
                        W[0] = b; W[1] = a; W[2] = d; W[3] = e; W[4] = c; W[5] = f;
                    } else if (getMedian(b, d, e) == b) {
                    } else {
                        W[0] = b; W[1] = a; W[2] = e; W[3] = d; W[4] = c; W[5] = f;
                    }
                } else if (lightestBDE == d) {
                } else {
                    W[0] = e; W[1] = b; W[2] = a; W[3] = d; W[4] = c; W[5] = f;
                }
            }
        } else if (medianADB == d) {

            int lightestADE = getLightest(a, d, e);
            if (lightestADE == a) {
                if (getMedian(e, d, a) == d) {
                } else if (getMedian(e, d, a) == a) {
                    W[0] = a; W[1] = d; W[2] = b; W[3] = e; W[4] = c; W[5] = f;
                } else {
                    W[0] = d; W[1] = e; W[2] = a; W[3] = b; W[4] = c; W[5] = f;
                }
            } else if (lightestADE == d) {
                if (getMedian(a, e, b) == e) {
                    W[0] = a; W[1] = d; W[2] = e; W[3] = b; W[4] = c; W[5] = f;
                } else if (getMedian(a, e, b) == a) {
                    W[0] = e; W[1] = d; W[2] = a; W[3] = b; W[4] = c; W[5] = f;
                } else {
                    W[0] = a; W[1] = d; W[2] = b; W[3] = e; W[4] = c; W[5] = f;
                }
            } else {
                W[0] = e; W[1] = a; W[2] = d; W[3] = b; W[4] = c; W[5] = f;
            }
        } else { 
            int lightestABE = getLightest(a, b, e);
            if (lightestABE == a) {
                if (getMedian(a, e, b) == e) {
                    W[0] = a; W[1] = e; W[2] = b; W[3] = d; W[4] = c; W[5] = f;
                } else if (getMedian(a, e, b) == a) {
                    W[0] = e; W[1] = a; W[2] = b; W[3] = d; W[4] = c; W[5] = f;
                } else {
                    W[0] = a; W[1] = b; W[2] = e; W[3] = d; W[4] = c; W[5] = f;
                }
            } else if (lightestABE == b) {
            } else { 
                W[0] = e; W[1] = a; W[2] = b; W[3] = d; W[4] = c; W[5] = f;
            }
        }
    } else { 
        int medianACD = getMedian(a, c, d);
        if (medianACD == a) {
            if (getLightest(a, c, d) == c) {

                int lightestBCE = getLightest(b, c, e);
                if (lightestBCE == b) {
                    if (getMedian(b, c, e) == c) {
                        W[0] = b; W[1] = c; W[2] = a; W[3] = d; W[4] = e; W[5] = f;
                    } else if (getMedian(b, c, e) == b) {
                        W[0] = e; W[1] = b; W[2] = c; W[3] = a; W[4] = d; W[5] = f;
                    } else {
                        W[0] = b; W[1] = e; W[2] = c; W[3] = a; W[4] = d; W[5] = f;
                    }
                } else if (lightestBCE == c) {
                    if (getMedian(c, b, e) == b) {
                        W[0] = c; W[1] = a; W[2] = b; W[3] = d; W[4] = e; W[5] = f;
                    } else if (getMedian(c, b, e) == c) {
                        W[0] = b; W[1] = c; W[2] = a; W[3] = d; W[4] = e; W[5] = f;
                    } else {
                        W[0] = c; W[1] = a; W[2] = e; W[3] = b; W[4] = d; W[5] = f;
                    }
                } else { 
                    W[0] = e; W[1] = b; W[2] = c; W[3] = a; W[4] = d; W[5] = f;
                }
            } else { 
                int lightestABE = getLightest(a, b, e);
                if (lightestABE == a) {
                    if (getMedian(a, b, e) == b) {
                        W[0] = a; W[1] = c; W[2] = b; W[3] = d; W[4] = e; W[5] = f;
                    } else if (getMedian(a, b, e) == a) {
                        W[0] = e; W[1] = a; W[2] = c; W[3] = b; W[4] = d; W[5] = f;
                    } else {
                        W[0] = a; W[1] = c; W[2] = e; W[3] = b; W[4] = d; W[5] = f;
                    }
                } else if (lightestABE == b) {
                } else {
                    W[0] = e; W[1] = a; W[2] = c; W[3] = b; W[4] = d; W[5] = f;
                }
            }
        } else if (medianACD == c) {
            int lightestABE = getLightest(a, b, e);
            if (lightestABE == a) {
                if (getMedian(a, b, e) == b) {
                    W[0] = a; W[1] = c; W[2] = b; W[3] = d; W[4] = e; W[5] = f;
                } else if (getMedian(a, b, e) == a) {
                    W[0] = e; W[1] = a; W[2] = c; W[3] = b; W[4] = d; W[5] = f;
                } else {
                    W[0] = a; W[1] = c; W[2] = e; W[3] = b; W[4] = d; W[5] = f;
                }
            } else if (lightestABE == b) {
            } else { 
                W[0] = e; W[1] = a; W[2] = c; W[3] = b; W[4] = d; W[5] = f;
            }
        } else { 
        }
    }

    answer(W);
}
#Verdict Execution timeMemoryGrader output
Fetching results...