| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 105729 | Pro_ktmr | Fireworks (APIO16_fireworks) | C++14 | 20 ms | 14464 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define REP(i, n) for(int (i)=0; (i)<(n); (i)++)
#define PB push_back
#define MP make_pair
#define MOD 1000000007
int N, M;
vector<pair<int, LL>> edge[300001];
int par[300001];
vector<pair<LL,int>> chi[300001];
void dfs(int now, int p){
for(int i=0; i<edge[now].size(); i++){
if(edge[now][i].first == p) continue;
chi[now].PB(MP(edge[now][i].second, edge[now][i].first));
par[edge[now][i].first] = now;
dfs(edge[now][i].first, now);
}
sort(chi[now].begin(), chi[now].end());
}
int main(){
scanf("%d%d", &N, &M);
for(int i=0; i<N+M; i++){
int P;
LL C;
C--;
scanf("%d%lld", &P, &C);
edge[i].PB(MP(P, C));
edge[P].PB(MP(i, C));
}
par[0] = -1;
dfs(0, -1);
cout << 0 << endl;
}
컴파일 시 표준 에러 (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... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
