답안 #440509

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
440509 2021-07-02T11:01:49 Z MetalPower 사탕 분배 (IOI21_candies) C++17
3 / 100
5000 ms 13252 KB
#include <bits/stdc++.h>
using namespace std;

#include "candies.h"

vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v){

	int N = c.size(), Q = v.size();
	vector<int> ans(N, 0);

	for(int i = 0; i < Q; i++){
		for(int j = l[i]; j <= r[i]; j++){
			if(v[i] < 0) ans[j] = max(0, ans[j] + v[i]);
			else if(v[i] > 0) ans[j] = min(c[j], ans[j] + v[i]);
		}
	}

	return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 3 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5094 ms 7232 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 222 ms 5072 KB Output is correct
3 Correct 229 ms 6012 KB Output is correct
4 Execution timed out 5014 ms 13252 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 590 ms 5020 KB Output is correct
4 Correct 586 ms 2796 KB Output is correct
5 Execution timed out 5089 ms 7236 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 2 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 3 ms 332 KB Output is correct
6 Execution timed out 5094 ms 7232 KB Time limit exceeded
7 Halted 0 ms 0 KB -