답안 #1046305

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1046305 2024-08-06T12:43:39 Z Malix 사탕 분배 (IOI21_candies) C++17
3 / 100
5000 ms 13392 KB
#include "candies.h"
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<vi> vii;
typedef pair<int,int> pi;
typedef vector<pi> pii;
typedef tuple<int,int,int> tii;

#define REP(i,a,b) for(int i=a;i<b;i++)
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define LSOne(s) ((s)&(-s))

ll INF=1e18+10;
int inf=1e9+10;
ll M=1e9+7;


std::vector<int> distribute_candies(std::vector<int> c, std::vector<int> l,
                                    std::vector<int> r, std::vector<int> v) {
    int n=c.size();int q=l.size();
    vi ans(n,0);
    REP(i,0,q)REP(j,l[i],r[i]+1)ans[j]=max(0,min(c[j],ans[j]+v[i]));
    return ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Execution timed out 5084 ms 12268 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 344 KB Output is correct
2 Correct 113 ms 8016 KB Output is correct
3 Correct 146 ms 5956 KB Output is correct
4 Execution timed out 5062 ms 13392 KB Time limit exceeded
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 269 ms 7772 KB Output is correct
4 Correct 270 ms 4032 KB Output is correct
5 Execution timed out 5077 ms 10860 KB Time limit exceeded
6 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 348 KB Output is correct
2 Correct 0 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 348 KB Output is correct
5 Correct 2 ms 348 KB Output is correct
6 Execution timed out 5084 ms 12268 KB Time limit exceeded
7 Halted 0 ms 0 KB -