编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#6559 #1085. 山路 Wrong Answer 0 330 ms 39476 K C++ 17 (Clang) / 1.0 K t330026189 2024-11-16 16:50:12
显示原始代码
#include <bits/stdc++.h>
using namespace std;

#define int long long

#define il inline

#define rd read()


const int L = 5e6 + 100, inf = 1e12, mod = 1e9 + 7;
int n, a[L];

stack<int> st;

il int read() {
    int res = 0, f = 1;
    char c = getchar();
    while (c < '0' || c > '9') {
        if (c == '-')
            f = -1;
        c = getchar();
    }
    while (c >= '0' && c <= '9') {
        res = res * 10 + c - 48;
        c = getchar();
    }
    return res * f;
}

signed main() {
    // freopen("test.out", "w", stdout);
    n = rd;
    int ans = 0, maxx = 0;
    for (int i = 1; i <= n; ++i) {
        a[i] = rd;
        maxx = max(maxx, a[i]);
    }
    if (a[1] == maxx) {
        for (int i = 1; i <= n; ++i) {
            int ok = 1;
            while (!st.empty() && st.top() < a[i]) {
                if (ok)
                    ans += a[i] - st.top(), ok = 0;
                st.pop();
            }
            st.push(a[i]);
        }
        if (st.top() == maxx) {
            printf("%lld\n%lld\n", ans, 1LL);
        } else
            printf("%lld\n%lld\n", ans + maxx - st.top(), 1LL << (maxx - st.top()));
    }
    return 0;
}

/*
2
3
0 2
1 2
3 3
3
1 0
2 3
0 10
*/
子任务 #1
Wrong Answer
得分:0
测试点 #1
Wrong Answer
得分:0
用时:3 ms
内存:292 KiB

输入文件(mountain0.in

57
34
61
68
41
14
69
48
27
59
67
14
83
33
20
48
34
32
22
98
42
2
97
22
61
6
<125 bytes omitted>

答案文件(mountain0.out

966
9

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #2
Wrong Answer
得分:0
用时:3 ms
内存:288 KiB

输入文件(mountain1.in

31
78
56
26
34
36
13
24
95
99
72
52
67
70
50
19
61
61
82
3
59
10
80
12
35
8
<27 bytes omitted>

答案文件(mountain1.out

476
35

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #3
Wrong Answer
得分:0
用时:3 ms
内存:252 KiB

输入文件(mountain2.in

962
688
49
172
196
137
703
333
768
844
247
396
502
970
9
31
640
902
2
679
165
4
<4592 bytes omitted>

答案文件(mountain2.out

162908
9

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #4
Wrong Answer
得分:0
用时:3 ms
内存:384 KiB

输入文件(mountain3.in

225
499
96
634
519
686
975
308
921
868
238
994
890
396
305
252
234
535
395
92
37
<1004 bytes omitted>

答案文件(mountain3.out

36686
281

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #5
Wrong Answer
得分:0
用时:3 ms
内存:508 KiB

输入文件(mountain4.in

588
136
602
174
714
394
719
127
662
852
150
594
633
67
963
56
563
252
543
384
78
<2775 bytes omitted>

答案文件(mountain4.out

101976
733

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #6
Wrong Answer
得分:0
用时:3 ms
内存:264 KiB

输入文件(mountain5.in

564
330
647
380
958
375
676
490
497
334
454
885
138
92
756
855
395
148
674
771
2
<2674 bytes omitted>

答案文件(mountain5.out

93971
51

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #7
Wrong Answer
得分:0
用时:4 ms
内存:412 KiB

输入文件(mountain6.in

17563
5447
1964
1648
5144
8316
11
5554
3298
4092
5007
648
9117
1168
3425
5947
9874

<103395 bytes omitted>

答案文件(mountain6.out

29331431
1015

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #8
Wrong Answer
得分:0
用时:3 ms
内存:356 KiB

输入文件(mountain7.in

9182
3122
8242
982
5447
4045
5917
9779
6908
401
6503
1836
8771
7277
5354
5841
4203

<53939 bytes omitted>

答案文件(mountain7.out

15658478
1545

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #9
Wrong Answer
得分:0
用时:75 ms
内存:12792 KiB

输入文件(mountain8.in

1601195
119630364
23627258
914169197
863918805
147553566
886540488
792602150
410454179
4334
<17363781 bytes omitted>

答案文件(mountain8.out

276044671284259
9508363

Special Judge 信息

Files user_out and answer differ

系统信息

Exited with return code 0
测试点 #10
Runtime Error
得分:0
用时:230 ms
内存:39476 KiB

输入文件(mountain9.in

6400307
444167660
421294682
103707759
367157692
626212605
66417800
213542734
421897423
7319
<69410076 bytes omitted>

答案文件(mountain9.out

1103044601902689
486594910

系统信息

Killed: Segmentation fault