horses.cpp: In function 'void build(long long int, long long int, long long int)':
horses.cpp:6:16: warning: declaration of 'n' shadows a global declaration [-Wshadow]
6 | void build(int n, int l, int r) {
| ^
horses.cpp:5:5: note: shadowed declaration is here
5 | int n, x[500005], y[500005], segs[4*500005], mod = 1e9+7;
| ^
horses.cpp: In function 'void update(long long int, long long int, long long int, long long int, long long int)':
horses.cpp:17:17: warning: declaration of 'n' shadows a global declaration [-Wshadow]
17 | void update(int n, int l, int r, int i, int v) {
| ^
horses.cpp:5:5: note: shadowed declaration is here
5 | int n, x[500005], y[500005], segs[4*500005], mod = 1e9+7;
| ^
horses.cpp: In function 'long long int query(long long int, long long int, long long int, long long int, long long int)':
horses.cpp:31:15: warning: declaration of 'n' shadows a global declaration [-Wshadow]
31 | int query(int n, int l, int r, int a, int b) {
| ^
horses.cpp:5:5: note: shadowed declaration is here
5 | int n, x[500005], y[500005], segs[4*500005], mod = 1e9+7;
| ^
horses.cpp: In function 'int32_t calc()':
horses.cpp:51:46: warning: conversion from 'long long int' to 'int32_t' {aka 'int'} may change value [-Wconversion]
51 | return (query(1, 0, n-1, 0, ind)*y[ind]) % mod;
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~
horses.cpp:43:31: warning: unused variable 'b' [-Wunused-variable]
43 | long double v = 0, a = 0, b = 0;
| ^