Submission #1231567

#TimeUsernameProblemLanguageResultExecution timeMemory
1231567tamzidNile (IOI24_nile)C++20
Compilation error
0 ms0 KiB
#include "nile.h"
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

std::vector<long long> calculate_costs(std::vector<int> W, std::vector<int> A,
                                       std::vector<int> B, std::vector<int> E) {
  int n = (int)W.size();  
  int Q = (int)E.size();
  std::vector<long long> R(Q, 0);
  ll s = 0;
  for(int i=0;i<n;++i)
  {
    s = s + (1LL * b[i]);
  }
  if(n % 2 == 0)
  {
    for(int i=0;i<Q;++i)
        R[i] = s;
  }
  else
  {
    ll c = 1e18;
    for(int i=0;i<n;++i)
    {
        c = min(c,a[i] - b[i]);
    }
    s += c;
    for(int i=0;i<Q;++i)
        R[i] = s;
  }
  return R;
}

Compilation message (stderr)

nile.cpp: In function 'std::vector<long long int> calculate_costs(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
nile.cpp:14:20: error: 'b' was not declared in this scope
   14 |     s = s + (1LL * b[i]);
      |                    ^
nile.cpp:26:19: error: 'a' was not declared in this scope
   26 |         c = min(c,a[i] - b[i]);
      |                   ^
nile.cpp:26:26: error: 'b' was not declared in this scope
   26 |         c = min(c,a[i] - b[i]);
      |                          ^