Submission #570490

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5704902022-05-30 08:36:12AlesL0Race (IOI11_race)C++17
43 / 100
3079 ms52276 KiB
#pragma GCC optimize("03")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int INF = 1e6;
int current, siz, k, timer = 0, sol = INF;
vector <pair<int, int>> updates;
void get_size(int c, vector <int> g[], bool b[], int s[]){
s[c] = 1; b[c] = 1; siz++;
for (int i = 0; i < g[c].size(); i++){
if (!b[g[c][i]]){
int h = g[c][i]; get_size(h, g, b, s);
s[c] += s[h];
}
}
b[c] = 0;
}
void dfs(int c, vector <int> g[], bool b[], int s[]){
b[c] = 1; int m = 0;
for (int i = 0; i < g[c].size(); i++){
if (!b[g[c][i]]){
int h = g[c][i]; dfs(h, g, b, s);
m = max(m, s[h]);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

race.cpp: In function 'void get_size(int, std::vector<int>*, bool*, int*)':
race.cpp:16:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   16 |     for (int i = 0; i < g[c].size(); i++){
      |                     ~~^~~~~~~~~~~~~
race.cpp: In function 'void dfs(int, std::vector<int>*, bool*, int*)':
race.cpp:27:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   27 |     for (int i = 0; i < g[c].size(); i++){
      |                     ~~^~~~~~~~~~~~~
race.cpp: In function 'void solve(int, std::vector<int>*, std::vector<int>*, bool*, std::pair<int, int>*, ll, int)':
race.cpp:46:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   46 |     for (int i = 0; i < g[c].size(); i++){
      |                     ~~^~~~~~~~~~~~~
race.cpp: In function 'void centroid_decomposition(int, std::vector<int>*, std::vector<int>*, bool*, int*, std::pair<int, int>*)':
race.cpp:55:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   55 |     for (int i = 0; i < g[r].size(); i++){
      |                     ~~^~~~~~~~~~~~~
race.cpp:59:31: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<std::pair<int, int> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |             for (int j = 0; j < updates.size(); j++)d[updates[j].first].first = min(d[updates[j].first].first, updates[j].second);
      |                             ~~^~~~~~~~~~~~~~~~
race.cpp:64:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   64 |     for (int i = 0; i < g[r].size(); 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...