제출 #1073140

#제출 시각아이디문제언어결과실행 시간메모리
1073140Zicrus메기 농장 (IOI22_fish)C++17
0 / 100
53 ms9260 KiB
#include <bits/stdc++.h> #include "fish.h" using namespace std; typedef long long ll; int n, m; vector<int> x, y, w; ll max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) { n = N; m = M; x = X; y = Y; w = W; ll res = 0; for (int i = 0; i < n; i++) { if (x[i] == 1) res += w[i]; } ll mod = 0; map<int, int> x0; for (int i = 0; i< n; i++ ) { if (x[i] == 0) { x0[y[i]] += w[i]; } else { x0[y[i]] -= w[i]; } } ll mx = 0; for (auto &e : x0) { mod += e.second; mx = max(mx, mod); } return res + mx; } #ifdef TEST #include "grader.cpp" #endif
#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...