Submission #77263

# Submission time Handle Problem Language Result Execution time Memory
77263 2018-09-24T13:24:12 Z MohamedAhmed0 Secret (JOI14_secret) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
using namespace std ;
#include "secret.h"
int arr[100001] , arr1[1001][1001];
#define MAX_VALUE        1000000000

void Init(int N, int A[])
{
    for(int i = 0 ; i < N ; ++i)
        arr[i] = A[i] ;
    for(int i = 0 ; i < N ; ++i)
    {
        arr1[i][i] = arr[i] ;
        for(int j = i+1 ; j <= N ; ++j)
            arr1[i][j] = Secret(arr1[i][j-1] , arr[i][j]);
    }
}
int Query(int l, int r)
{
    return arr1[l][r] ;
}

Compilation message

secret.cpp: In function 'void Init(int, int*)':
secret.cpp:15:56: error: invalid types 'int[int]' for array subscript
             arr1[i][j] = Secret(arr1[i][j-1] , arr[i][j]);
                                                        ^