# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
130568 | 2019-07-15 15:16:06 | keko37 | Scales (IOI15_scales) | C++14 | 100 / 100 | 10 ms | 512 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include <bits/stdc++.h>
#include "scales.h"
using namespace std;
const int MAXN = 5005;
int cnt, kreni;
int sus[3][MAXN];
int p[750][7], pos[750][7];
int sol[MAXN], tip[MAXN], aa[MAXN], bb[MAXN], cc[MAXN], dd[MAXN];
void indeksiraj () {
int c[6] = {0, 1, 2, 3, 4, 5};
int cnt = 0;
do {
for (int i=0; i<6; i++) {
p[cnt][i] = c[i];
pos[cnt][p[cnt][i]] = i;
}
cnt++;
} while (next_permutation(c, c + 6));
}
vector <int> va, vb, vc;
bool partMin (const vector <int> &v, int a, int b, int c, int siz) {
va.clear(); vb.clear(); vc.clear();
int lim = v.size(), x, y, z;
for (int i=0; i<lim; i++) {
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Compilation message (stderr)
scales.cpp: In function 'void indeksiraj()': scales.cpp:15:9: warning: declaration of 'cnt' shadows a global declaration [-Wshadow] int cnt = 0; ^~~ scales.cpp:8:5: note: shadowed declaration is here int cnt, kreni; ^~~ scales.cpp: In function 'bool partMin(const std::vector<int>&, int, int, int, int)': scales.cpp:29:21: warning: conversion to 'int' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Wconversion] int lim = v.size(), x, y, z; ~~~~~~^~ scales.cpp:37:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp:37:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp:37:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp: In function 'bool partMax(const std::vector<int>&, int, int, int, int)': scales.cpp:44:21: warning: conversion to 'int' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Wconversion] int lim = v.size(), x, y, z; ~~~~~~^~ scales.cpp:52:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp:52:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp:52:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp: In function 'bool partMed(const std::vector<int>&, int, int, int, int)': scales.cpp:59:21: warning: conversion to 'int' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Wconversion] int lim = v.size(), x, y, z; ~~~~~~^~ scales.cpp:64:19: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if (y < x && x < z || z < x && x < y) va.push_back(v[i]); ~~~~~~^~~~~~~~ scales.cpp:65:19: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if (x < y && y < z || z < y && y < x) vb.push_back(v[i]); ~~~~~~^~~~~~~~ scales.cpp:66:19: warning: suggest parentheses around '&&' within '||' [-Wparentheses] if (x < z && z < y || y < z && z < x) vc.push_back(v[i]); ~~~~~~^~~~~~~~ scales.cpp:67:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp:67:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp:67:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp: In function 'bool partMagic(const std::vector<int>&, int, int, int, int, int)': scales.cpp:74:21: warning: conversion to 'int' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Wconversion] int lim = v.size(), x, y, z, w; ~~~~~~^~ scales.cpp:111:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp:111:42: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp:111:61: warning: comparison between signed and unsigned integer expressions [-Wsign-compare] if (va.size() > siz || vb.size() > siz || vc.size() > siz) return 0; ~~~~~~~~~~^~~~~ scales.cpp: In function 'bool ima(std::vector<int>, int)': scales.cpp:117:5: warning: this 'for' clause does not guard... [-Wmisleading-indentation] for (auto e : v) if (e == x) return 1; return 0; ^~~ scales.cpp:117:44: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for' for (auto e : v) if (e == x) return 1; return 0; ^~~~~~ scales.cpp: In function 'void init(int)': scales.cpp:192:16: warning: unused parameter 'T' [-Wunused-parameter] void init (int T) { ^ scales.cpp: In function 'int rjesi(int)': scales.cpp:218:1: warning: control reaches end of non-void function [-Wreturn-type] } ^ scales.cpp:217:5: warning: 'res' may be used uninitialized in this function [-Wmaybe-uninitialized] if (res == c) return rjesi(sus[2][curr]); ^~
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |