Submission #583002

# Submission time Handle Problem Language Result Execution time Memory
583002 2022-06-24T16:37:34 Z snasibov05 Pairs (IOI07_pairs) C++14
29 / 100
4000 ms 6860 KB
#include <bits/stdc++.h>

using namespace std;

int main() {
    int b, n, d, m; cin >> b >> n >> d >> m;
    vector<vector<int>> coord(n, vector<int>(b));
    for (int i = 0; i < n; ++i) {
        for (int j = 0; j < b; ++j) cin >> coord[i][j];
    }

    int ans = 0;
    for (int i = 0; i < n; ++i){
        for (int j = i+1; j < n; ++j){
            int dist = 0;
            for (int k = 0; k < b; ++k) dist += abs(coord[i][k] - coord[j][k]);
            if (dist <= d) ans++;
        }
    }

    cout << ans << "\n";

    return 0;
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 4043 ms 6152 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4067 ms 6516 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4077 ms 6528 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 340 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 4064 ms 6276 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4065 ms 6476 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4041 ms 6860 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 3 ms 340 KB Output is correct
2 Correct 3 ms 308 KB Output is correct
# Verdict Execution time Memory Grader output
1 Execution timed out 4058 ms 6352 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4064 ms 6604 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 4078 ms 6476 KB Time limit exceeded
2 Halted 0 ms 0 KB -