Submission #427071

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4270712021-06-14 12:09:33tqbfjotldCity (JOI17_city)C++14
8 / 100
274 ms48632 KiB
#include "Encoder.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> chlist[250005];
int curnodes,n;
vector<int> adjl[250005];
const int numch = 3;
long long expp[250005];
int func(int node, int pa){
set<pair<int,int> > stuff;
for (auto x : adjl[node]){
if (x==pa) continue;
int res = func(x,node);
stuff.insert({res,x});
}
while (stuff.size()>numch){
int nw = curnodes++;
int mxv = -1;
for (int x = 0; x<numch; x++){
auto i = *stuff.begin();
stuff.erase(stuff.begin());
chlist[nw].push_back(i.second);
mxv = i.first;
}
stuff.insert({mxv+1,nw});
}
int mxv = -1;
for (auto x : stuff){
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Encoder.cpp: In function 'void dfs2(int, long long int, int)':
Encoder.cpp:43:28: warning: comparison of integer expressions of different signedness: 'long long int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |     for (long long x = 0; x<chlist[node].size(); x++){
      |                           ~^~~~~~~~~~~~~~~~~~~~

Device.cpp: In function 'int Answer(long long int, long long int)':
Device.cpp:29:26: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   29 |         for (int x = 0; x<s1.size(); x++){
      |                         ~^~~~~~~~~~
Device.cpp:34:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   34 |     for (int x = 0; x<s2.size(); x++){
      |                     ~^~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...