编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#24139 #2025. 整理书籍 Accepted 100 87 ms 436 K C++ 17 / 585 B 192023213847 2024-12-21 13:53:17
显示原始代码
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
using namespace std;

void sol() {
    int n;
    std::cin >> n;

    std::vector<int> a(n + 1);
    for (int i = 1; i <= n; i++) {
        std::cin >> a[i];
    }

    int ans = 0;
    for (int i = 2; i <= n; i++) {
        for (int j = 1; j <= i; j++) {
            if (a[i] < a[j]) {
                ans++;
            }
        }
    }

    std::cout << ans << "\n";
}

int main() {
    ios::sync_with_stdio(0);
    std::cin.tie(0);
    std::cout.tie(0);
    int t = 1;
    while (t--) sol();
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:4 ms
内存:328 KiB

输入文件(test1.in

4
1 2 3 4

答案文件(test1.out

0

用户输出

0

系统信息

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

输入文件(test2.in

3
3 2 1 

答案文件(test2.out

3

用户输出

3

系统信息

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

输入文件(test3.in

5
1 3 2 8 2

答案文件(test3.out

3

用户输出

3

系统信息

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

输入文件(test4.in

5
6 6 6 6 6

答案文件(test4.out

0

用户输出

0

系统信息

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

输入文件(test5.in

319
506566789 327144372 89894848 82307491 63689091 775175452 96835980 649944758 902552411 438220354
<3050 bytes omitted>

答案文件(test5.out

25278

用户输出

25278

系统信息

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

输入文件(test6.in

947
815575750 910768051 218201641 216996443 204697698 136585682 518745137 983803138 360270231 59030
<9278 bytes omitted>

答案文件(test6.out

217374

用户输出

217374

系统信息

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

输入文件(test7.in

796
191775954 644327900 78214263 716137367 996514479 31160736 304150983 823649428 308342819 2563026
<7774 bytes omitted>

答案文件(test7.out

156551

用户输出

156551

系统信息

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

输入文件(test8.in

1881
235713105 951318308 291866049 995629709 412494889 589031090 39093732 615015002 426154600 75849
<18491 bytes omitted>

答案文件(test8.out

892955

用户输出

892955

系统信息

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

输入文件(test9.in

1348
971656466 936991836 830049406 40043157 373066467 602263839 173973571 913458976 832436993 71298
<13220 bytes omitted>

答案文件(test9.out

462777

用户输出

462777

系统信息

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

输入文件(test10.in

1037
150644678 587802059 504985530 340639568 112692885 258363760 110892482 817447798 254134275 4932
<10149 bytes omitted>

答案文件(test10.out

256584

用户输出

256584

系统信息

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

输入文件(test11.in

1654
660101481 273261451 985223938 316971770 262889743 216837385 325436346 808941735 948716368 9026
<16276 bytes omitted>

答案文件(test11.out

676912

用户输出

676912

系统信息

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

输入文件(test12.in

441
843725536 59056084 802812355 948564120 727280090 88156977 229269063 224656623 128608409 8940626
<4258 bytes omitted>

答案文件(test12.out

48977

用户输出

48977

系统信息

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

输入文件(test13.in

463
351189978 485474969 894607950 946993395 47613651 680165310 982698434 898162241 892955070 393852
<4499 bytes omitted>

答案文件(test13.out

53508

用户输出

53508

系统信息

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

输入文件(test14.in

1951
137861771 412536014 143522023 863574995 362912702 553837620 453349856 756903737 315321078 5191
<19211 bytes omitted>

答案文件(test14.out

939252

用户输出

939252

系统信息

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

输入文件(test15.in

1148
62969127 845596993 650410567 172165143 205789280 384864211 68033397 73329829 530110424 5400378
<11247 bytes omitted>

答案文件(test15.out

322812

用户输出

322812

系统信息

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

输入文件(test16.in

1133
424466629 746613070 168655216 626669543 993891318 238748425 184809223 142125785 904096008 5420
<11115 bytes omitted>

答案文件(test16.out

321133

用户输出

321133

系统信息

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

输入文件(test17.in

822
910737269 716472968 977953810 365339054 698675636 153790624 759216350 219882228 745671116 18937
<8046 bytes omitted>

答案文件(test17.out

167274

用户输出

167274

系统信息

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

输入文件(test18.in

1508
134491993 216354220 491335292 343810419 848113190 263344345 876395005 549049141 387161158 7807
<14800 bytes omitted>

答案文件(test18.out

551733

用户输出

551733

系统信息

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

输入文件(test19.in

1947
740493331 948416682 434429002 348479254 92471859 605014686 371477453 667980039 721033305 17292
<19143 bytes omitted>

答案文件(test19.out

946102

用户输出

946102

系统信息

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

输入文件(test20.in

233
893638095 980382467 388590300 54221478 441088311 33481114 703552667 948897261 335461305 4610737
<2218 bytes omitted>

答案文件(test20.out

12867

用户输出

12867

系统信息

Exited with return code 0