제출 #654072

#제출 시각아이디문제언어결과실행 시간메모리
654072atharvdA Huge Tower (CEOI10_tower)C++14
컴파일 에러
0 ms0 KiB
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<fstream>

#define for_n(i,a,n) for (int i=a;i<n;i++)
#define pb push_back
#define mp(i, j) make_pair(i, j)

typedef long long ll;

using namespace std;

int main(){
    int n, d;
    cin >> n >> d;
    int arr[n];
    for(int i = 0; i < n; i++){
        cin >> arr[i];
    }
    sort(arr, arr + n);
    int l = 0;
    int w = 0;
    ll count = 1;
    const mod = 1000000009;
    for(int r=0;r < n;r++) {
        for(;l < r;l++) {
            if(arr[r]-arr[l] <= d) break;
            w--;
        }
        w++;
        count *= w;
        count %= mod;
    }
    cout << count << endl;
}

컴파일 시 표준 에러 (stderr) 메시지

tower.cpp: In function 'int main()':
tower.cpp:27:11: error: 'mod' does not name a type; did you mean 'modf'?
   27 |     const mod = 1000000009;
      |           ^~~
      |           modf
tower.cpp:35:18: error: 'mod' was not declared in this scope; did you mean 'modf'?
   35 |         count %= mod;
      |                  ^~~
      |                  modf