# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
394113 | 2021-04-25T15:53:25 Z | jtt_ | A Huge Tower (CEOI10_tower) | C++17 | 121 ms | 2636 KB |
#include <bits/stdc++.h> using namespace std; using ll = long long; #define ar array #define vt vector #define f first #define s second #define bk back() #define ft front() #define rsz resize #define pb push_back #define lb lower_bound #define ub upper_bound #define sz(x) (int)size(x) #define all(x) begin(x), end(x) #define rall(x) rbegin(x), rend(x) #define FOR(i,a,b) for (int i = (a); i < (b); ++i) #define F0R(i,b) FOR(i,0,b) #define ROF(i,a,b) for (int i = (b)-1; i >= (a); --i) #define R0F(i,b) ROF(i,0,b) #define each(i,x) for (auto& i: x) #define Ceil(x,y) ((x+y-1)/y) #define M1(x) template<class T, class...U> void x(T&& a,U&&...b) #define M2(x) (int[]) {(x forward<U>(b),0)...} M1(pr) { cout << forward<T>(a); M2(cout << ' ' << ); cout << '\n'; } M1(re) { cin >> forward<T>(a); M2(cin >> ); } // void setIO(string S = "") { cin.tie(0)->sync_with_stdio(false); if (sz(S)) { freopen((S+".in").c_str(),"r",stdin); freopen((S+".out").c_str(),"w",stdout); } } // const int MOD = (int)1e9+9; int N,D; int main() { setIO(); re(N,D); vt<int> a(N); each(i,a) re(i); sort(all(a)); int ans = 1; // int l = 0; // F0R(r,N) { // while (a[r]-a[l] > D) l ++; // ans = ans*(r-l+1)%MOD; // } int r = N-1; R0F(l,N) { while (a[r]-a[l] > D) r --; ans = ans*(r-l+1)%MOD; } pr(ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 204 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 3 ms | 332 KB | Output isn't correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 13 ms | 460 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 53 ms | 1228 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 121 ms | 2636 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |