Submission #819910

# Submission time Handle Problem Language Result Execution time Memory
819910 2023-08-10T15:21:50 Z Marco_Escandon Distributing Candies (IOI21_candies) C++17
8 / 100
80 ms 12128 KB
#include<bits/stdc++.h>
typedef long long  ll;
using namespace std;
std::vector<int> distribute_candies(std::vector<int> cad, std::vector<int> l, std::vector<int> r, std::vector<int> v)
{
    ll t[cad.size()+5]={};
    ll n=cad.size();
    for(int i=0; i<l.size(); i++)
    {
        t[l[i]]+=v[i];
        t[r[i]+1]-=v[i];
    }
    cad[0]=min(t[0],(ll)cad[0]);
    for(int i=1; i<n; i++)
    {
        t[i]+=t[i-1];
        cad[i]=min(t[i],(ll)cad[i]);
    }
    return cad;
}

Compilation message

candies.cpp: In function 'std::vector<int> distribute_candies(std::vector<int>, std::vector<int>, std::vector<int>, std::vector<int>)':
candies.cpp:9:19: 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 time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 80 ms 8012 KB Output is correct
2 Correct 77 ms 12128 KB Output is correct
3 Correct 80 ms 11980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 212 KB Output is correct
2 Incorrect 1 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -