Submission #655863

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
6558632022-11-05 19:40:26manizareOne-Way Streets (CEOI17_oneway)C++14
100 / 100
136 ms27128 KiB
#include<bits/stdc++.h>
#define all(a) a.begin(),a.end()
#define pb push_back
using namespace std ;
const int maxn = 1e5 + 2 , maxq = 502 , inf = 1e9 , mod = 1e9+7 ;
vector <pair <int , int > > G[maxn] ;
vector <int> l[maxn] ;
int dp[maxn] ;
bool mark2[maxn] , mark[maxn] ;
int par[maxn] , cnt = 1 ,c[maxn] , pr[maxn] , pp[maxn] , dis[maxn] ;
short ans[maxn];
pair <int , int > ed[maxn] ;
void dfs(int v){
mark[v] = 1;
for(int i = 0; i < (int)G[v].size() ; i++){
int u = G[v][i].first , id = G[v][i].second ;
if(mark[u] == 1){
if(mark2[id] == 0){
dp[v] ++ ;
dp[u] -- ;
ans[id] = 3 ;
mark2[id] = 1;
}
continue ;
}
mark2[id] = 1;
par[u] = id ;
dfs(u) ;
dp[v]+=dp[u];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

oneway.cpp: In function 'void dfs3(int)':
oneway.cpp:57:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   57 |  for(int i =0 ; i < l[v].size() ; i++){
      |                 ~~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...