Submission #918096

# Submission time Handle Problem Language Result Execution time Memory
918096 2024-01-29T13:08:14 Z Sputnik123 Easter Eggs (info1cup17_eastereggs) C++14
Compilation error
0 ms 0 KB
#include "grader.h"
#include <bits/stdc++.h>
#define ll long long 
#define int long long 
using namespace std;
vector <int> e;
vector <int> adj[700];
void dfs(ll node,par)
{
    for(ll i:adj[node])
    {
        if(i==par)  continue;
        dfs(i,node);
    }
}
int findegg(int n,vector<pair<int,int>> bridges)
{
    e.clear();
    for(ll i=0;i<n;i++)
        adj[i].clear();
    for(pair <int,int> p: bridges)
    {
        adj[p.first].push_back(p.second);
        adj[p.second].push_back(p.first);
    }
    dfs(1,1);
    ll l=0,e=e.size()-1;
    while (l < r)
    {
        int mid = (l + r) >> 1;
        vector<int> nw;
        for (int i = 0; i <= mid; i++) nw.push_back(e[i]);
        if (query(nw)) r = mid;
        else l = mid + 1;
    }
    return e[l];
}

Compilation message

eastereggs.cpp:8:18: error: 'par' has not been declared
    8 | void dfs(ll node,par)
      |                  ^~~
eastereggs.cpp: In function 'void dfs(long long int, int)':
eastereggs.cpp:12:15: error: 'par' was not declared in this scope
   12 |         if(i==par)  continue;
      |               ^~~
eastereggs.cpp: In function 'long long int findegg(long long int, std::vector<std::pair<long long int, long long int> >)':
eastereggs.cpp:27:16: error: request for member 'size' in 'e', which is of non-class type 'long long int'
   27 |     ll l=0,e=e.size()-1;
      |                ^~~~
eastereggs.cpp:28:16: error: 'r' was not declared in this scope
   28 |     while (l < r)
      |                ^
eastereggs.cpp:32:54: error: invalid types 'long long int[long long int]' for array subscript
   32 |         for (int i = 0; i <= mid; i++) nw.push_back(e[i]);
      |                                                      ^
eastereggs.cpp:33:19: error: could not convert 'nw' from 'vector<long long int>' to 'vector<int>'
   33 |         if (query(nw)) r = mid;
      |                   ^~
      |                   |
      |                   vector<long long int>
eastereggs.cpp:36:13: error: invalid types 'long long int[long long int]' for array subscript
   36 |     return e[l];
      |             ^