# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
383073 | DarkVoid | Traffic (IOI10_traffic) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#pragma GCC optimize("unroll-loops, O3")
#pragma GCC target("avx")
#include <bits/stdc++.h>
using namespace std;
int n, a[1000000], cnt[1000000], mx[1000000];
vector<int> adj[1000000];
void dfs(int vtx, int pre){
mx[vtx] = 0, cnt[vtx] = a[vtx];
for(int i : adj[vtx])
if(i != pre){
dfs(i, vtx);
cnt[vtx] += cnt[i];
mx[vtx] = max(mx[vtx], cnt[i]);
}
}
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin >> n;
for(int i = 0; i < n; i++) cin >> a[i];
for(int i = 1; i < n; i++){
int u, v;
cin >> u >> v;
adj[u].push_back(v);
adj[v].push_back(u);
}
dfs(0, -1);
pair<int, int> ans(INT_MAX, -1);
for(int i = 0; i < n; i++)
ans = min(ans, make_pair(max(cnt[0] - cnt[i], mx[i]), i));
cout << ans.second << '\n';
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
traffic.cpp:1:40: warning: bad option '-f O3' to pragma 'optimize' [-Wpragmas] 1 | #pragma GCC optimize("unroll-loops, O3") | ^ traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] 2 | #pragma GCC target("avx") | ^ traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] traffic.cpp:2:25: warning: bad option '-f O3' to attribute 'optimize' [-Wattributes] /var