submission link, problem link, Could someone please help me understand the cause of the error? Additionally, i would appreciate general insights into which operations in C++ are typically slow and tips on how to optimize them. Thank You
| # | User | Rating |
|---|---|---|
| 1 | Benq | 3676 |
| 2 | jiangly | 3670 |
| 3 | Kevin114514 | 3657 |
| 4 | maroonrk | 3355 |
| 5 | Um_nik | 3353 |
| 6 | squareOf105 | 3346 |
| 7 | tourist | 3343 |
| 8 | strapple | 3324 |
| 9 | heuristica | 3322 |
| 10 | jiangbowen | 3291 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | nik_exists | 150 |
| 2 | maspy | 150 |
| 4 | AmShZ | 143 |
| 5 | Um_nik | 141 |
| 6 | Errichto | 139 |
| 7 | adamant | 137 |
| 8 | BledDest | 134 |
| 9 | maroonrk | 133 |
| 10 | qwexd | 130 |
submission link, problem link, Could someone please help me understand the cause of the error? Additionally, i would appreciate general insights into which operations in C++ are typically slow and tips on how to optimize them. Thank You
Hi friends,please help me solve this if you have some spare time :)
a[1]-2*x[1]+x[n]=m;
a[2]-2*x[2]+x[1]=m;
a[3]-2*x[3]+x[2]=m;
. . .
a[n]-2*x[n]+x[n-1]=m;
here the array a is given and the constant m is also given,we have to find out the values of all the xi's in my approach i applied binary search on the value of x[n]..so lets suppose the assumed value of x[n]=mid then after solving the equation if i will get the value of x[n]>mid then i will reduce the mid,else increase the mid till the value of x[n] found out==mid...the problem here is that i have to find out an integral solution of the equations(if it exists)..so while solving the equations if some x[i] comes out to be a fractional value then we cannot proceed further with that value of mid..so if this happens then the current mid isnt a solution..now what should be the next mid value?increase/decrease or adjust it differently to converge to an integer solution(if it exists)?
last question:is there some other way in which this problem can be solved?
| Name |
|---|


