Submission #1007803

# Submission time Handle Problem Language Result Execution time Memory
1007803 2024-06-25T13:37:54 Z jer033 Distributing Candies (IOI21_candies) C++17
0 / 100
5000 ms 7372 KB
#include "candies.h"

#include <vector>
#include <bits/stdc++.h>
using namespace std;

int bound(int a, int b)
{
    if (a<0)
        return 0;
    if (a>b)
        return b;
    return a;
}


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(n, 0);
    int q = v.size();
    for (int i=0; i<q; i++)
    {
        for (int j=l[i]; j<=r[i]; j++)
        {
            if (v[j]>0)
            {
                s[j] = min(c[j], s[j]+v[j]);
            }
            else
            {
                s[j] = max(c[j], s[j]+v[j]);
            }
        }
    }
    return s;
}
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 5057 ms 7372 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -