Submission #625545

#TimeUsernameProblemLanguageResultExecution timeMemory
625545clamsCatfish Farm (IOI22_fish)C++17
3 / 100
102 ms7280 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; ll max_weights(int n, int m, vector<int> x, vector<int> y, vector<int> w) { bool issub1 = 1; for (int i = 0; i < m; i++) { if (x[i] & 1) { issub1 = 0; break; } } if (issub1) { // just sum up every thing ll ans = accumulate(w.begin(), w.end(), 0LL); return ans; } bool issub2 = 1; for (int i = 0; i < m; i++) { if (x[i] > 1) { issub2 = 0; break; } } if (issub2) { // there is only two columns vector<ll> col(2); for (int i = 0; i < m; i++) { col[x[i]] += w[i]; } return max(col[0], col[1]); } return 0; } //int main() { // int tmp = 2e9; // cout << max_weights(5, 4, {1, 0, 1, 0}, {2, 1, 4, 3}, {tmp, tmp, tmp, tmp}) << '\n'; // cout << max_weights(5, 4, {0, 1, 4, 3}, {2, 1, 4, 3}, {5, 2, 1, 3}) << '\n'; //}
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...