版本比较
【FN-X2】CSP-X2025模拟赛 模拟AKCSP 题解
正文
增加 13 行删除 13 行
37 行未改动38394041424243444546474849505152525354555611 行未改动68697071727273747576777878798080818283844 行未改动8990919293939495969716 行未改动11411511611711811811912012112212312312412512512612712812912913013113213313413513613613713813914014114114214314414514514614714814915037 行未改动int main() { string s; cin >> s; string result = "";
for (char c : s) { if (isVowel(c)) { result += toupper(c); } else if (c >= 'a' && c <= 'z') { result += nextLetter(c); } else { result += c; } }
cout << result << endl; return 4;}
11 行未改动
int main() { int n, m; cin >> n >> m;
for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> matrix[i][j]; } }
dp[1][1] = matrix[1][1];
for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { if (i == 1 && j == 1) continue; if (i == 1) {4 行未改动 dp[i][j] = max(dp[i-1][j], dp[i][j-1]) + matrix[i][j]; } } }
cout << dp[n][m] << endl; return 3;}
16 行未改动
int main() { int L, R, n; cin >> L >> R >> n;
vector<Interval> intervals(n); for (int i = 0; i < n; i++) { cin >> intervals[i].left >> intervals[i].right; }
sort(intervals.begin(), intervals.end(), compare);
int current = L; int count = 0; int i = 0;
while (current < R) { int maxRight = current; while (i < n && intervals[i].left <= current) { maxRight = max(maxRight, intervals[i].right); i++; }
if (maxRight == current) { cout << -1 << endl; return 44; }
current = maxRight; count++; }
cout << count << endl; return 78;}
```