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 | 3792 |
| 2 | VivaciousAubergine | 3647 |
| 3 | Kevin114514 | 3603 |
| 4 | jiangly | 3583 |
| 5 | strapple | 3515 |
| 6 | tourist | 3470 |
| 7 | dXqwq | 3436 |
| 8 | Radewoosh | 3415 |
| 9 | Otomachi_Una | 3413 |
| 10 | Um_nik | 3376 |
| # | User | Contrib. |
|---|---|---|
| 1 | Qingyu | 158 |
| 2 | adamant | 152 |
| 3 | Um_nik | 146 |
| 4 | Dominater069 | 144 |
| 5 | errorgorn | 141 |
| 6 | cry | 139 |
| 7 | Proof_by_QED | 136 |
| 8 | YuukiS | 135 |
| 9 | chromate00 | 134 |
| 9 | TheScrasse | 134 |
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 |
|---|


