답안 #243046

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
243046 2020-06-30T08:10:08 Z soyeon_ss Easter Eggs (info1cup17_eastereggs) C++14
0 / 100
9 ms 5376 KB
#include <bits/stdc++.h>
#include "grader.h"
//#define int long long
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define for1(i, a, b) for(i = a; i <= b; ++i)
#define for0(i, a, b) for(i = a; i < b; ++i)
#define forw1(i, a, b) for(i = a; i >= b; --i)
#define forw0(i, a, b) for(i = a - 1; i >= b; --i)
#define fora(v, a) for(auto v : a)
#define bp __builtin_popcount
#define bpll __builtin_popcountll
 
using namespace std;
using cd = complex<double>;
 
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<cd> vcd;
typedef vector<ii> vii;
typedef vector<vector<int> > vvi;
 
const int modd1 = 1e9 + 7, modd2 = 998244353, maxn = 1e5 + 10, K = 26, inf = 1e9, infll = 1e18;
const double pi = acos(-1);
int n, m, used[maxn];
vi gr[maxn], tp;
 
int dfs(int st){
	used[st] = 1;
	tp.pb(st);
	int i, j, k, l, r;
	for0(i, 0, (int)gr[st].size()){
		if(!used[gr[st][i]]){
			dfs(gr[st][i]);
		}
	}
}
 
int binsearch(int lo, int hi){
	if(lo == hi){
		return lo;
	}
	int mid = (lo + hi) >> 1;
	int i; vi kk;
	for1(i, 0, mid){
		kk.pb(tp[i]);
	}
	if(query(kk)){
		return binsearch(lo, mid);
	}
	else{
		return binsearch(mid + 1, hi);
	}
}
 
int findEgg(int N, vii bridges){
	int i;
	for0(i, 1, N){
		gr[bridges[i - 1].fi].pb(bridges[i - 1].se);
		gr[bridges[i - 1].se].pb(bridges[i - 1].fi);
	}
	dfs(1);
	return tp[binsearch(0, n - 1)];
}

Compilation message

eastereggs.cpp:26:91: warning: overflow in implicit constant conversion [-Woverflow]
 const int modd1 = 1e9 + 7, modd2 = 998244353, maxn = 1e5 + 10, K = 26, inf = 1e9, infll = 1e18;
                                                                                           ^~~~
eastereggs.cpp: In function 'int dfs(int)':
eastereggs.cpp:34:9: warning: unused variable 'j' [-Wunused-variable]
  int i, j, k, l, r;
         ^
eastereggs.cpp:34:12: warning: unused variable 'k' [-Wunused-variable]
  int i, j, k, l, r;
            ^
eastereggs.cpp:34:15: warning: unused variable 'l' [-Wunused-variable]
  int i, j, k, l, r;
               ^
eastereggs.cpp:34:18: warning: unused variable 'r' [-Wunused-variable]
  int i, j, k, l, r;
                  ^
eastereggs.cpp:40:1: warning: no return statement in function returning non-void [-Wreturn-type]
 }
 ^
# 결과 실행 시간 메모리 Grader output
1 Runtime error 9 ms 5376 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 9 ms 5248 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 9 ms 5248 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -