제출 #834985

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8349852023-08-23 04:37:23vjudge1Ball Machine (BOI13_ballmachine)C++17
0 / 100
44 ms25796 KiB
#include<bits/stdc++.h>
#define ll long long
#define pb push_back
using namespace std;
vector<vector<ll>>graf;
vector<ll>minkir, minkan, atas;
vector<bool>penuh;
int total, akh;
void dfs(ll x, ll akhir) {
for(auto it:graf[x]) {
if(it == akhir) continue;
dfs(it,x);
}
if(graf[x].size()) {
minkir[x] = 1e18;
minkan[x] = 1e18;
return;
}
minkir[x] = min(min(minkir[graf[x][0]], minkan[graf[x][0]]), graf[x][0]);
minkan[x] = min(min(minkan[graf[x][0]], minkir[graf[x][0]]), graf[x][0]);
}
void tambah(ll x) {
if(graf[x].size() == 0 || (penuh[graf[x][0]] && penuh[graf[x][1]])) {
penuh[x] = true;
akh = x;
return;
}
if(penuh[graf[x][1]]) {
tambah(graf[x][0]);
} else
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

컴파일 시 표준 에러 (stderr) 메시지

ballmachine.cpp: In function 'int main()':
ballmachine.cpp:66:8: warning: 'root' may be used uninitialized in this function [-Wmaybe-uninitialized]
   66 |     dfs(root,0);
      |     ~~~^~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...