답안 #435498

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
435498 2021-06-23T11:30:25 Z kshitij_sodani 사탕 분배 (IOI21_candies) C++17
3 / 100
5000 ms 7276 KB
#include <bits/stdc++.h>
using namespace std;
#define a first
#define b second
#define pb push_back
typedef long long llo;

#include "candies.h"

#include <vector>
int cur[200001];
std::vector<int> distribute_candies(vector<int> it,vector<int> ll,
                                    vector<int> rr,vector<int> aa) {
    
	int n=it.size();
	int q=ll.size();
	for(int i=0;i<n;i++){
		cur[i]=0;
	}
	for(int i=0;i<q;i++){
		for(int j=ll[i];j<=rr[i];j++){
			cur[j]+=aa[i];
			cur[j]=max(cur[j],0);
			cur[j]=min(cur[j],it[j]);
		}
	}
	vector<int> ans;
	for(int i=0;i<n;i++){
		ans.pb(cur[i]);
	}










    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 4 ms 332 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5036 ms 7236 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 282 ms 5028 KB Output is correct
3 Correct 332 ms 4708 KB Output is correct
4 Execution timed out 5028 ms 7272 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 708 ms 5024 KB Output is correct
4 Correct 669 ms 3828 KB Output is correct
5 Execution timed out 5045 ms 7276 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 1 ms 204 KB Output is correct
3 Correct 1 ms 332 KB Output is correct
4 Correct 1 ms 332 KB Output is correct
5 Correct 4 ms 332 KB Output is correct
6 Execution timed out 5036 ms 7236 KB Time limit exceeded
7 Halted 0 ms 0 KB -