编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#30807 #2063. 海鲜八爪鱼VS小猴7 Accepted 100 594 ms 1844 K C / 1.3 K 192024213899 2025-03-16 14:30:12
显示原始代码
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#define N 200005

#define NT 200005


float d[N];

void init(float n) { memset(d, 0, sizeof(d)); }

void update(int l, int r, float v) {
    d[l - 1] += v;
    if (r < N) {
        d[r] -= v;
    }
}

void cal(float n, float *students) {
    float sum = 0;
    for (int i = 0; i < n; i++) {
        sum += d[i];
        students[i] += sum;
    }
}

float find_max(float *students, float n) {
    float max = students[0];
    for (int i = 1; i < n; i++) {
        if (students[i] > max) {
            max = students[i];
        }
    }
    return max;
}

int main() {
    float n, p, q;
    float students[N];

    scanf("%f %f %f", &n, &p, &q);

    for (int i = 0; i < n; i++) {
        scanf("%f", &students[i]);
    }
    float T;

    scanf("%f", &T);
    init(n);

    for (float t = 0; t < T; t++) {
        float l, r, v;
        scanf("%f %f %f", &l, &r, &v);
        update(l, r, v);
    }
    cal(n, students);

    float max_student_score = find_max(students, n);

    float octopus_score = (p > max_student_score) ? p : max_student_score;

    if (octopus_score >= q) {
        printf("3G win win!\n");
    } else {
        printf("3G wanna win win\n");
    }
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:3 ms
内存:1088 KiB

输入文件(test1.in

9 2 158
26 70 27 89 53 92 74 66 8
6
5 6 -4
1 8 2
5 8 -3
7 9 5
1 3 -2
4 9 -2

答案文件(test1.out

3G wanna win win

用户输出

3G wanna win win

系统信息

Exited with return code 0
测试点 #2
Accepted
得分:100
用时:3 ms
内存:1092 KiB

输入文件(test2.in

49 2 158
26 70 27 89 53 92 74 66 8 46 38 12 24 100 30 35 92 35 28 74 53 6 70 36 85 45 64 62 82 30 8
<288 bytes omitted>

答案文件(test2.out

3G wanna win win

用户输出

3G wanna win win

系统信息

Exited with return code 0
测试点 #3
Accepted
得分:100
用时:3 ms
内存:1096 KiB

输入文件(test3.in

91 67 172
72 90 71 26 28 71 6 58 77 68 94 2 56 99 86 25 15 36 37 54 32 18 72 16 38 20 17 7 98 42 30
<943 bytes omitted>

答案文件(test3.out

3G wanna win win

用户输出

3G wanna win win

系统信息

Exited with return code 0
测试点 #4
Accepted
得分:100
用时:3 ms
内存:1048 KiB

输入文件(test4.in

32 186 194
36 64 90 42 53 76 90 84 58 48 78 34 27 28 16 42 2 24 98 82 27 56 94 48 30 82 27 84 2 22 
<983 bytes omitted>

答案文件(test4.out

3G wanna win win

用户输出

3G wanna win win

系统信息

Exited with return code 0
测试点 #5
Accepted
得分:100
用时:33 ms
内存:1632 KiB

输入文件(test5.in

157146 167851002 301413358
336971126 659598370 160567227 391749389 4890853 35766292 26239574 473038
<1595587 bytes omitted>

答案文件(test5.out

3G win win!

用户输出

3G win win!

系统信息

Exited with return code 0
测试点 #6
Accepted
得分:100
用时:17 ms
内存:1300 KiB

输入文件(test6.in

65182 260983746 255370802
162536035 11951271 291815006 132311412 746986514 302469818 96790556 70175
<738647 bytes omitted>

答案文件(test6.out

3G win win!

用户输出

3G win win!

系统信息

Exited with return code 0
测试点 #7
Accepted
得分:100
用时:13 ms
内存:1224 KiB

输入文件(test7.in

32309 35212212 187762664
16262171 373702136 216443852 466796266 101877274 236884686 198373430 93734
<504422 bytes omitted>

答案文件(test7.out

3G win win!

用户输出

3G win win!

系统信息

Exited with return code 0
测试点 #8
Accepted
得分:100
用时:133 ms
内存:1828 KiB

输入文件(test8.in

200000 757149 167851002
301413358 336971126 659598370 160567227 391749389 4890853 35766292 26239574
<6776449 bytes omitted>

答案文件(test8.out

3G win win!

用户输出

3G win win!

系统信息

Exited with return code 0
测试点 #9
Accepted
得分:100
用时:134 ms
内存:1768 KiB

输入文件(test9.in

200000 189180434 119094263
234777188 565234657 323089474 390682726 305252786 182678938 424591742 18
<6775655 bytes omitted>

答案文件(test9.out

3G win win!

用户输出

3G win win!

系统信息

Exited with return code 0
测试点 #10
Accepted
得分:100
用时:133 ms
内存:1844 KiB

输入文件(test10.in

200000 99532526 234181142
100320052 127241122 942243178 247457954 769793172 248882953 33851162 2858
<6774597 bytes omitted>

答案文件(test10.out

3G wanna win win

用户输出

3G wanna win win

系统信息

Exited with return code 0
测试点 #11
Accepted
得分:100
用时:119 ms
内存:1768 KiB

输入文件(test11.in

200000 757149 167851002
301413358 336971126 659598370 160567227 391749389 4890853 35766292 26239574
<5998633 bytes omitted>

答案文件(test11.out

3G wanna win win

用户输出

3G wanna win win

系统信息

Exited with return code 0