Submission #236641

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2366412020-06-02 16:59:27bharat2002One-Way Streets (CEOI17_oneway)C++14
100 / 100
212 ms33000 KiB
#include<bits/stdc++.h>
using namespace std;
const int N=1e5 + 2;
const int N2=19;
const int mod=1e9 + 7;
const int inf=INT_MAX;
#define pii pair<int, int>
#define f first
#define s second
#define mp make_pair
#define FOR(i, n) for(int i=1;i<=n;i++)
#define TRACE(x) cerr << #x << " = " << x << endl
int n, m, P;vector< pii > adj[N], adjlist[N];
pii arr[N];int disc[N], low[N], cur, cno[N], p[N][N2], addu[N], addv[N], sub[N],ent[N], ex[N], depth[N];
bool art[N];bool dup[N];string ans;
vector< pii > edges;
void dfs(int i, int p)
{
disc[i]=cur++;low[i]=disc[i];
int ct=0;
for(auto j:adj[i])
{
if(j.f==p) ct++;
if(j.f==p) continue;
if(disc[j.f]==inf)
{
dfs(j.f, i);
if(low[j.f]>disc[i]) art[j.s]=1;
low[i]=min(low[i], low[j.f]);
}
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

oneway.cpp: In function 'void solve()':
oneway.cpp:115:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for(int i=1;i<=P;i++) cin>>arr[i].f>>arr[i].s;cur=1;
  ^~~
oneway.cpp:115:48: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  for(int i=1;i<=P;i++) cin>>arr[i].f>>arr[i].s;cur=1;
                                                ^~~
oneway.cpp:124:2: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
  if(dup[i]) art[i]=0;cur=1;
  ^~
oneway.cpp:124:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
  if(dup[i]) art[i]=0;cur=1;
                      ^~~
oneway.cpp:123:2: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
  for(int i=0;i<m;i++) 
  ^~~
oneway.cpp:124:22: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
  if(dup[i]) art[i]=0;cur=1;
                      ^~~
oneway.cpp: In function 'void dfsf(int)':
oneway.cpp:92:19: warning: 'pind' may be used uninitialized in this function [-Wmaybe-uninitialized]
   int u=edges[pind].f, v=edges[pind].s;
                   ^
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...