# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
30683 | noobprogrammer | Bosses (BOI16_bosses) | C++14 | 666 ms | 2352 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std ;
typedef long long ll ;
#define ii pair<int,int>
#define fi first
#define se second
#define vi vector<int>
#define vii vector<ii>
int n , m , visited[5005] , h[5005] ;
ll dp[5005] , res = 1e18 ;
queue<int> q ;
vi adj[5005] ;
void bfs(int x){
memset(visited , 0 , sizeof visited) ;
q.push(x);
h[x] = 1 ;
ll sum = 0 ;
visited[x] = 1 ;
int cur ,cnt = 0 ;
while(!q.empty()){
cur = q.front() ;
q.pop() ;
cnt++ ;
sum += (ll)h[cur] ;
for(int v : adj[cur]){
if(visited[v]) continue ;
visited[v] = 1 ; h[v] = h[cur] + 1 ;
q.push(v) ;
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |