Submission #422541

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
4225412021-06-10 08:17:03milleniumEeeeFactories (JOI14_factories)C++11
0 / 100
25 ms35908 KiB
#include "factories.h"
#ifndef EVAL
#include "grader.cpp"
#endif
#include <bits/stdc++.h>
#define fr first
#define sc second
#define pii pair<int, int>
#define pb push_back
#define szof(s) (int)s.size()
#define all(s) s.begin(), s.end()
#define ll long long
using namespace std;
const ll INF = 1e18;
const int MAXN = (int)5e5 + 5;
const int MAXQ = (int)1e5 + 5;
const int L = 20;
mt19937 rnd(chrono::steady_clock::now().time_since_epoch().count());
int get_rand() {
ll x = rnd();
x %= (ll)1e9;
if (x < 0) {
x = -x;
}
return x;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

factories.cpp: In function 'void precalc(int, int, long long int)':
factories.cpp:54:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   54 |  for (auto [to, dist] : g[v]) {
      |            ^
factories.cpp: In function 'void calc(int, int)':
factories.cpp:89:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   89 |  for (auto [to, dist] : g[v]) {
      |            ^
factories.cpp: In function 'int find_centroid(int, int, int)':
factories.cpp:98:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
   98 |  for (auto [to, dist] : g[v]) {
      |            ^
factories.cpp: In function 'void build(int, int)':
factories.cpp:116:12: warning: structured bindings only available with '-std=c++17' or '-std=gnu++17'
  116 |  for (auto [to, dist] : g[center]) {
      |            ^
factories.cpp: In function 'void Init(int, int*, int*, int*)':
factories.cpp:124:31: warning: 'void* memset(void*, int, size_t)' writing to an object of type 'struct std::pair<int, long long int>' with no trivial copy-assignment [-Wclass-memaccess]
  124 |  memset(Gpar, -1, sizeof(Gpar));
      |                               ^
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
                 from /usr/include/c++/10/bits/char_traits.h:39,
                 from /usr/include/c++/10/ios:40,
                 from /usr/include/c++/10/istream:38,
                 from /usr/include/c++/10/sstream:38,
                 from /usr/include/c++/10/complex:45,
                 from /usr/include/c++/10/ccomplex:39,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:54,
                 from factories.cpp:6:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'struct std::pair<int, long long int>' declared here
  211 |     struct pair
      |            ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...