Submission #1037502

# Submission time Handle Problem Language Result Execution time Memory
1037502 2024-07-29T01:38:01 Z HappyCapybara Catfish Farm (IOI22_fish) C++17
0 / 100
16 ms 7256 KB
#include "fish.h"
#include <bits/stdc++.h>
using namespace std;
 
#define ll long long
 
ll max_weights(int N, int M, vector<int> X, vector<int> Y, vector<int> W){
  vector<ll> pa(N, 0ll), pb(N, 0ll);
  for (int i=0; i<N; i++){
    if (X[i] == 1) pb[Y[i]] = (ll) W[i];
    else pa[Y[i]] = (ll) W[i];
  }
  ll bsf = 0;
  for (int i=0; i<N; i++){
    if (i != 0){
        pa[i] += pa[i-1];
        pb[i] += pb[i-1];
    }
    bsf = max(bsf, pa[i]-pb[i]);
  }
  return pb[N-1] + bsf;
}
# Verdict Execution time Memory Grader output
1 Runtime error 16 ms 7256 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB 1st lines differ - on the 1st token, expected: '2', found: '1'
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 2 ms 3676 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 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 348 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 348 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 Runtime error 2 ms 3676 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Runtime error 16 ms 7256 KB Execution killed with signal 11
2 Halted 0 ms 0 KB -