| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1366555 | sampaio_kk | Pairs (IOI07_pairs) | C++20 | 11 ms | 1988 KiB |
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define int long long
#define fr first
#define sc second
#define all(x) x.begin(), x.end()
#define inv(x) x, vector<x>, greater<x>
#define lsb(x) (x&-x)
#define pb push_back
#define me max_element
#define pq priority_queue
using namespace std;
using pii = pair<int, int>;
using pip = pair<int, pii>;
using ppp = pair<pii, pii>;
const int mod7 = 1000000007, mod9 = 998244353, ln = 23, inf = 1e9, N = 2e5 + 5;
void s1(){
int n, d, m; cin >> n >> d >> m;
vector<int> v(n);
for(int i = 0; i < n; i++) cin >> v[i];
sort(all(v));
vector<int> pts;
pts.reserve(n);
int ans = 0;
for(int i = 0; i < n; i++){
int a = v[i];
ans += pts.end() - lower_bound(all(pts), a-d);
pts.push_back(a);
}
}
signed main() {_
int t; cin >> t;
if(t == 1){s1();}
// if(t == 2){s2();}
// if(t == 3){s3();}
}| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Result | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
