Submission #1045398

#TimeUsernameProblemLanguageResultExecution timeMemory
1045398bluecornbotA Huge Tower (CEOI10_tower)C++14
20 / 100
1040 ms2652 KiB
#include <iostream> #include <fstream> #include <string> #include <bits/stdc++.h> using namespace std; // ofstream fout ("split.out"); // ifstream fin ("split.in"); int main(){ int n,d; cin>>n>>d; int array[n]; int product=1; int b=0; for(int i=0;i<n;i++){ cin>>array[i]; } sort(array,array+n); for(int i=n-1;i>=0;i--){ int j=i-1; while(array[i]<=d+array[j]){ j--; } product=product*(i-j)%1000000009; } cout<<product; // long long product=1; // for(int i=0;i<n;i++){ // cout<<barray[i]<<endl; // } // for(int i=0;i<n;i++){ // product*=(barray[i]+1); // } // cout<<product%1000000009; return 0; }

Compilation message (stderr)

tower.cpp: In function 'int main()':
tower.cpp:24:6: warning: unused variable 'b' [-Wunused-variable]
   24 |  int b=0;
      |      ^
#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...