0_0_35736158_30845.cpp: In function 'int main()': 0_0_35736158_30845.cpp:15:7: error: 'ans' was not declared in this scope ans+=a[j]-a[j-1]-1; ^