Submission #1084457

#TimeUsernameProblemLanguageResultExecution timeMemory
10844577againA Huge Tower (CEOI10_tower)C++17
100 / 100
197 ms10580 KiB
#include <bits/stdc++.h> using namespace std ; #define int long long const int N = 100 ; main(){ int n , k ; cin >> n >> k ; vector<int> a(n + 1) ; for(int i = 0 ; i < n ; i++) { cin >> a[i] ; a[i] *= -1 ; } a[n] = 1e12 ; sort(a.begin(), a.end() ) ; int ans = 1 ; for(int i = 0 ; i < n ; i++) { int r = upper_bound(a.begin(), a.end(), a[i] + k) - a.begin() ; ans *= r - i ; ans %= (1000000009) ; } cout << ans ; }

Compilation message (stderr)

tower.cpp:6:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    6 | main(){
      | ^~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...