Submission #1045395

# Submission time Handle Problem Language Result Execution time Memory
1045395 2024-08-05T22:59:55 Z bluecornbot A Huge Tower (CEOI10_tower) C++14
35 / 100
1000 ms 5212 KB
#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

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 time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 348 KB Output is correct
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 0 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 17 ms 348 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 27 ms 600 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 216 ms 2140 KB Output isn't correct
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 1063 ms 5212 KB Time limit exceeded
2 Halted 0 ms 0 KB -