编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#4669 #1024. 冒险之路 Time Limit Exceeded 50 10114 ms 2688 K C++ 17 / 1.3 K t330026229 2024-01-17 15:27:43
显示原始代码
#include <bits/stdc++.h>
using namespace std;
const int N = 2e5 + 5;
int n, m, a[N], b[N], num[N], x, day, cnt;
bool cmp(int x, int y) {
    if (a[x] == a[y])
        return x < y;
    return a[x] < a[y];
}
int main() {
    cin >> n;
    for (int i = 1; i <= n; i++) cin >> a[i];
    for (int i = 1; i <= n; i++) cin >> b[i];
    for (int i = 1; i <= n; i++) num[i] = i;
    cin >> m;
    sort(num + 1, num + n + 1, cmp);
    // for (int i=1;i<=n;i++) cout<<a[num[i]]<<' ';

    for (int i = 1; i <= m; i++) {
        cin >> x;
        day = 0, cnt = 0;
        for (int j = 1; j <= n; j++) {
            if (x > a[num[j]]) {
                x += b[num[j]];
            } else {
                cnt += a[num[j]] - x + 1;
                x = b[num[j]] + a[num[j]] + 1;
            }
            // cout<<cnt<<endl;
        }
        int total = 0;
        if (cnt == 0)
            day = 0;
        else
            for (int j = 1;; j++) {
                total += j;
                if (2 * total - j >= cnt) {
                    day = 2 * j - 1;
                    break;
                } else if (2 * total >= cnt) {
                    day = 2 * j;
                    break;
                }
            }
        cout << day << ' ';
    }

    return 0;
}
子任务 #1
Time Limit Exceeded
得分:50
测试点 #1
Accepted
得分:100
用时:6 ms
内存:388 KiB

