fancyfence.cpp: In function 'int main()':
fancyfence.cpp:9:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
9 | scanf("%d",&n) ;
| ~~~~~^~~~~~~~~
fancyfence.cpp:11:40: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
11 | for(int i = 1 ; i <= n ; ++i) scanf("%lld",&h[i]) ;
| ~~~~~^~~~~~~~~~~~~~
fancyfence.cpp:12:40: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
12 | for(int i = 1 ; i <= n ; ++i) scanf("%lld",&w[i]) ;
| ~~~~~^~~~~~~~~~~~~~
fancyfence.cpp:15:31: warning: array subscript 2 is above array bounds of 'long long int [2]' [-Warray-bounds]
15 | dp[i][1] = 0 , dp[i][2] = 0 ;
| ~~~~~~~^
fancyfence.cpp:25:36: warning: array subscript 2 is above array bounds of 'long long int [2]' [-Warray-bounds]
25 | ans = (ans + (dp[i-1][2]*(dp[i-1][2]+1))%mod)%mod ;
| ~~~~~~~~~^
fancyfence.cpp:29:38: warning: array subscript 2 is above array bounds of 'long long int [2]' [-Warray-bounds]
29 | if(h[n]==2) ans = (ans + (dp[n][2]*(dp[n][2]+1))%mod)%mod ;
| ~~~~~~~^