Submission #989117

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
9891172024-05-27 14:36:59aykhnBitaro’s Party (JOI18_bitaro)C++17
100 / 100
1277 ms437768 KiB
#include <bits/stdc++.h>
using namespace std;
const int MXN = 2e5 + 5;
const int B = 500;
int n, m, q;
vector<int> adj[MXN];
int used[MXN], dp[MXN], inq[MXN], in[MXN];
vector<array<int, 2>> b[MXN];
vector<int> o;
void init(int a)
{
used[a] = 1;
b[a].push_back({0, a});
vector<array<int, 2>> nw;
for (int v : adj[a])
{
if (!used[v]) init(v);
nw.clear();
int i = 0, j = 0;
while (nw.size() < B + 1 && i < b[a].size() && j < b[v].size())
{
if (in[b[a][i][1]])
{
i++;
continue;
}
 
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

bitaro.cpp: In function 'void init(int)':
bitaro.cpp:24:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |         while (nw.size() < B + 1 && i < b[a].size() && j < b[v].size())
      |                                     ~~^~~~~~~~~~~~~
bitaro.cpp:24:58: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   24 |         while (nw.size() < B + 1 && i < b[a].size() && j < b[v].size())
      |                                                        ~~^~~~~~~~~~~~~
bitaro.cpp:39:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   39 |         while (nw.size() < B + 1 && i < b[a].size()) if (in[b[a][i][1]] && ++i) continue; else nw.push_back(b[a][i]), in[b[a][i++][1]] = 1;
      |                                     ~~^~~~~~~~~~~~~
bitaro.cpp:40:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::array<int, 2> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |         while (nw.size() < B + 1 && j < b[v].size()) if (in[b[v][j][1]] && ++j) continue; else nw.push_back({b[v][j][0] + 1, b[v][j][1]}), in[b[v][j++][1]] = 1;
      |                                     ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...