Submission #165802

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1658022019-11-29 00:51:02triTowns (IOI15_towns)C++14
100 / 100
22 ms1144 KiB
#include <bits/stdc++.h>
#include "towns.h"
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pi;
typedef pair<ll, ll> pl;
typedef vector<int> vi;
typedef vector<ld> vd;
typedef vector<ll> vl;
#define pb push_back
#define f first
#define s second
namespace debug {
const int DEBUG = true;
template<class T1, class T2>
void pr(const pair<T1, T2> &x);
template<class T, size_t SZ>
void pr(const array<T, SZ> &x);
template<class T>
void pr(const vector<T> &x);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

towns.cpp: In function 'bool checkSplit(vi&)':
towns.cpp:105:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < list.size(); i++) {
                     ~~^~~~~~~~~~~~~
towns.cpp:125:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < list.size(); i++) {
                     ~~^~~~~~~~~~~~~
towns.cpp: In function 'int hubDistance(int, int)':
towns.cpp:199:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 0; i < centV.size(); i++) {
                     ~~^~~~~~~~~~~~~~
towns.cpp:209:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
     for (int i = 1; i < centV.size(); i++) {
                     ~~^~~~~~~~~~~~~~
towns.cpp:210:29: warning: conversion to '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Wconversion]
         bef[i] = bef[i - 1] + centV[i - 1].s.size();
towns.cpp:214:31: warning: conversion to 'int' from 'std::vector<std::pair<int, std::vector<int> > >::size_type {aka long unsigned int}' may alter its value [-Wconversion]
     for (int i = centV.size() - 2; i >= 0; i--) {
                  ~~~~~~~~~~~~~^~~
towns.cpp:215:29: warning: conversion to '__gnu_cxx::__alloc_traits<std::allocator<int> >::value_type {aka int}' from 'std::vector<int>::size_type {aka long unsigned int}' may alter its value [-Wconversion]
         aft[i] = aft[i + 1] + centV[i + 1].s.size();
In file included from /usr/include/c++/7/cassert:44:0,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:33,
                 from towns.cpp:1:
towns.cpp:220:58: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         assert(bef[hub] + aft[hub] + centV[hub].s.size() == N);
towns.cpp:222:37: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
             if (centV[hub].s.size() <= N / 2) {
                 ~~~~~~~~~~~~~~~~~~~~^~~~~~~~
towns.cpp:138:29: warning: unused parameter 'sub' [-Wunused-parameter]
 int hubDistance(int iN, int sub) {
                             ^~~
#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...