제출 #969898

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
9698982024-04-25 18:51:35BestCrazyNoob자동 인형 (IOI18_doll)C++17
26 / 100
127 ms16684 KiB
#include "doll.h"
#include <vector>
#include <array>
#include <algorithm>
using namespace std;
constexpr int H = 18;
vector<vector<int>> graph;
vector<int> C, X, Y;
int nxt = -1;
array<vector<int>, H> pos;
void create(int curr, int sz, vector<int> v, int root, int h) {
// For local vectors
curr = -1-curr;
if (sz == 2) {
X[curr] = v.size() > 1 ? v[0] : root;
Y[curr] = v.size() > 1 ? v[1] : v[0];
} else {
if (v.size() > sz/2) {
X[curr] = nxt--;
Y[curr] = nxt--;
vector<int> i1(pos[h].end() - v.size(), pos[h].begin() + sz/2), i2(pos[h].begin() + sz/2, pos[h].end()), v1, v2;
sort(i1.begin(), i1.end());
sort(i2.begin(), i2.end());
int i = 0, j = 0, x = 0;
while (i < v1.size() || j < i2.size()) {
if (i < i1.size() && (j == i2.size() || i1[i] < i2[j])) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

doll.cpp: In function 'void create(int, int, std::vector<int>, int, int)':
doll.cpp:22:22: warning: comparison of integer expressions of different signedness: 'std::vector<int>::size_type' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   22 |         if (v.size() > sz/2) {
      |             ~~~~~~~~~^~~~~~
doll.cpp:29:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |             while (i < v1.size() || j < i2.size()) {
      |                    ~~^~~~~~~~~~~
doll.cpp:29:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |             while (i < v1.size() || j < i2.size()) {
      |                                     ~~^~~~~~~~~~~
doll.cpp:30:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |                 if (i < i1.size() && (j == i2.size() || i1[i] < i2[j])) {
      |                     ~~^~~~~~~~~~~
doll.cpp:30:41: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   30 |                 if (i < i1.size() && (j == i2.size() || i1[i] < i2[j])) {
      |                                       ~~^~~~~~~~~~~~
doll.cpp: In function 'void calc_recur(std::vector<int>, int, int)':
doll.cpp:54:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   54 |     for (int i = 0; i < v.size(); i++) {
      |                     ~~^~~~~~~~~~
doll.cpp: In function 'void create_circuit(int, std::vector<int>)':
doll.cpp:91:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   91 |             while (sz < graph[i].size()) {
      |                    ~~~^~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...