版本比较
雅礼cch杯 round 3总结
正文
增加 15 行删除 15 行
32 行未改动3334353637373839404126 行未改动686970717272737475767677787980818283848586868788899023 行未改动11411511611711811811912012112212212312412512668 行未改动19519619719819919920020120220313 行未改动21721821922022122122222322422422522622722822822923023123242 行未改动27527627727827927928028128228331 行未改动3153163173183193193203213223236 行未改动33033133233333433433533633733833833934034134211 行未改动3543553563573583583593603613625 行未改动32 行未改动int T, n;
int gcd(int x, int y) { return y ? gcd(y, x % y) : x;} }
int U(int x) { while(1) { x++;26 行未改动 }}
signed main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> T; while(T--) { cin >> n; int u = U(n), v = V(n); int ans1 = u * v - u * 2 - v * 2 + n * 2 + 2, ans2 = u * v * 2, w = gcd(ans1, ans2); ans1 /= w; ans2 /= w; cout << ans1 << "/" << ans2 << "\n"; }
return 0;}```
23 行未改动 return (i - 1) * m + j;}
signed main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n >> m; for(int i = 1; i <= n; i++) { cin >> s[i]; s[i] = " " + s[i];68 行未改动 } else { cout << dis[id(tx, ty)]<< "\n"; }
return 0;}```
13 行未改动
const int N = 2010, M = 110;int n, k, m, dp[M][M][N][2], a[N], b[N], c[N], w[M][N], lsh[N], lshc, ans;
// dp[l][r][t][0/1] 代表当前访问过的区间为[l,r],用时为t,当前位置在最左侧/最右侧时的最大分数 // dp[l][r][t][0/1] 代表当前访问过的区间为[l,r],用时为t,当前位置在最左侧/最右侧时的最大分数
int main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n >> k >> m; for(int i = 1; i <= m; i++) { cin >> a[i] >> b[i] >> c[i]; lsh[++lshc] = a[i];42 行未改动 } } } cout << ans << "\n";
return 0;}```
31 行未改动 } dfs1(y, x); dp[x] += dp[y] + sz[y] * max(0ll, w - a[x]); sz[x] += sz[y]; } }}
void dfs2(int x, int fa) { for(int i = 0; i < E[x].size(); i++) {6 行未改动 }}
signed main() {
ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin >> n; for(int i = 1; i <= n; i++) { cin >> a[i]; }11 行未改动 ans1 = dp[i]; } } cout << ans2 << "\n" << ans1 << "\n";
return 0;}```
5 行未改动