Submission #623037

# Submission time Handle Problem Language Result Execution time Memory
623037 2022-08-05T06:13:24 Z Hanksburger Distributing Candies (IOI21_candies) C++17
0 / 100
106 ms 8240 KB
#include "candies.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> ans;
vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v)
{
    int n=c.size(), q=v.size();
    for (int i=0; i<n; i++)
        ans.push_back(0);
    for (int i=0; i<q; i++)
    {
        ans[l[i]]+=v[i];
        if (r[i]<=n-2)
            ans[r[i]+1]-=v[i];
    }
    for (int i=1; i<n; i++)
        ans[i]+=ans[i-1];
    for (int i=0; i<n; i++)
        ans[i]=min(c[i], ans[i]);
    return ans;
}
# 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 Incorrect 106 ms 8240 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 -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 212 KB Output isn't correct
2 Halted 0 ms 0 KB -