제출 #1329117

#제출 시각아이디문제언어결과실행 시간메모리
1329117alinur비밀 (JOI14_secret)C++17
컴파일 에러
0 ms0 KiB
#include "secret.h"
#include <bits/stdc++.h>
#define ll long long

using namespace std;

ll a[1001], pref[1001], b[1001];
ll mod = 1e9;
void Init(int N, int A[]) {
    int n = N;
    pref[0] = 0;
    for (int i = 1; i <= n; i++) a[i] = A[i - 1], b[i] = a[i] % 2, a[i] -= a[i] % 2, pref[i] = pref[i - 1] + a[i];
}

ll Query(int L, int R) {
  L++, R++;
  ll x = pref[R] - pref[L - 1] + b[L];
  x %= mod;
  if (x == 0) x = mod;
  return x;
}

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

secret.cpp:15:4: error: ambiguating new declaration of 'long long int Query(int, int)'
   15 | ll Query(int L, int R) {
      |    ^~~~~
In file included from secret.cpp:1:
secret.h:5:5: note: old declaration 'int Query(int, int)'
    5 | int Query(int L, int R);
      |     ^~~~~