Submission #1084455

#TimeUsernameProblemLanguageResultExecution timeMemory
10844557againA Huge Tower (CEOI10_tower)C++17
30 / 100
189 ms11088 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 %= (1000000007) ; } 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...