摘要:
A. Shape Perimeter 难度(个人感觉)★☆☆☆☆ 思考: 考虑平移 Code: for(int i = 0; i < N; i++){ std::cin >> dx >> dy; if(i){ cnt_dx += dx; cnt_dy += dy; } } ans = (m + cn 阅读全文
摘要:
A. Grasshopper on a Line 难度(个人感觉)☆☆☆☆☆ Code if(L % k == 0){ ans.push_back(1); ans.push_back(L - 1); } else{ ans.push_back(L); } B. Comparison String 难 阅读全文
摘要:
A. Coins 难度(个人感觉)☆☆☆☆☆ 思考: 关键是 2 可以凑出任意偶数 Code: if(n % 2 == 0){ ok = 1; } else{ if(k % 2 == 0){ ok = 0; } else{ ok = n >= k; } } B. Long Legs 难度(个人感觉) 阅读全文
摘要:
A. Two Frogs 难度(个人感觉)★☆☆☆☆ 思考: 先观察终止状态。要么左边的人面临选择,两人在最左边两个格子;要么右边的人面临选择,两人在最右边两个格子。 对于一种初始状态,至多只能到达其中的一种终止状态,这是因为 \[距离的奇偶性 \oplus (轮到的人是\; Alice\; ?\; 阅读全文
摘要:
比赛链接 A. Kevin and Combination Lock 观察操作 难度(个人感觉)★☆☆☆☆ 注意到两个操作都不改变 的值,因此要求原数 , 显然这是充分的。 B. Kevin and Permutation 观察操作 难度(个人感觉) ★☆ 阅读全文
摘要:
难度:D << B < C << A Problem A. Channel https://codeforces.com/contest/1863/problem/A 流程看起来很复杂,让我们重述一下题意。 两数 , 。 ,你可以选 和 当 阅读全文
摘要:
D. Penchick and Desert Rabbit 题意 给定数组 , 每个逆序对连有向边,对每个点分别求能到达的最大点 分析 样例: 的走法: $ 2 \rightarrow 1 \rightarrow 4 \ri 阅读全文