# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
778246 | 2023-07-10T07:47:15 Z | vjudge1 | Deblo (COCI18_deblo) | C++17 | 34 ms | 14364 KB |
#include <bits/stdc++.h> using namespace std; #define int long long #define faster ios_base::sync_with_stdio(false);cin.tie(NULL); #define OYY 1000000005 #define mod 998244353 #define mid (start+end)/2 int dizi[100005],n,cev=0; vector <int> v[100005]; void dfs(int node,int ata,int tut){ int cur=0; for(int i=0;i<v[node].size();i++){ if(v[node][i]==ata)continue; cur^=dizi[v[node][i]]; //cout<<"e "<<cur<<endl; dfs(v[node][i],node,cur); } cev+=cur; cev+=tut; // cout<<node<<" "<<cev<<endl; } int32_t main(){ faster cin>>n; int c=0; for(int i=1;i<=n;i++){ cin>>dizi[i]; c+=dizi[i]; } for(int i=1;i<n;i++){ int a,b; cin>>a>>b; v[a].push_back(b); v[b].push_back(a); } dfs(1,0,0); cout<<cev<<'\n'; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
2 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
3 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
4 | Incorrect | 2 ms | 2644 KB | Output isn't correct |
5 | Incorrect | 1 ms | 2644 KB | Output isn't correct |
6 | Incorrect | 34 ms | 14364 KB | Output isn't correct |
7 | Incorrect | 31 ms | 14292 KB | Output isn't correct |
8 | Incorrect | 28 ms | 8440 KB | Output isn't correct |
9 | Incorrect | 28 ms | 7660 KB | Output isn't correct |
10 | Incorrect | 34 ms | 7172 KB | Output isn't correct |