# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
990093 |
2024-05-29T14:40:57 Z |
asdasdqwer |
Pairs (IOI07_pairs) |
C++14 |
|
18 ms |
2136 KB |
#include <bits/stdc++.h>
using namespace std;
#define int int64_t
signed main() {
ios::sync_with_stdio(false);
cin.tie(0);
int b;cin>>b;
int n;cin>>n;
int d;cin>>d;
int m;cin>>m;
if (b == 1) {
vector<int> v(n);
for (int &x:v)cin>>x;
sort(v.begin(), v.end());
int p1 = 0, p2 = 0;
int ans = 0;
for (;p2 < n; p2++) {
while (v[p2] - v[p1] > d) p1++;
ans += p2 - p1;
}
cout<<ans<<"\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
2 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
348 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
9 ms |
1624 KB |
Output is correct |
2 |
Correct |
9 ms |
1628 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
1880 KB |
Output is correct |
2 |
Correct |
13 ms |
1880 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
13 ms |
1880 KB |
Output is correct |
2 |
Correct |
13 ms |
1884 KB |
Output is correct |
3 |
Correct |
18 ms |
2136 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
344 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
348 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |