[Offer收割]编程练习赛45 register

Ended

Participants:125

Verdict:Time Limit Exceeded
Score:70 / 100
Submitted:2018-01-21 12:17:33

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
    int N = 0;
    vector<vector<int>> in; 
    cin >> N;
    for (int i = 0; i < N; ++i) {
        vector<int> row;
        int a, b;
        scanf("%d %d",&a,&b);
        row.push_back(a);
        row.push_back(b);
        in.push_back(row);      
    
    }
    int res = 0;
    for (int i = 0; i < in.size(); ++i) {
        for (int j = 0; j < i; ++j) {
            if (i == j) {
                continue;
            }
            if ((in[i][0] + in[j][0]) == (in[i][1] + in[j][1])) {
                ++res;          
            }
        }
    
    }
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX