Submission #1001516

# Submission time Handle Problem Language Result Execution time Memory
1001516 2024-06-19T05:15:08 Z farrellw Distributing Candies (IOI21_candies) C++17
0 / 100
62 ms 12232 KB
#include "candies.h"
using namespace std;

#include <vector>


vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v) {
    int n = c.size();
    int q = l.size();
    vector<int> s(n);

    if(n <= 2000 && q <= 2000) {
    	for(int i = 0; i < q; i++) {
    		for(int j = l[i]; j <= r[i]; j++) {
    			s[j] = s[j] + v[i];
    			if(s[j] < 0) {
    				s[j] = 0;
    			}
    			if(s[j] > c[j]) {
    				s[j] = v[j];
    			}
    		}
    	}
    }

    return s;
}


# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 62 ms 12232 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
2 Incorrect 35 ms 8020 KB Output isn't correct
3 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 1 ms 344 KB Output isn't correct
2 Halted 0 ms 0 KB -