(UPD: 2024-12-04 14:48 UTC) Judge is not working due to Cloudflare incident. (URL) We can do nothing about it, sorry. After the incident is resolved, we will grade all submissions.

Submission #826550

#TimeUsernameProblemLanguageResultExecution timeMemory
826550SebDistributing Candies (IOI21_candies)C++17
3 / 100
5082 ms13280 KiB
#include "candies.h" #include <bits/stdc++.h> using namespace std; typedef long long ll; std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l, std::vector<int> r, std::vector<int> v) { ll n = c.size(); vector <int> ans(n); for (int j=0;j<l.size();j++) for (int i=l[j];i<=r[j];i++) ans[i] = max(min(c[i],ans[i]+v[j]),0); return ans; }

Compilation message (stderr)

candies.cpp: In function 'std::vector<int> distribute_candies(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
candies.cpp:11:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   11 |     for (int j=0;j<l.size();j++) for (int i=l[j];i<=r[j];i++) ans[i] = max(min(c[i],ans[i]+v[j]),0);
      |                  ~^~~~~~~~~
#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...