Submission #803135

# Submission time Handle Problem Language Result Execution time Memory
803135 2023-08-02T23:09:41 Z vjudge1 Distributing Candies (IOI21_candies) C++17
0 / 100
79 ms 9180 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) {
    int n = c.size(), q = l.size();
    vector<long long> s(n+1);
    for(int i = 0; i < q; i++)
        s[l[i]]+=v[i], s[r[i]+1]-=v[i];
    partial_sum(s.begin(), s.end(), s.begin());
    s.pop_back();
    vector<int> s2;
    for(int i = 0; i < n; i++)
        s2.push_back((s[i], (long long)c[i]));
    return s2;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 79 ms 9180 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 Correct 1 ms 212 KB Output is correct
2 Incorrect 0 ms 212 KB Output isn't correct
3 Halted 0 ms 0 KB -