답안 #543987

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
543987 2022-03-31T18:24:10 Z brunnorezendes 사탕 분배 (IOI21_candies) C++17
3 / 100
5000 ms 13264 KB
#include "candies.h"
#include <bits/stdc++.h>

using namespace std;

typedef vector<int> vi;

vi distribute_candies(vi c, vi l, vi r, vi v){
	int i, j;
	int q = l.size();
	int n = c.size();
	vi val(n, 0);
	for(i=0;i<n;i++){
		for(j=0;j<q;j++){
			if(i>=l[j] && i<=r[j]){
				if(v[j]<0) val[i] = max(0, val[i]+v[j]);
				else val[i] = min(c[i], val[i]+v[j]);
			}
		}
	}
	return val;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 13 ms 312 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5089 ms 12076 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 308 KB Output is correct
2 Correct 2608 ms 8036 KB Output is correct
3 Correct 1132 ms 6024 KB Output is correct
4 Execution timed out 5083 ms 13264 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 2590 ms 7660 KB Output is correct
4 Correct 1564 ms 4012 KB Output is correct
5 Execution timed out 5019 ms 10932 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 300 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 2 ms 344 KB Output is correct
5 Correct 13 ms 312 KB Output is correct
6 Execution timed out 5089 ms 12076 KB Time limit exceeded
7 Halted 0 ms 0 KB -