# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
54610 | 2018-07-04T08:01:50 Z | 김세빈(#1491) | Pairs (IOI07_pairs) | C++11 | 37 ms | 1456 KB |
#include <bits/stdc++.h> using namespace std; typedef long long ll; ll X[101010]; ll n, d, m; ll ans; void tc1() { int i, j; for(i=0;i<n;i++){ scanf("%lld", X+i); } sort(X, X+n); for(i=j=0;i<n;i++){ for(;j<n && X[j] - X[i] <= d;j++); ans += j - i - 1; } printf("%lld\n", ans); } void tc2() { } void tc3() { } int main() { ll dim; scanf("%lld%lld%lld%lld", &dim, &n, &d, &m); if(dim == 1) tc1(); else if(dim == 2) tc2(); else tc3(); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 488 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 488 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 20 ms | 1256 KB | Output is correct |
2 | Correct | 37 ms | 1384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 29 ms | 1384 KB | Output is correct |
2 | Correct | 27 ms | 1384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 28 ms | 1456 KB | Output is correct |
2 | Correct | 26 ms | 1456 KB | Output is correct |
3 | Correct | 25 ms | 1456 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 1456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 2 ms | 1456 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |