Submission #438983

#TimeUsernameProblemLanguageResultExecution timeMemory
438983jlozano254Distributing Candies (IOI21_candies)C++17
0 / 100
131 ms7624 KiB
#include "candies.h" #include <vector> std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l, std::vector<int> r, std::vector<int> v) { int n = c.size(); std::vector<int> s; long long int acum = 0; for (int i = 0; i < v.size(); ++i) acum += v[i]; for (int i = 0; i < n; ++i) s.push_back(std::min((int) acum, c[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:12:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   12 |     for (int i = 0; i < v.size(); ++i) acum += v[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...