Submission #60791

#TimeUsernameProblemLanguageResultExecution timeMemory
60791Flugan42Scales (IOI15_scales)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h>
#include "graderlib.c"
using namespace std;
typedef long long ll;
typedef vector<ll> vi;
typedef pair<ll,ll> ii;
typedef vector<ii> vii;
typedef long double lld;
#define rep(i,a,b) for(ll i = a; i < b; i++)
#define per(i,a,b) for(ll i = a; i >= b; i--)
#define all(x) x.begin(),x.end()
#define sz(x) (ll)(x).size()
#define trav(a,x) for(auto a : x)
#define inf 1000000000000000000

void init(int T) {

}

void orderCoins() {
    int W[] = {1, 2, 3, 4, 5, 6};
    int A[3],B[3];
    A[0] = getLightest(1,2,3);
    A[1] = getMedian(1,2,3);
    A[2] = 6-A[0]-A[1];
    B[0] = getLightest(4,5,6);
    B[1] = getMedian(4,5,6);
    B[2] = 15-B[0]-B[1];
    ll a[3];
    rep(i,0,3) a[i] = getNextLightest(A[0],A[1],A[2],B[i]);
    if (a[0] == A[0] && a[1] == A[0] && a[2] == A[0]){
      ll b = getLightest(A[0],A[1],B[1]);
      if (b == B[1]){
        W[0] = B[0]; W[1] = B[1];
        ll c = getLightest(A[0],A[1],B[2]);
        if (c == B[2]){
          W[3] = A[0]; W[4] = A[1]; W[5] = A[2]; W[2] = B[2];
        } else {
          W[2] = A[0]; W[3] = A[1]; W[4] = A[2]; W[5] = B[2];
        }
      } else {
        ll c = getLightest(A[0],A[1],B[0]);
        if (c == B[0]){
          W[0] = B[0]; W[1] = A[0]; W[2] = A[1]; W[3] = A[2]; W[4] = B[1]; W[5] = B[2];
        } else {
          W[3] = B[0]; W[0] = A[0]; W[1] = A[1]; W[2] = A[2]; W[4] = B[1]; W[5] = B[2];
        }
      }
    } else {
      vector<vi> befA;
      vi _; befA.assign(4,_);
      bool check = true;
      rep(i,0,3){
        rep(j,0,3){
          if (a[i] == A[j]){
            if (j == 0 && check){
              befA[j].push_back(B[i]);
            } else if (j == 0) {
              befA[3].push_back(B[i]);
            } else {
              befA[j].push_back(B[i]);
            }
          }
        }
      }
      ll cur = 0;
      rep(i,0,4){
        trav(j,befA[i]){
          W[cur] = j; cur++;
        }
        if (i < 3) { W[cur] = A[i]; cur++; }
      }
    }
    answer(W);
}

Compilation message (stderr)

In file included from grader.c:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
In file included from scales.cpp:2:0:
graderlib.c: In function 'void answer(int*)':
graderlib.c:53:5: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
     if (_ghksjhdfkae19ga_ > 1) 
     ^~
graderlib.c:56:2: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  for (i = 0; i < 6; i++) {
  ^~~
scales.cpp: In function 'void init(int)':
scales.cpp:16:15: warning: unused parameter 'T' [-Wunused-parameter]
 void init(int T) {
               ^
scales.cpp: In function 'void orderCoins()':
scales.cpp:69:20: warning: conversion to 'int' from 'long long int' may alter its value [-Wconversion]
           W[cur] = j; cur++;
                    ^
In file included from scales.cpp:2:0:
graderlib.c: At global scope:
graderlib.c:35:13: warning: 'void _gsadfghjjsadhfjnk1jrn()' defined but not used [-Wunused-function]
 static void _gsadfghjjsadhfjnk1jrn() {    
             ^~~~~~~~~~~~~~~~~~~~~~
graderlib.c:18:12: warning: 'int _gkjhskglhjaskndnas()' defined but not used [-Wunused-function]
 static int _gkjhskglhjaskndnas() {
            ^~~~~~~~~~~~~~~~~~~
/tmp/ccSayixw.o: In function `answer':
scales.cpp:(.text+0xe0): multiple definition of `answer'
/tmp/cc32rxpB.o:grader.c:(.text+0xe0): first defined here
/tmp/ccSayixw.o: In function `getMedian':
scales.cpp:(.text+0x170): multiple definition of `getMedian'
/tmp/cc32rxpB.o:grader.c:(.text+0x170): first defined here
/tmp/ccSayixw.o: In function `getHeaviest':
scales.cpp:(.text+0x190): multiple definition of `getHeaviest'
/tmp/cc32rxpB.o:grader.c:(.text+0x1f0): first defined here
/tmp/ccSayixw.o: In function `getLightest':
scales.cpp:(.text+0x1b0): multiple definition of `getLightest'
/tmp/cc32rxpB.o:grader.c:(.text+0x260): first defined here
/tmp/ccSayixw.o: In function `getNextLightest':
scales.cpp:(.text+0x1d0): multiple definition of `getNextLightest'
/tmp/cc32rxpB.o:grader.c:(.text+0x2d0): first defined here
/tmp/ccSayixw.o: In function `_calc_this_is_my_x_afadsfjdhsafnsadjkfda()':
scales.cpp:(.text+0x1f0): multiple definition of `_calc_this_is_my_x_afadsfjdhsafnsadjkfda()'
/tmp/cc32rxpB.o:grader.c:(.text+0x3d0): first defined here
collect2: error: ld returned 1 exit status