제출 #851298

#제출 시각아이디문제언어결과실행 시간메모리
851298enerelt14Žarulje (COI15_zarulje)C++14
컴파일 에러
0 ms0 KiB
#include<bits/stdc++.h> #define ll long long #define ff first #define ss second using namespace std; const int MX = 2e5 + 5; const int mod = 1e9 + 7; int n, k, a[MX]; ll fac[MX], inv_fac[MX], tree[4 * MX], ans[MX]; pair<int, int> euc(int x, int y){ if (x == 1)return {1, 0}; pair<int, int> res = euc(y % x, x), ans; ans.ff = res.ss - y / x * res.ff; ans.ss = res.ff; return ans; } void go(){ fac[0] = inv_fac[0] = 1; for (int i = 1; i <= n; i++){ fac[i] = fac[i - 1] * i % mod; inv_fac[i] = inv_fac[i - 1] * euc(i, mod).ff % mod; if (inv_fac[i] < 0)inv_fac[i] += mod; } stack<int> x; for (int i = 1; i <= n; i++) } ll C(int x, int y){ return fac[x] * inv_fac[y] % mod * inv_fac[x - y] % mod; } void update(int id, int l, int r, int L, int R, ll x){ if (L > r || l > R)return; if (L <= l && r <= R){ tree[id] *= x; tree[id] %= mod; return; } int mid = (l + r) / 2; update(id * 2 + 1, l, mid, L, R, x); update(id * 2 + 2, mid + 1, r, L , R, x); } int main(){ ios::sync_with_stdio(0);cin.tie(0); cin >> n >> k; for (int i = 1; i <= n; i++)cin >> a[i]; go(); while (k--){ int x; cin >> x; cout << ans[x] << "\n"; } }

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

zarulje.cpp: In function 'void go()':
zarulje.cpp:26:1: error: expected primary-expression before '}' token
   26 | }
      | ^