제출 #1132934

#제출 시각아이디문제언어결과실행 시간메모리
1132934lopkus비밀 (JOI14_secret)C++20
컴파일 에러
0 ms0 KiB
#include <bits/stdc++.h>

#define int long long

using namespace std;
/*
int ask(int x, int y) {
    return min(x + 2 * (y / 2), (int)1e9);
}
*/
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin >> n;
    vector<int> a(n + 1);
    for(int i = 0; i < n; i++) {
        cin >> a[i];
    }
    int q;
    cin >> q;
    while(q--) {
        int l, r;
        cin >> l >> r;
        int ans = a[l];
        for(int i = l + 1; i <= r; i++) {
            ans = ask(ans, a[i]);
        }
        cout << ans << "\n";
    }
}

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

secret.cpp: In function 'int main()':
secret.cpp:27:19: error: 'ask' was not declared in this scope
   27 |             ans = ask(ans, a[i]);
      |                   ^~~