Submission #602713

#TimeUsernameProblemLanguageResultExecution timeMemory
602713SifferDistributing Candies (IOI21_candies)C++17
3 / 100
5046 ms13268 KiB
#include "candies.h" #include<bits/stdc++.h> using namespace std; vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) { int n = c.size(); vector<int> s(n,0); for(int i = 0; i < l.size(); i++) { for(int j = l[i]; j <= r[i]; j++) { s[j] = max(0,min(c[j],s[j]+v[i])); } } return s; }

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:9:22: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    9 |     for(int i = 0; i < l.size(); i++) {
      |                    ~~^~~~~~~~~~
#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...