# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
872251 |
2023-11-12T15:36:57 Z |
Matjaz |
Pairs (IOI07_pairs) |
C++14 |
|
4000 ms |
7036 KB |
//
// IOI2007Pairs.cpp
//
//
// Created by Matjaz Leonardis on 12/11/2023.
//
#include <iostream>
#include <vector>
#include <stdlib.h>
using namespace std;
int B,N,D,M;
int main(){
cin >> B >> N >> D >> M;
vector<vector<int> > c(N, vector<int> (B));
for (int i=0;i<N;i++){
for (int j=0;j<B;j++) cin >> c[i][j];
}
long long pairs=0;
for (int i=0;i<N;i++){
for (int j=i+1;j<N;j++){
long long distance = 0;
for (int k=0;k<B;k++) distance += abs(c[i][k] - c[j][k]);
if (distance <= D) pairs++;
}
}
cout << pairs << endl;
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4065 ms |
6236 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4021 ms |
6744 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4045 ms |
6748 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
348 KB |
Output is correct |
2 |
Correct |
2 ms |
440 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4072 ms |
6236 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4011 ms |
6484 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4025 ms |
7036 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
344 KB |
Output is correct |
2 |
Correct |
2 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4089 ms |
6412 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4010 ms |
6664 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Execution timed out |
4027 ms |
6664 KB |
Time limit exceeded |
2 |
Halted |
0 ms |
0 KB |
- |