# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
388550 | 2021-04-12T04:54:21 Z | shawon_majid | A Huge Tower (CEOI10_tower) | C++14 | 128 ms | 5676 KB |
//Bismillahir Rahman-ir Rahim #include <complex> #include <queue> #include <set> #include <unordered_set> #include <list> #include <chrono> #include <random> #include <iostream> #include <algorithm> #include <cmath> #include <string> #include <vector> #include <map> #include<cstdio> #include<cstring> #include<string> #include<stdlib.h> #include<iomanip> #define PI acos(-1) #define F first #define S second #define debug(x) cout<<'>'<<#x<<":"<<x<<endl #define tara ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0) #define Y printf("YES\n") #define N printf("NO\n") #define ll long long #define lll __int128 #define ull unsigned long long #define pii pair<int,int> #define pll pair<long,long> #define eb emplace_back #define pb push_back #define sc scanf #define pf printf #define endl '\n' #define INF 1<<30 #define ll_INF 1LL<<62 const int M=1e5; using namespace std ; int main() { tara ; ll n, d, i, j; cin>>n>>d ; ll a[n+1] ; for(i=1; i<=n; i++)cin>>a[i] ; sort(a+1, a+n+1); ll st=1, ans=1; for(i=2; i<=n; i++) { while(st <= n && a[st]+d < a[i]) ++st; //cout<<i<<" "<<st<<endl ; ans= (ans*(i-st+1) % 1000000009); } cout<<ans<<endl; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 0 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 | 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 | Correct | 0 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 | Correct | 0 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 | Correct | 1 ms | 308 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 | Correct | 0 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 | 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 | Correct | 1 ms | 224 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 332 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 11 ms | 588 KB | Output is correct |
2 | Correct | 12 ms | 1100 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 54 ms | 2252 KB | Output is correct |
2 | Correct | 58 ms | 2768 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 108 ms | 5060 KB | Output is correct |
2 | Correct | 128 ms | 5676 KB | Output is correct |