답안 #238972

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
238972 2020-06-13T20:28:39 Z dolphingarlic A Huge Tower (CEOI10_tower) C++14
컴파일 오류
0 ms 0 KB
a#include <bits/stdc++.h>
#define FOR(i, x, y) for (int i = x; i < y; i++)
typedef long long ll;
using namespace std;

const ll MOD = 1e9 + 9;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    int n, d;
    cin >> n >> d;
    vector<int> a(n);
    FOR(i, 0, n) cin >> a[i];
    sort(a.begin(), a.end());

    ll ans = 1;
    int ptr = 0;
    FOR(i, 0, n) {
        while (a[i] - a[ptr] > d) ptr++;
        ans = (ans * (i - ptr + 1)) % MOD;
    }
    cout << ans;
    return 0;
}

Compilation message

tower.cpp:1:2: error: stray '#' in program
 a#include <bits/stdc++.h>
  ^
tower.cpp:1:1: error: 'a' does not name a type
 a#include <bits/stdc++.h>
 ^
tower.cpp:6:7: error: 'll' does not name a type
 const ll MOD = 1e9 + 9;
       ^~
tower.cpp: In function 'int main()':
tower.cpp:9:5: error: 'ios_base' has not been declared
     ios_base::sync_with_stdio(0);
     ^~~~~~~~
tower.cpp:10:5: error: 'cin' was not declared in this scope
     cin.tie(0);
     ^~~
tower.cpp:10:5: note: suggested alternative: 'main'
     cin.tie(0);
     ^~~
     main
tower.cpp:13:5: error: 'vector' was not declared in this scope
     vector<int> a(n);
     ^~~~~~
tower.cpp:13:12: error: expected primary-expression before 'int'
     vector<int> a(n);
            ^~~
tower.cpp:14:25: error: 'a' was not declared in this scope
     FOR(i, 0, n) cin >> a[i];
                         ^
tower.cpp:15:10: error: 'a' was not declared in this scope
     sort(a.begin(), a.end());
          ^
tower.cpp:15:5: error: 'sort' was not declared in this scope
     sort(a.begin(), a.end());
     ^~~~
tower.cpp:15:5: note: suggested alternative: 'short'
     sort(a.begin(), a.end());
     ^~~~
     short
tower.cpp:17:5: error: 'll' was not declared in this scope
     ll ans = 1;
     ^~
tower.cpp:21:9: error: 'ans' was not declared in this scope
         ans = (ans * (i - ptr + 1)) % MOD;
         ^~~
tower.cpp:21:39: error: 'MOD' was not declared in this scope
         ans = (ans * (i - ptr + 1)) % MOD;
                                       ^~~
tower.cpp:23:5: error: 'cout' was not declared in this scope
     cout << ans;
     ^~~~
tower.cpp:23:13: error: 'ans' was not declared in this scope
     cout << ans;
             ^~~