Skip to content

UVa 138

WinDaLex edited this page Jul 16, 2013 · 2 revisions

设house number为y,last number为x。
则题目要求找到一对x、y值符合,从1累加到y-1和从y+1累加到x的值相等。
化简成方程 yy2 = x*x + x。暴力枚举x求出y即可。

Clone this wiki locally