# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
724353 | 2023-04-15T06:26:47 Z | raul2008487 | Catfish Farm (IOI22_fish) | C++17 | 84 ms | 7268 KB |
#include "fish.h" #include <vector> long long max_weights(int N, int M, std::vector<int> X, std::vector<int> Y, std::vector<int> W) { long long i,ans=0; if(N==2){ long long ans1=0,ans2=0; for(i=0;i<W.size();i++){ if(X[i]==1){ ans1+=W[i]; } else{ ans2+=W[i]; } } if(ans1>ans2){ return ans1; } else{ return ans2; } } else{ long long cur1=0,cur2=0,w1=0; for(i=0;i<W.size();i++){ if(X[i]==1){ w1+=W[i]; } } long long cx=0; for(i=0;i<W.size();i++){ if(X[i]==0){ cur1+=W[i]; } else{ cur2+=W[i]; } if((cur1-cur2)>cx){ cx=cur1-cur2; } } return w1+cx; } }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 19 ms | 2132 KB | Output is correct |
2 | Correct | 25 ms | 2644 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Incorrect | 84 ms | 7268 KB | 1st lines differ - on the 1st token, expected: '149814460735479', found: '0' |
6 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 41 ms | 3988 KB | 1st lines differ - on the 1st token, expected: '40604614618209', found: '40621475040444' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | 1st lines differ - on the 1st token, expected: '882019', found: '0' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | 1st lines differ - on the 1st token, expected: '3', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | 1st lines differ - on the 1st token, expected: '3', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 0 ms | 212 KB | 1st lines differ - on the 1st token, expected: '3', found: '1' |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 212 KB | Output is correct |
2 | Incorrect | 0 ms | 212 KB | 1st lines differ - on the 1st token, expected: '882019', found: '0' |
3 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 19 ms | 2132 KB | Output is correct |
2 | Correct | 25 ms | 2644 KB | Output is correct |
3 | Correct | 0 ms | 212 KB | Output is correct |
4 | Correct | 0 ms | 212 KB | Output is correct |
5 | Incorrect | 84 ms | 7268 KB | 1st lines differ - on the 1st token, expected: '149814460735479', found: '0' |
6 | Halted | 0 ms | 0 KB | - |