摘要:
A:一组长度为n 的排列,问交换多少次,能让前m个数变成[1,m]中的数 输出前 m 个数中有多少个比 m 大的就可以了 // 代码 //#define int ll const int N = 1e5+10; int n,m; void solve() { cin>>n>>m; int ans = 阅读全文
摘要:
A:Chip Game 题意:只能向上走和向右走,走到右上角,最后一步谁操作谁就赢 只要判断 总步数 的奇偶性就可以了 // 代码 //#define int ll const int N = 1e5+10; int n,m; void solve() { cin>>n>>m; int sum = 阅读全文
摘要:
C题想了一种线段树,然后统计所有左右端点的麻烦做法, A 题:思维 将长的边作为横坐标,短的边作为纵坐标,从左走到右即可。 注意当一条边横跨中间的那条线之后,另一条边只用多走一步就可以到达另一条路 // 代码 //#define int ll const int N = 1e5+10; int n, 阅读全文
摘要:
链接:https://ac.nowcoder.com/acm/problem/24587来源:牛客网 题目描述 Due to a lack of rain, Farmer John wants to build an irrigation system to send water between h 阅读全文