답안 #383795

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
383795 2021-03-30T20:03:00 Z wabadabakalakaboo A Huge Tower (CEOI10_tower) C++17
컴파일 오류
0 ms 0 KB
#include <iostream>

using namespace std;

long long n, d, a[1000005], p = 1;

int main() {
	cin >> n >> d;
	for (int i = 0; i < n; i++) cin >> a[i];
	sort(a,a+n);
	for (int i = 0, j = 0; i < n; i++) {
		for (; a[i]-d > a[j]; j++);
		p = (p * (i-j+1)) % 1000000009;
	}
	cout << p;
}

Compilation message

tower.cpp: In function 'int main()':
tower.cpp:10:2: error: 'sort' was not declared in this scope; did you mean 'qsort'?
   10 |  sort(a,a+n);
      |  ^~~~
      |  qsort