답안 #616099

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
616099 2022-07-31T20:36:54 Z pere_gil 사탕 분배 (IOI21_candies) C++17
3 / 100
5000 ms 7276 KB
#include "candies.h"
#include "bits/stdc++.h"
using namespace std;

#define vi vector<int>

vi distribute_candies(vi c, vi l, vi r, vi v) {
    int n = c.size();
	int q=l.size();
	
	vector<int> res(n,0);
	for(int i=0;i<q;i++){
		for(int j=l[i];j<=r[i];j++){
			res[j]+=v[i];
			if(res[j]>c[j]) res[j]=c[j];
			if(res[j]<0) res[j]=0;
		}
	}
	return res;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 3 ms 340 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5040 ms 7276 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 239 ms 5028 KB Output is correct
3 Correct 219 ms 3832 KB Output is correct
4 Execution timed out 5087 ms 7268 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 484 ms 5080 KB Output is correct
4 Correct 497 ms 2804 KB Output is correct
5 Execution timed out 5046 ms 7276 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 1 ms 340 KB Output is correct
5 Correct 3 ms 340 KB Output is correct
6 Execution timed out 5040 ms 7276 KB Time limit exceeded
7 Halted 0 ms 0 KB -