Submission #815083

# Submission time Handle Problem Language Result Execution time Memory
815083 2023-08-08T12:13:31 Z kwongweng Scales (IOI15_scales) C++17
0 / 100
3 ms 340 KB
#include "scales.h"
#include <bits/stdc++.h>
using namespace std;
 
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<ii> vii;
typedef long double ld;
typedef pair<ll, ll> pll;
#define FOR(i, a, b) for(int i = a; i < b; i++)
#define ROF(i, a, b) for(int i = a; i >= b; i--)
#define ms memset
#define pb push_back
#define fi first
#define se second
#define H(a,b,c) getHeaviest(a,b,c)
#define L(a,b,c) getLightest(a,b,c)
#define M(a,b,c) getMedian(a,b,c)
#define NL(a,b,c,d) getNextLightest(a,b,c,d);

void init(int T) {
    /* ... */
}

void orderCoins() {
    /* ... */
    int mx1 = H(1,2,3);
    int mn1 = L(1,2,3);
    int md1 = 6-mx1-mn1;
    int mx2 = H(4,5,6);
    int mn2 = L(4,5,6);
    int md2 = 15-mx2-mn2;
    vi seq1 = {mn1,md1,mx1};
    vi seq2 = {mn2,md2,mx2};

    int val = H(mx1,mx2,md1);
    vi ans;
    if (val==mx2){
        int cur=0;
        FOR(i,0,3){
            int val2 = NL(mn2,md2,mx2,seq1[i]);
            if (val2==mn2) ans.pb(seq1[i]);
            if (val2==md2){
                if (cur==0){ans.pb(mn2); cur++;}
                ans.pb(seq1[i]);
            }
            if (val2==mx2){
                if (cur==0){ans.pb(mn2); cur++;}
                if (cur==1){ans.pb(md2); cur++;}
                ans.pb(seq1[i]);
            }
        }
        if (cur==0){ans.pb(mn2); cur++;}
        if (cur==1){ans.pb(md2); cur++;}
        ans.pb(mx2);
    }else{
        int cur=0;
        FOR(i,0,3){
            int val2 = NL(mn1,md1,mx1,seq2[i]);
            if (val2==mn1) ans.pb(seq2[i]);
            if (val2==md1){
                if (cur==0){ans.pb(mn1); cur++;}
                ans.pb(seq2[i]);
            }
            if (val2==mx1){
                if (cur==0){ans.pb(mn1); cur++;}
                if (cur==1){ans.pb(md1); cur++;}
                ans.pb(seq2[i]);
            }
        }
        if (cur==0){ans.pb(mn2); cur++;}
        if (cur==1){ans.pb(md2); cur++;}
        ans.pb(mx2);
    }
    int W[] = {1, 2, 3, 4, 5, 6};
    FOR(i,0,6) W[i]=ans[i];
    answer(W);
}

Compilation message

scales.cpp: In function 'void init(int)':
scales.cpp:22:15: warning: unused parameter 'T' [-Wunused-parameter]
   22 | void init(int T) {
      |           ~~~~^
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Incorrect 0 ms 212 KB Output isn't correct
4 Incorrect 0 ms 212 KB Output isn't correct
5 Incorrect 0 ms 296 KB Output isn't correct
6 Incorrect 1 ms 284 KB Output isn't correct
7 Incorrect 1 ms 212 KB Output isn't correct
8 Incorrect 3 ms 212 KB Output isn't correct
9 Incorrect 1 ms 212 KB Output isn't correct
10 Incorrect 1 ms 212 KB Output isn't correct
11 Incorrect 0 ms 212 KB Output isn't correct
12 Incorrect 1 ms 232 KB Output isn't correct
13 Incorrect 1 ms 212 KB Output isn't correct
14 Incorrect 1 ms 212 KB Output isn't correct
15 Incorrect 1 ms 212 KB Output isn't correct
16 Incorrect 0 ms 300 KB Output isn't correct
17 Incorrect 1 ms 212 KB Output isn't correct
18 Incorrect 1 ms 212 KB Output isn't correct
19 Incorrect 1 ms 232 KB Output isn't correct
20 Incorrect 0 ms 296 KB Output isn't correct
21 Incorrect 1 ms 212 KB Output isn't correct
22 Incorrect 1 ms 300 KB Output isn't correct
23 Incorrect 1 ms 212 KB Output isn't correct
24 Incorrect 1 ms 300 KB Output isn't correct
25 Incorrect 1 ms 212 KB Output isn't correct
26 Incorrect 0 ms 212 KB Output isn't correct
27 Incorrect 1 ms 212 KB Output isn't correct
28 Incorrect 0 ms 212 KB Output isn't correct
29 Incorrect 1 ms 212 KB Output isn't correct
30 Incorrect 0 ms 212 KB Output isn't correct
31 Incorrect 0 ms 212 KB Output isn't correct
32 Incorrect 1 ms 212 KB Output isn't correct
33 Incorrect 0 ms 212 KB Output isn't correct
34 Incorrect 0 ms 212 KB Output isn't correct
35 Incorrect 0 ms 212 KB Output isn't correct
36 Incorrect 1 ms 340 KB Output isn't correct
37 Incorrect 0 ms 212 KB Output isn't correct
38 Incorrect 0 ms 212 KB Output isn't correct
39 Incorrect 0 ms 212 KB Output isn't correct
40 Incorrect 1 ms 300 KB Output isn't correct