# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
306461 |
2020-09-25T15:47:49 Z |
sofapuden |
Pairs (IOI07_pairs) |
C++14 |
|
90 ms |
1784 KB |
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
int b; cin >> b;
if(b == 1){
ll n, d, m; cin >> n >> d >> m;
vector<int> v(n);
for(auto &x : v)cin >> x;
sort(v.begin(), v.end());
int ptrl = 0, ptrh = 0;
ll ans = 0;
for(; ptrh < n; ++ptrh){
while(abs(v[ptrh]-v[ptrl])> d){
ptrl++;
}
ans+=ptrh-ptrl;
}
cout << ans << "\n";
}
if(b == 2){
ll n, d, m; cin >> n >> d >> m;
}
if(b == 3){
ll n, d, m; cin >> n >> d >> m;
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
256 KB |
Output is correct |
2 |
Correct |
0 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
384 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
47 ms |
1148 KB |
Output is correct |
2 |
Correct |
48 ms |
1272 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
86 ms |
1784 KB |
Output is correct |
2 |
Correct |
90 ms |
1528 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
87 ms |
1528 KB |
Output is correct |
2 |
Correct |
90 ms |
1656 KB |
Output is correct |
3 |
Correct |
85 ms |
1656 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
0 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
384 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
256 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |