답안 #485438

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
485438 2021-11-07T18:49:12 Z AmirElarbi 저울 (IOI15_scales) C++14
0 / 100
1 ms 460 KB
#include <bits/stdc++.h>
#include "scales.h"
#define vi vector<int>
#define ve vector
#define ll long long
#define vf vector<float>
#define vll vector<pair<ll,ll>>
#define ii pair<int,int>
#define vvi vector<vi>
#define vii vector<ii>
#define gii greater<ii>
#define pb push_back
#define fi first
#define se second
#define INF 1e9
#define eps 1e-7
#define eps1 1e-25
#define optimise ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define MAX_A 1e5+5
#define V 450
using namespace std;
const int MOD = 1e9+7;
const int nax = 200005;
void init(int T) {
    return;
}

void orderCoins() {
    int i = 1, j = 2, k = 3;
    int light = getLightest(i,j,k), hev = getHeaviest(i,j,k);
    light = getLightest(light,4,5), hev = getHeaviest(hev,4,5);
    if(light!=4)
        light = getLightest(light,4,6);
    else
        light = getLightest(light,5,6);
    if(hev!=4)
        hev = getHeaviest(hev,4,6);
    else
        hev = getHeaviest(hev,5,6);
    int w[6];
    w[0] = light;
    bool a[6];
    a[light-1] = 1;
    vi s;
    for(int i = 0; i < 6; i++){
        if(!a[i]){s.pb(i+1);}
    }
    int res = getNextLightest(s[0],s[1],s[2],light);
    w[1] = light = getLightest(res,s[3],s[4]);
    a[light-1] = true;
    s.clear();
    for(int i = 0; i < 6; i++){
        if(!a[i]){s.pb(i+1);}
    }
    res = getNextLightest(s[0],s[1],s[2],light);
    w[2] = light = getMedian(res,s[3],w[1]);
    a[light-1] = true;
    s.clear();
    for(int i = 0; i < 6; i++){
        if(!a[i]){s.pb(i+1);}
    }
    w[3] = light = getNextLightest(s[0],s[1],s[2],light);
    a[light-1] = true;
    w[5] = hev;
    for(int i = 0; i < 6; i++){
        if(!a[i]){w[4] = i; break;}
    }
    answer(w);
}

Compilation message

scales.cpp: In function 'void init(int)':
scales.cpp:24:15: warning: unused parameter 'T' [-Wunused-parameter]
   24 | void init(int T) {
      |           ~~~~^
scales.cpp: In function 'void orderCoins()':
scales.cpp:45:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   45 |     for(int i = 0; i < 6; i++){
      |             ^
scales.cpp:29:9: note: shadowed declaration is here
   29 |     int i = 1, j = 2, k = 3;
      |         ^
scales.cpp:52:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   52 |     for(int i = 0; i < 6; i++){
      |             ^
scales.cpp:29:9: note: shadowed declaration is here
   29 |     int i = 1, j = 2, k = 3;
      |         ^
scales.cpp:59:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   59 |     for(int i = 0; i < 6; i++){
      |             ^
scales.cpp:29:9: note: shadowed declaration is here
   29 |     int i = 1, j = 2, k = 3;
      |         ^
scales.cpp:65:13: warning: declaration of 'i' shadows a previous local [-Wshadow]
   65 |     for(int i = 0; i < 6; i++){
      |             ^
scales.cpp:29:9: note: shadowed declaration is here
   29 |     int i = 1, j = 2, k = 3;
      |         ^
# 결과 실행 시간 메모리 Grader output
1 Runtime error 1 ms 332 KB Execution killed with signal 6
2 Runtime error 1 ms 332 KB Execution killed with signal 6
3 Runtime error 1 ms 332 KB Execution killed with signal 6
4 Runtime error 1 ms 332 KB Execution killed with signal 6
5 Runtime error 1 ms 332 KB Execution killed with signal 6
6 Runtime error 1 ms 332 KB Execution killed with signal 6
7 Runtime error 1 ms 332 KB Execution killed with signal 6
8 Runtime error 1 ms 332 KB Execution killed with signal 6
9 Runtime error 1 ms 332 KB Execution killed with signal 6
10 Runtime error 1 ms 332 KB Execution killed with signal 6
11 Runtime error 1 ms 332 KB Execution killed with signal 6
12 Runtime error 1 ms 332 KB Execution killed with signal 6
13 Runtime error 1 ms 332 KB Execution killed with signal 6
14 Runtime error 1 ms 332 KB Execution killed with signal 6
15 Runtime error 1 ms 332 KB Execution killed with signal 6
16 Runtime error 0 ms 332 KB Execution killed with signal 6
17 Runtime error 1 ms 332 KB Execution killed with signal 6
18 Runtime error 1 ms 332 KB Execution killed with signal 6
19 Runtime error 1 ms 332 KB Execution killed with signal 6
20 Runtime error 1 ms 332 KB Execution killed with signal 6
21 Runtime error 1 ms 460 KB Execution killed with signal 6
22 Runtime error 1 ms 332 KB Execution killed with signal 6
23 Runtime error 1 ms 332 KB Execution killed with signal 6
24 Runtime error 1 ms 332 KB Execution killed with signal 6
25 Runtime error 1 ms 332 KB Execution killed with signal 6
26 Runtime error 1 ms 332 KB Execution killed with signal 6
27 Runtime error 1 ms 332 KB Execution killed with signal 6
28 Runtime error 1 ms 332 KB Execution killed with signal 6
29 Runtime error 1 ms 332 KB Execution killed with signal 6
30 Runtime error 1 ms 332 KB Execution killed with signal 6
31 Runtime error 1 ms 332 KB Execution killed with signal 6
32 Runtime error 1 ms 332 KB Execution killed with signal 6
33 Runtime error 1 ms 332 KB Execution killed with signal 6
34 Runtime error 1 ms 460 KB Execution killed with signal 6
35 Runtime error 1 ms 332 KB Execution killed with signal 6
36 Runtime error 1 ms 332 KB Execution killed with signal 6
37 Runtime error 1 ms 332 KB Execution killed with signal 6
38 Runtime error 1 ms 332 KB Execution killed with signal 6
39 Runtime error 1 ms 332 KB Execution killed with signal 6
40 Runtime error 1 ms 332 KB Execution killed with signal 6