QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#142009#1140. Distributing Candiesminhcool#0 1ms4080kbC++201.4kb2023-08-18 10:53:012024-07-04 02:39:37

Judging History

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

  • [2024-07-04 02:39:37]
  • 评测
  • 测评结果:0
  • 用时:1ms
  • 内存:4080kb
  • [2023-08-18 10:53:01]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
//#define local
#ifndef local
#include "candies.h"
#endif
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
using namespace __gnu_pbds;
using namespace std;

//#define int long long
#define fi first
#define se second
#define pb push_back
#define mp make_pair

typedef pair<int, int> ii;
typedef pair<ii, int> iii;
typedef pair<ii, ii> iiii;

const int N = 3e5 + 5;

const int oo = 1e18 + 7, mod = 1e9 + 7;

mt19937 rng(1);

int rnd(int l, int r){
	int temp = rng() % (r - l + 1);
	return abs(temp) + l;
}

int n, q;
int cap[N];

ii answer[N];

vector<iii> ques;

vector<int> distribute_candies(vector<int> c, vector<int> l, vector<int> r, vector<int> v){
    bool ck = 1;
    n = c.size(), q = l.size();
    for(int i = 0; i < n; i++){
        //cap[i] = c[i];
        answer[i] = {0, c[i]};
    }
    for(int i = 0; i < q; i++){
        //ques.pb({{l[i], r[i]}, v[i]});
        if(v[i] > 0){
            for(int j = l[i]; j <= r[i]; j++){
                answer[i].fi = min(answer[i].se, answer[i].fi + v[i]);
            }
        }
        else{
            for(int j = l[i]; j <= r[i]; j++){
                answer[i].fi = max(0, answer[i].fi + v[i]);
            }
        }
    }
    vector<int> vv;
    for(int i = 0; i < n; i++) vv.pb(answer[i].fi);
    return vv;
    //return s;
}

Details

Tip: Click on the bar to expand more detailed information

Subtask #1:

score: 0
Wrong Answer

Test #1:

score: 0
Wrong Answer
time: 0ms
memory: 4080kb

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:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
8 8 1000000000 1000000000 8 1000000000 1000000000 1000000000

result:

wrong answer 3rd lines differ - expected: '1000000000 1000000000 10000000...000000000 1000000000 1000000000', found: '8 8 1000000000 1000000000 8 1000000000 1000000000 1000000000'

Subtask #2:

score: 0
Time Limit Exceeded

Test #6:

score: 0
Time Limit Exceeded

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
Wrong Answer

Test #9:

score: 0
Wrong Answer
time: 1ms
memory: 3804kb

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:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
1000 0 0 0 0 0 1000 1000 0 1000 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...

result:

wrong answer 3rd lines differ - expected: '0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 ...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0', found: '1000 0 0 0 0 0 1000 1000 0 100...0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'

Subtask #4:

score: 0
Wrong Answer

Test #16:

score: 0
Wrong Answer
time: 0ms
memory: 3680kb

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:

4lpv73iykswp9e3nppi3jw2qggm5dfz29yy9nzpq
OK
11 0 0 41 11 1 0 0 148 14

result:

wrong answer 3rd lines differ - expected: '11 208 51 41 11 1 3 108 143 14', found: '11 0 0 41 11 1 0 0 148 14'

Subtask #5:

score: 0
Skipped

Dependency #1:

0%