Do not subtract 1 each time, just use < instead of <= in d5p1.

This commit is contained in:
Alexander Andreev 2023-12-06 05:26:19 +04:00
parent 3b277352d1
commit c1f11c1ebc
Signed by: Arav
GPG Key ID: D22A817D95815393

View File

@ -52,7 +52,7 @@ int main(int argc, char **argv) {
sscanf(line, "%lu %lu %lu\n", &dst, &src, &rng); sscanf(line, "%lu %lu %lu\n", &dst, &src, &rng);
for (size_t i = 0; i < data_len; ++i) { for (size_t i = 0; i < data_len; ++i) {
if (!data_v[i] && data[i] >= src && data[i] <= src+rng-1) { if (!data_v[i] && data[i] >= src && data[i] < src+rng) {
data[i] = dst + (data[i] - src); data[i] = dst + (data[i] - src);
data_v[i] = true; data_v[i] = true;
} }