# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
481078 | 2021-10-19T12:07:12 Z | sparsh_67 | A Huge Tower (CEOI10_tower) | C++14 | 146 ms | 20884 KB |
/* start of cp 3.0BETA NEW-BETA-LADDER https://codeforces.com/problemset/page/2?tags=1800-1800 DEAD PERSON CODING */ #include <iostream> #include <bits/stdc++.h> using namespace std; #define mp make_pair #define pb push_back #define fi first #define se second #define MOD 1000000009 #define int long long int #define pii pair<int,int> #define vi vector<int> #define vii vector<pii> #define graph vector<vector<int>> #define print(s) for(auto it:s) cout<<it<<" " #define print2(s) for(auto it:s) cout<<it.fi<<" : "<<it.se #define uset unordered_set #define maxheap priority_queue<int> #define minheap priority_queue<int,vi,greater<int>> #define ln cout<<'\n' #define space cout<<" " #define len(x) x.size() #define bits(x) __builtin_popcountll(x) void fileio() { #ifndef ONLINE_JUDGE freopen("input.txt","r",stdin); freopen("output.txt","w",stdout); #endif } graph g; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); //fileio(); int n,d; cin>>n>>d; vi a(n,0); for(int i=0;i<n;i++){ cin>>a[i]; } sort(a.begin(), a.end()); vi p(n,0); int l=0,r=0; while(l<n){ while(r<n and a[r]-a[l]<=d)r++; p[l]=r-l; l++; } int j=0; vi best(n,0); for(int i=0;i<n;i++){ while(j<n and j<i+p[i])best[j++]=i; } int res=1; for(int i=0;i<n;i++){ res=(res*(i-best[i]+1))%MOD; } cout<<res; return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 312 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 0 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 204 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 332 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 3 ms | 588 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 12 ms | 1992 KB | Output is correct |
2 | Correct | 10 ms | 1996 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 75 ms | 8528 KB | Output is correct |
2 | Correct | 52 ms | 8548 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 130 ms | 20884 KB | Output is correct |
2 | Correct | 146 ms | 20212 KB | Output is correct |