Submission #1246635

#TimeUsernameProblemLanguageResultExecution timeMemory
12466352008Nile (IOI24_nile)C++20
0 / 100
2093 ms2628 KiB
#include "nile.h"
#include <bits/stdc++.h>
using namespace std;

std::vector<long long> calculate_costs(std::vector<int> W, std::vector<int> A,
                                       std::vector<int> B, std::vector<int> E) {
  int Q = (int)E.size();
  int S = (int)W.size();
  vector<long long> R(Q, 0);
  long long value;
  sort(W.begin(), W.end());
  for (int q=0; q<Q; q++) {
    value=0;
    for (int s=0; s<S; s+=0) {
      if (s<S-2 && W[s]+E[q]>=W[s+1]) {
        value+=2;
        s+=2;
      }
      if (s<S-1 && W[s]+E[q]<W[s+1]) {
        value+=2;
        s+=1;
      }
      if (s==S-1) {
        value+=2;
        s++;
      }
    }
    R[q]=value;
  }
  return R;
}
#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...