正文
增加 1 行删除 1 行
239 行未改动全部展开240241242243244245246247248175 行未改动全部展开239 行未改动全部展开else {int p = n / __gcd(n,k);if (ans[p] == 0) {for (int j = 1;j <= n;j += p) {for (int l = 0;l < p - 2;l++)res += a[j + l] * a[j + l + 2];res += a[j] * a[j + 1] + a[j + p - 1] * a[j + p - 2];}ans[p] = res;175 行未改动全部展开239 行未改动全部展开240241242243244245246247248175 行未改动全部展开239 行未改动全部展开else {int p = n / __gcd(n,k);if (ans[p] == 0) {for (int j = 1;j <= n;j += p) {for (int l = 0;l < p - 2;l++)res += a[j + l] * a[j + l + 2];res += a[j] * a[j + 1] + a[j + p - 1] * a[j + p - 2];}ans[p] = res;175 行未改动全部展开