版本比较
20251004总结
正文
增加 3 行删除 3 行
42 行未改动4344454647474849505121 行未改动7374757677777879808141 行未改动1231241251261271271281291301315 行未改动42 行未改动 print(x / 10); cout << (int)(x % 10);}
void solve(){ void solve(){ cin >> n >> xa >> ca >> xb >> cb; if(xb == 1){ n--; cout << (n % xa ? -1 : n / xa * ca) << '\n';21 行未改动 } if(ans == -1){ cout << "-1\n"; return ; } } if(ans == 0){ cout << "0\n"; return ; }41 行未改动 cout << (a[n] - a[1]) * (a[n] - a[1]) << '\n'; return 0; } for(int i = 1; i <= n; i++){ mx = -1e18, mn = 1e18; mx = -1e18, mn = 1e18; for(int j = i; j >= 1 && abs(j - i) <= 15; j--){ mx = max(a[j], mx), mn = min(mn, a[j]); dp[i] = max(dp[i], dp[j - 1] + (mx - mn) * (mx - mn)); }5 行未改动