# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
783243 | PanosPask | Pairs (IOI07_pairs) | C++14 | 17 ms | 1580 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int B, N, D, M;
ll ans = 0;
void case1(void)
{
vector<int> animals(N);
for (int i = 0; i < N; i++)
scanf("%d", &animals[i]);
sort(animals.begin(), animals.end());
int l = 0;
for (int r = 0; r < N; r++) {
while (l < N && animals[r] - animals[l] > D) {
l++;
}
ans += r - l;
}
printf("%lld\n", ans);
}
void case2(void)
{
printf("-1\n");
}
void case3(void)
{
printf("-1\n");
}
int main(void)
{
scanf("%d %d %d %d", &B, &N, &D, &M);
if (B == 1)
case1();
else if (B == 2)
case2();
else
case3();
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |