foo.cc: In function 'long long int solve()':
foo.cc:22:9: warning: this 'for' clause does not guard... [-Wmisleading-indentation]
22 | for(int i=1,j;i<=m;i++) a[i].id=read(),a[i].x=read();a[m+1].id=0;
| ^~~
foo.cc:22:62: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'for'
22 | for(int i=1,j;i<=m;i++) a[i].id=read(),a[i].x=read();a[m+1].id=0;
| ^
foo.cc:22:21: warning: unused variable 'j' [-Wunused-variable]
22 | for(int i=1,j;i<=m;i++) a[i].id=read(),a[i].x=read();a[m+1].id=0;
| ^
foo.cc:23:51: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
23 | sort(a+1,a+m+1,cmp);int ans=qpow(v,a[1].id-1<<1);
| ~~~~~~~^~
foo.cc:26:25: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
26 | if(a[j].x!=a[i].x) return 0;j++;
| ^~
foo.cc:26:53: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
26 | if(a[j].x!=a[i].x) return 0;j++;
| ^
foo.cc:28:41: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
28 | ans=ans*qpow(v,n-a[i].id<<1)%P;break;
| ~^~~~~~~~
foo.cc:30:45: warning: suggest parentheses around '-' inside '<<' [-Wparentheses]
30 | else ans=ans*(qpow(v,a[j].id-a[i].id<<1)+P-(v-1)%P*qpow(v,a[j].id-a[i].id-1)%P)%P;
| ~~~~~~~^~~~~~~~