QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#524445#1140. Distributing CandiesFadel_elsenusi#0 0ms0kbC++17634b2024-08-19 17:51:592024-08-19 17:51:59

Judging History

你现在查看的是最新测评结果

  • [2024-08-19 17:51:59]
  • 评测
  • 测评结果:0
  • 用时:0ms
  • 内存:0kb
  • [2024-08-19 17:51:59]
  • 提交

answer

#include "candies.h"
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
vector<int> distribute_candies(vector<int> c, vector<int> l,vector<int> r, vector<int> v){
    int sz=0,vsz=0;
    vector<int>arr;
    for(auto i:c)
        sz++;
    for(auto i:v)
        vsz++;
    for(int i=0;i<=sz;++i){
        arr[i]=0;
    }
    for(int i=0;i<vsz;++i){
        arr[l[i]]+=v[i];
        arr[r[i]+1]-=v[i];
    }
    for(int i=1;i<sz;++i){
        arr[i]+=arr[i-1];
    }
    for(int i=0;i<sz;++i){
        arr[i]=min(arr[i],c[i]);
        arr[i]=max(0,arr[i]);
    }
    return arr;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Runtime Error

Test #1:

score: 0
Runtime Error

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
8
1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000 1000000000
8
0 7 1
0 7 1
0 7 300000000
0 7 994967293
0 7 1
0 7 1000000000
0 7 1000000000
0 7 1000000000

output:

Unauthorized output

result:


Subtask #2:

score: 0
Runtime Error

Test #6:

score: 0
Runtime Error

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
200000
11408901 370732653 37843 28 53693 15782410 103 297546 1112427 170319071 26 1 6172 11614171 431 884673599 1 3 50085 154 57 28200 145886 898969 74758 72 845768 6 69787 11 31012465 55362 253 2363145 47186217 1103 19622 594 7867 1 4299 28130 48 4689582 12 ...

output:

Unauthorized output

result:


Subtask #3:

score: 0
Runtime Error

Test #9:

score: 0
Runtime Error

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
1000
1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000 1000...

output:

Unauthorized output

result:


Subtask #4:

score: 0
Runtime Error

Test #16:

score: 0
Runtime Error

input:

lrts0z0ktpqc670i0etyqgyb45dt1dysq5ap2mzg
10
11 440 51 41 11 1 3 108 148 14
10
0 9 60
0 9 -9
0 9 -30
0 9 41
0 9 82
0 9 69
0 9 -79
0 9 -39
0 9 72
0 9 41

output:

Unauthorized output

result:


Subtask #5:

score: 0
Skipped

Dependency #1:

0%