Submission #537412

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5374122022-03-15 05:12:47fhvirus수도 (JOI20_capital_city)C++17
100 / 100
643 ms134368 KiB
#include <bits/stdc++.h>
using namespace std;
typedef long long ll; typedef pair<int, int> pii;
#define ff first
#define ss second
#define pb emplace_back
#define AI(x) begin(x),end(x)
#ifdef OWO
#define debug(args...) LKJ("\033[1;32m[ " + string(#args) + " ]\033[0m", args)
template <class I> void LKJ(I&&x) { cerr << x << endl; }
template <class I, class...T> void LKJ(I&&x, T&&...t) { cerr << x << ", "; LKJ(t...); }
template <class I> void OI(I a, I b) { while (a != b) cerr << *a << " \n"[(a = next(a)) == b]; }
#else
#define debug(...) 0
#define OI(...) 0
#endif
const int kN = 200002;
const int kL = 18;
int N, K, C[kN];
vector<int> adj[kN], town[kN];
int cityLCA[kN];
namespace LCA {
int dep[kN], anc[kL][kN];
void dfs(int u, int p) {
anc[0][u] = p;
for (const int& v: adj[u]) {
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

capital_city.cpp: In member function 'void SGT::init(int, int, int)':
capital_city.cpp:14:20: warning: statement has no effect [-Wunused-value]
   14 | #define debug(...) 0
      |                    ^
capital_city.cpp:107:4: note: in expansion of macro 'debug'
  107 |    debug(l, r, val[i]);
      |    ^~~~~
capital_city.cpp:14:20: warning: statement has no effect [-Wunused-value]
   14 | #define debug(...) 0
      |                    ^
capital_city.cpp:111:3: note: in expansion of macro 'debug'
  111 |   debug(l, r, val[i]);
      |   ^~~~~
capital_city.cpp: In constructor 'SGT::SGT(int)':
capital_city.cpp:102:26: warning: 'SGT::val' will be initialized after [-Wreorder]
  102 |  int n, tot; vector<int> val;
      |                          ^~~
capital_city.cpp:102:9: warning:   'int SGT::tot' [-Wreorder]
  102 |  int n, tot; vector<int> val;
      |         ^~~
capital_city.cpp:126:2: warning:   when initialized here [-Wreorder]
  126 |  SGT (int _n): n(_n), val(n * 4 + 4), tot(K) {
      |  ^~~
capital_city.cpp: In function 'int main()':
capital_city.cpp:210:21: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
  210 |   for (int j = 1; j < town[i].size(); ++j)
      |                   ~~^~~~~~~~~~~~~~~~
capital_city.cpp:14:20: warning: statement has no effect [-Wunused-value]
   14 | #define debug(...) 0
      |                    ^
capital_city.cpp:217:3: note: in expansion of macro 'debug'
  217 |   debug(i, HLD::at[i]);
      |   ^~~~~
capital_city.cpp:14:20: warning: statement has no effect [-Wunused-value]
   14 | #define debug(...) 0
      |                    ^
capital_city.cpp:226:3: note: in expansion of macro 'debug'
  226 |   debug(i, c, u, v);
      |   ^~~~~
capital_city.cpp:14:20: warning: statement has no effect [-Wunused-value]
   14 | #define debug(...) 0
      |                    ^
capital_city.cpp:230:4: note: in expansion of macro 'debug'
  230 |    debug(l, r);
      |    ^~~~~
capital_city.cpp:224:7: warning: unused variable 'u' [-Wunused-variable]
  224 |   int u = HLD::at[i];
      |       ^
capital_city.cpp:225:7: warning: unused variable 'v' [-Wunused-variable]
  225 |   int v = HLD::at[cityLCA[c]];
      |       ^
capital_city.cpp:14:20: warning: statement has no effect [-Wunused-value]
   14 | #define debug(...) 0
      |                    ^
capital_city.cpp:235:3: note: in expansion of macro 'debug'
  235 |   debug(i);
      |   ^~~~~
capital_city.cpp:15:17: warning: statement has no effect [-Wunused-value]
   15 | #define OI(...) 0
      |                 ^
capital_city.cpp:239:3: note: in expansion of macro 'OI'
  239 |   OI(AI(sgt.adj[i]));
      |   ^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...