Submission #373001

#TimeUsernameProblemLanguageResultExecution timeMemory
373001sam571128Magenta (COCI21_magenta)C++14
30 / 110
68 ms9312 KiB
#include <bits/stdc++.h> #define int long long #define fastio ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); using namespace std; const int N = 1e5+5; vector<int> adj[N]; int dis[N]; void dfs(int u, int par){ for(auto v : adj[u]){ if(v==par) continue; dis[v] = dis[u]+1; dfs(v,u); } } signed main(){ fastio int n; cin >> n; int a,b; cin >> a >> b; for(int i = 1;i < n;i++){ int u,v; string s; cin >> u >> v >> s; adj[u].push_back(v); adj[v].push_back(u); } dfs(a,-1); if(dis[b]&1^1){ cout << "Paula\n"; }else{ cout << "Marin\n"; } }

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:33:11: warning: suggest parentheses around arithmetic in operand of '^' [-Wparentheses]
   33 |  if(dis[b]&1^1){
      |     ~~~~~~^~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...