Submission #1045395

#TimeUsernameProblemLanguageResultExecution timeMemory
1045395bluecornbotA Huge Tower (CEOI10_tower)C++14
35 / 100
1063 ms5212 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 barray[n]={0}; for(int i=0;i<n;i++){ cin>>array[i]; } sort(array,array+n); int pointeri=n-1; int pointerj=n-2; for(int i=n-1;i>=0;i--){ int j=i-1; while(array[i]<=d+array[j]){ j--; barray[i]++; } } long long product=1; 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:28:6: warning: unused variable 'pointeri' [-Wunused-variable]
   28 |  int pointeri=n-1;
      |      ^~~~~~~~
tower.cpp:29:6: warning: unused variable 'pointerj' [-Wunused-variable]
   29 |  int pointerj=n-2;
      |      ^~~~~~~~
#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...