编号 题目 状态 分数 总时间 内存 代码 / 答案文件 提交者 提交时间
#12478 #12. 线性代数 Accepted 100 131 ms 412 K C++ 17 / 662 B Silencer76 2023-12-07 19:53:20
显示原始代码
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cstring>
#include <cctype>
#include <cmath>
#include <algorithm>
#include <functional>
#include <numeric>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <tuple>
#include <bitset>
using namespace std;
const int N = 1010;
int a[N];
set<int> s;
int main(void) {
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int n, i, j, ans = 0;
    cin >> n;
    for (i = 0; i < n; ++i) {
        cin >> a[i];
        s.emplace(a[i]);
    }
    for (i = 0; i < n; ++i)
        for (j = i + 1; j < n; ++j)
            if (s.count(a[i] + a[j]))
                ++ans;
    cout << ans;
    return 0;
}
子任务 #1
Accepted
得分:100
测试点 #1
Accepted
得分:100
用时:3 ms
内存:364 KiB

输入文件(1.in

9
38 50 86 35 39 26 12 47 42

答案文件(1.ans

4

用户输出

4

系统信息

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

输入文件(2.in

45
158 115 97 24 25 56 108 66 27 13 35 26 43 11 58 57 137 143 31 127 16 114 89 128 81 84 104 22 120 
<48 bytes omitted>

答案文件(2.ans

143

用户输出

143

系统信息

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

输入文件(3.in

99
221 398 2486 2247 1193 656 1351 508 2163 2332 2854 1501 478 2251 2203 2363 3746 588 2345 345 1472
<364 bytes omitted>

答案文件(3.ans

85

用户输出

85

系统信息

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

输入文件(4.in

196
673 3965 2327 4468 3100 168 549 2484 3582 5230 1247 1242 1929 2319 537 4042 844 4246 3621 1828 7
<843 bytes omitted>

答案文件(4.ans

370

用户输出

370

系统信息

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

输入文件(5.in

500
9509 63 13509 13399 24891 17291 22997 13422 10053 15431 41195 6087 22742 10154 18392 16322 17015
<2731 bytes omitted>

答案文件(5.ans

1141

用户输出

1141

系统信息

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

输入文件(6.in

595
28870 49822 45194 22209 20880 15080 17849 33707 39134 34641 12838 6846 31945 51006 22015 23219 4
<3367 bytes omitted>

答案文件(6.ans

1025

用户输出

1025

系统信息

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

输入文件(7.in

699
155346 153105 248318 16985 122195 183007 57082 91729 35968 181126 41691 313143 190621 169957 181
<4523 bytes omitted>

答案文件(7.ans

430

用户输出

430

系统信息

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

输入文件(8.in

799
2978303 8093170 2515587 3819383 6683956 2420442 4150030 162763 3376906 2034443 4180781 1761331 5
<6144 bytes omitted>

答案文件(8.ans

186

用户输出

186

系统信息

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

输入文件(9.in

900
33167896 32724290 14184254 11027176 20386883 38873741 3982292 532024 1785606 3758888 15879579 56
<7652 bytes omitted>

答案文件(9.ans

187

用户输出

187

系统信息

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

输入文件(10.in

1000
369241141 518354054 316964319 74718926 161759478 251833944 159282470 382566776 799418957 223280
<9736 bytes omitted>

答案文件(10.ans

200

用户输出

200

系统信息

Exited with return code 0