Submission #1260867

#TimeUsernameProblemLanguageResultExecution timeMemory
1260867rayan_bdCatfish Farm (IOI22_fish)C++20
Compilation error
0 ms0 KiB
#include "fish.h" #include <bits/stdc++.h> using namespace std; long long max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W) { vector<long long> x(2, 0); for(int i = 0; i < M; ++i){ x[X[i]] += W[i]; } long long ans = max(x[0], x[1]); if(N <= 2){ return ans; }else{ vector<pair<int, int>> v1, v2; for(int i = 0; i < M; ++i){ if(X[i] == 0) v1.push_back({Y[i], W[i]}); else v2.push_back({Y[i], W[i]}); } sort(v1.begin(), v1.end()); sort(v2.begin(), v2.end()); for(int i = 0, rem = 0, add = 0, iptr = 0, jptr = 0; i < N; ++i){ while(iptr < v1.size() && v1[iptr].first <= i){ add += v1[iptr].second; ++iptr; } while(jptr < v2.size() && v2[jptr].first <= i){ rem += v2[iptr].second; ++jptr; } ans = max(ans, x[1] - rem + add); } return ans; } } signed main(){ return 0; }

Compilation message (stderr)

/usr/bin/ld: /tmp/ccfcE1rh.o: in function `main':
grader.cpp:(.text.startup+0x0): multiple definition of `main'; /tmp/ccztbwzA.o:fish.cpp:(.text.startup+0x0): first defined here
collect2: error: ld returned 1 exit status