Submission #720586

# Submission time Handle Problem Language Result Execution time Memory
720586 2023-04-08T14:54:03 Z Ahmed57 Mag (COCI16_mag) C++14
Compilation error
0 ms 0 KB
//LCA
#include <bits/stdc++.h>

using namespace std;

signed main(){
    cin>>n;
    for(int i = 0;i<n-1;i++){
        int a,b;cin>>a>>b;
        adj[a].push_back(b);
        adj[b].push_back(a);
    }
    long long mi = 1e18;
    for(int i = 0;i<n;i++){
        cin>>ma[i+1];
        mi = min(mi,ma[i+1]);
    }
    calc(1,0);
    dfs(1,0);
    if(mi!=1)cout<<mi<<"/"<<1<<endl;
    else cout<<2<<"/"<<2*maa+1<<endl;
}

Compilation message

mag.cpp: In function 'int main()':
mag.cpp:7:10: error: 'n' was not declared in this scope; did you mean 'yn'?
    7 |     cin>>n;
      |          ^
      |          yn
mag.cpp:10:9: error: 'adj' was not declared in this scope
   10 |         adj[a].push_back(b);
      |         ^~~
mag.cpp:15:14: error: 'ma' was not declared in this scope; did you mean 'mi'?
   15 |         cin>>ma[i+1];
      |              ^~
      |              mi
mag.cpp:18:5: error: 'calc' was not declared in this scope
   18 |     calc(1,0);
      |     ^~~~
mag.cpp:19:5: error: 'dfs' was not declared in this scope; did you mean 'ffs'?
   19 |     dfs(1,0);
      |     ^~~
      |     ffs
mag.cpp:21:26: error: 'maa' was not declared in this scope
   21 |     else cout<<2<<"/"<<2*maa+1<<endl;
      |                          ^~~