Submission #918224

#TimeUsernameProblemLanguageResultExecution timeMemory
918224Fikrat_AsadzadehEaster Eggs (info1cup17_eastereggs)C++14
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #include "grader.h" using namespace std; typedef unsigned long long ull; #define ll unsigned long long typedef vector < int > vl; typedef set < int > setl; #define F first #define S second #define all(v) v.begin(), v.end() #define pll pair < int , int > #define db double #define nll cout << "\n" #define nl endl #define sync \ ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0) ; const int MAX = 1e6 + 5; const long long inf = 1e18; vl g[550], v; void dfs(ll u, ll par){ v.push_back(u); for(auto i : g[u]){ if(u == par)continue; dfs(i, u); } } int findEgg(int N, vector < pair < int, int > bridges){ for(ll i = 1; i <= N; i++){ g[i].clear(); } for(pll i : bridges)g[i.first].push_back(i.second), g[i.second].push_back(i.first); dfs(1, 0); ll l = 0, r = N - 1, mid; while(l < r){ mid = (l + r) >> 1; vl v2; for(ll i = 0; i <= mid; i++)v2.push_back(v[i]); if(query(v2))r = mid; else l = mid + 1; } return v[l]; }

Compilation message (stderr)

eastereggs.cpp:27:47: error: template argument 1 is invalid
   27 | int findEgg(int N, vector < pair < int, int > bridges){
      |                                               ^~~~~~~
eastereggs.cpp:27:47: error: template argument 2 is invalid
eastereggs.cpp:27:47: error: template argument 1 is invalid
eastereggs.cpp:27:47: error: template argument 2 is invalid
eastereggs.cpp:27:47: error: template argument 1 is invalid
eastereggs.cpp:27:47: error: template argument 2 is invalid
eastereggs.cpp:27:20: error: 'vector' is not a type
   27 | int findEgg(int N, vector < pair < int, int > bridges){
      |                    ^~~~~~
eastereggs.cpp:27:27: error: expected ',' or '...' before '<' token
   27 | int findEgg(int N, vector < pair < int, int > bridges){
      |                           ^
eastereggs.cpp: In function 'int findEgg(int, int)':
eastereggs.cpp:28:21: warning: comparison of integer expressions of different signedness: 'long long unsigned int' and 'int' [-Wsign-compare]
   28 |     for(ll i = 1; i <= N; i++){
      |                   ~~^~~~
eastereggs.cpp:31:17: error: 'bridges' was not declared in this scope
   31 |     for(pll i : bridges)g[i.first].push_back(i.second), g[i.second].push_back(i.first);
      |                 ^~~~~~~