Submission #976255

#TimeUsernameProblemLanguageResultExecution timeMemory
976255efedmrlrPastiri (COI20_pastiri)C++17
0 / 100
68 ms444 KiB
// #pragma GCC optimize("O3,Ofast,unroll-loops") // #pragma GCC target("avx2,bmi,popcnt") #include <bits/stdc++.h> #define lli long long int #define ld long double #define REP(i, n) for(int i = 0; (i) < (n); (i)++) #define all(x) x.begin(), x.end() #define rall(x) x.rbegin(), x.rend() #define pb push_back #define MP make_pair using namespace std; void fastio() { ios_base::sync_with_stdio(false); cin.tie(NULL); } const int N = 1e5 + 5; const int INF = 1e9 + 500; const int MOD = 1e9 + 7; void solve() { int n, k; cin >> n >> k; REP(i, n - 1) { int u, v; cin >> u >> v; } vector<int> o(k); REP(i, k) { cin >> o[i]; } int od = 0; for(auto c : o) { if(c & 1) od++; } int res = (od - 1) / 2 + 1; od = k - od; res += (od - 1) / 2 + 1; cout << res << "\n"; } signed main() { fastio(); solve(); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...