Submission #726412

#TimeUsernameProblemLanguageResultExecution timeMemory
726412professionalACerA Huge Tower (CEOI10_tower)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> #define int long long using namespace std; const int mod = 1e9 + 9; int main() { int N, D; cin >> N >> D; int A[N]; for (auto &x : A) cin >> x; sort(A.begin(), A.end()); int p = 0, ans = 1; for (int i = 0; i < N; i++) { while (p < N - 1 && A[p + 1] - A[i] <= D) p++; int d = p - i + 1; ans = (ans * d) % mod; } cout << ans << endl; }

Compilation message (stderr)

cc1plus: error: '::main' must return 'int'
tower.cpp: In function 'int main()':
tower.cpp:10:10: error: request for member 'begin' in 'A', which is of non-class type 'long long int [N]'
   10 |   sort(A.begin(), A.end());
      |          ^~~~~
tower.cpp:10:21: error: request for member 'end' in 'A', which is of non-class type 'long long int [N]'
   10 |   sort(A.begin(), A.end());
      |                     ^~~