输入文件(1.in

100
53 63 48 50 50 43 39 67 99 95 67 47 89 55 55 47 86 98 73 47 83 90 64 81 35 88 49 40 41 53 70 98 
<800 bytes omitted>

答案文件(1.out

5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 10 0 7 0 7 10 0 0 0 0 0 0 0 6 0 0 0 5 0 0 0 0 0 0 0 0 0 7 0 10 0 1
<104 bytes omitted>

用户输出

5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 5 0 10 0 7 0 7 10 0 0 0 0 0 0 0 6 0 0 0 5 0 0 0 0 0 0 0 0 0 7 0 10 0 1 0 0 0 0 7 10 0 0 0 0 2 0 0 
<76 bytes omitted>

系统信息

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

输入文件(2.in

100
36 46 54 98 88 90 35 35 63 36 99 88 83 77 64 61 77 69 82 80 36 96 94 96 52 50 94 76 54 81 90 92 
<798 bytes omitted>

答案文件(2.out

8 0 0 0 11 2 4 0 8 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 8 0 0 0 7 0 0 8 0 3 0 0 0 0 0 0 0 0
<103 bytes omitted>

用户输出

8 0 0 0 11 2 4 0 8 0 0 0 3 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 7 8 0 0 0 7 0 0 8 0 3 0 0 0 0 0 0 0 0 0 0 0 0 9 0 0 11 0 0 0 0 0 
<75 bytes omitted>

系统信息

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

输入文件(3.in

100
88 38 93 44 69 87 80 98 50 51 93 52 46 79 78 34 49 88 69 37 75 70 51 86 78 88 39 37 76 58 62 87 
<792 bytes omitted>

答案文件(3.out

0 5 0 2 8 0 6 7 5 0 0 8 10 0 4 0 0 0 0 4 0 0 0 0 10 10 0 0 8 0 0 0 3 0 0 0 0 0 0 1 10 0 11 9 5 0 0 5
<106 bytes omitted>

用户输出

0 5 0 2 8 0 6 7 5 0 0 8 10 0 4 0 0 0 0 4 0 0 0 0 10 10 0 0 8 0 0 0 3 0 0 0 0 0 0 1 10 0 11 9 5 0 0 5 0 0 0 0 0 0 8 0 0 0 0 0 0 7
<78 bytes omitted>

系统信息

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

输入文件(4.in

100
87 97 77 46 97 45 79 81 79 100 95 97 53 87 93 98 45 40 76 55 52 40 53 51 38 59 80 59 84 98 72 77
<800 bytes omitted>

答案文件(4.out

0 6 9 0 0 0 1 9 0 0 5 5 7 0 0 9 0 10 0 0 0 0 9 0 0 0 0 0 6 0 11 10 2 9 0 8 9 0 0 0 0 9 0 7 0 0 0 0 0
<103 bytes omitted>

用户输出

0 6 9 0 0 0 1 9 0 0 5 5 7 0 0 9 0 10 0 0 0 0 9 0 0 0 0 0 6 0 11 10 2 9 0 8 9 0 0 0 0 9 0 7 0 0 0 0 0 9 6 0 0 0 1 0 0 8 0 0 0 8 0
<75 bytes omitted>

系统信息

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

输入文件(5.in

100
56 36 36 72 54 77 64 74 44 46 37 44 61 46 49 56 48 69 38 66 49 73 44 57 45 53 85 84 46 36 77 93 
<801 bytes omitted>

答案文件(5.out

0 8 0 6 7 0 0 8 9 0 0 0 0 0 3 0 6 0 0 8 0 0 9 0 8 0 0 0 0 0 4 0 0 0 6 0 1 0 7 6 0 0 0 0 0 5 0 0 0 0 
<101 bytes omitted>

用户输出

0 8 0 6 7 0 0 8 9 0 0 0 0 0 3 0 6 0 0 8 0 0 9 0 8 0 0 0 0 0 4 0 0 0 6 0 1 0 7 6 0 0 0 0 0 5 0 0 0 0 4 0 10 6 0 0 0 0 0 7 0 0 0 0
<73 bytes omitted>

系统信息

Exited with return code 0
测试点 #6
Time Limit Exceeded
得分:0
用时:2049 ms
内存:2632 KiB

输入文件(6.in

200000
742051135 604049313 720082325 673091582 536019441 429938366 691039847 892341869 418089415 569
<5272076 bytes omitted>

答案文件(6.out

36514 36514 36514 36514 18090 36514 0 0 36514 36514 0 0 36514 36514 0 0 0 36514 36514 36514 36514 36
<899078 bytes omitted>

用户输出

3 3 3 3 3 3 84877 83781 3 3 3 89149 3 3 85869 3 84640 3 3 3 3 3 84803 3 3 3 3 3 3 3 3 3 86949 3 90319 3 3 3 3 3 3 3 3 84391 3 3 
<3626 bytes omitted>
测试点 #7
Time Limit Exceeded
得分:0
用时:2013 ms
内存:2676 KiB

输入文件(7.in

200000
875730846 670772729 776854364 944681675 808172397 406963146 528115665 770239476 820546619 515
<5267483 bytes omitted>

答案文件(7.out

36515 36515 36515 36515 0 36515 36515 0 36515 0 0 0 0 0 0 0 0 36515 36515 36515 0 36515 36515 19684 
<901959 bytes omitted>

用户输出

3 3 3 3 89758 3 3 3 3 3 83361 3 86491 3 84555 87979 3 3 3 3 3 3 3 3 3 3 3 3 3 3 90594 3 90937 84328 87848 3 3 84109 3 3 3 3 8590
<3480 bytes omitted>
测试点 #8
Time Limit Exceeded
得分:0
用时:2002 ms
内存:2688 KiB

输入文件(8.in

200000
501853731 607901626 484450030 631567640 736980286 492330200 980509415 435817647 634790831 339
<5269402 bytes omitted>

答案文件(8.out

0 36514 0 10862 0 0 36514 0 36514 36514 36514 0 0 29246 0 36514 36514 0 23250 0 36514 0 36514 19685 
<900287 bytes omitted>

用户输出

77144 3 82661 92309 79011 82974 3 88996 3 3 3 86291 84826 3 84900 3 3 88189 3 89858 3 89395 3 3 3 3 3 3 3 3 80895 3 91749 3 3 85
<3824 bytes omitted>
测试点 #9
Time Limit Exceeded
得分:0
用时:2012 ms
内存:2636 KiB

输入文件(9.in

200000
657890381 974556484 482302844 507638521 993808346 511602307 480510712 895587531 502623381 718
<5270358 bytes omitted>

答案文件(9.out

36515 18053 0 36515 36515 36515 19909 0 0 0 36515 36515 0 36515 0 36515 0 0 24005 30065 36515 36515 
<900107 bytes omitted>

用户输出

54551 44366 9366 54551 54551 54551 45153 30598 21823 29378 54551 54551 3 54551 3 54551 3 3 47103 50461 54551 54551 26786 3 40604
<6315 bytes omitted>
测试点 #10
Time Limit Exceeded
得分:0
用时:2009 ms
内存:2632 KiB

输入文件(10.in

200000
870836136 471811807 522602480 383158806 516115860 760246717 723877335 778497293 421556327 748
<5269378 bytes omitted>

答案文件(10.out

0 0 10916 0 0 21986 0 0 16198 0 36515 0 0 0 36515 36515 36515 15273 36515 36515 0 36515 21349 0 3651
<901599 bytes omitted>

用户输出

92023 83101 3 90989 85454 3 82862 3 3 86633 3 3 3 82988 3 3 3 3 3 3 89383 3 3 90465 3 3 3 3 3 91746 3 3 3 3 92155 85791 88171 3 
<3496 bytes omitted>