Submission #226791

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2267912020-04-25 10:46:09bharat2002Race (IOI11_race)C++14
100 / 100
986 ms30456 KiB
/*input
11 12
0 1 3
0 2 4
2 3 5
3 4 4
4 5 6
0 6 3
6 7 2
6 8 5
8 9 6
8 10 7
*/
#include<bits/stdc++.h>
#include "race.h"
using namespace std;
const int N=2e5 + 100;
const int mod=1e9 + 7;
const int inf=1e7;
#define pii pair<int, int>
#define f first
#define s second
#define mp make_pair
//Trace prints the name of the variable and the value.
int k, n;vector< pii > adjlist[N];
queue<int> roots;bool cent[N];
class Cent
{
bool visited[N];
int sum[N];stack<int> cvals;
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

race.cpp: In member function 'bool Cent::solve()':
race.cpp:50:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    if(visited[i]||cent[i]) continue;check=1;
    ^~
race.cpp:50:37: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    if(visited[i]||cent[i]) continue;check=1;
                                     ^~~~~
race.cpp: In function 'int best_path(int, int, int (*)[2], int*)':
race.cpp:125:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  if(optans==inf) return -1;return optans;
  ^~
race.cpp:125:28: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  if(optans==inf) return -1;return optans;
                            ^~~~~~
race.cpp:106:17: warning: unused variable 'iter' [-Wunused-variable]
  tally[0]=0;int iter=0;
                 ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...