版本比较
题解:P14304 【MX-J27-T1】分块
正文
增加 5 行删除 5 行
24 行未改动25262728292930313233333435363637383940404142424344454624 行未改动
int main(){ cin >> q;
while (q--) { cin >> n;
long long x = floor(sqrt(n * 1.0L)); long long ans = (x - 1) * 3 + 1;
long long mid = (x * x + (x + 1) * (x + 1) - 1) / 2; if (n >= mid) ans++; if (n >= (x + 1) * (x + 1) - 1) ans++; cout << ans << endl; cout << ans << endl; }
return 0;}```~~本蒟蒻第一篇题解,求过!~~