Submission #807726

# Submission time Handle Problem Language Result Execution time Memory
807726 2023-08-04T23:24:48 Z Mouad_ouj Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 7276 KB
#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)
{
    vector<int> a;
    a.assign(c.size(),0);
    for(int y=0;y<l.size();y++)
    {
        for(int x=l[y];x<r[y];x++)
        {
            if(v[y]>0)
            a[x]=min(a[x]+v[y],c[x]);
            else
            a[x]=max(a[x]+v[y],0);
        }
    }
    return a;
}

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:8:18: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    8 |     for(int y=0;y<l.size();y++)
      |                 ~^~~~~~~~~
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5041 ms 7276 KB Time limit exceeded
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 Incorrect 1 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -