Live2d Test Env
摘要: 之前有过区域赛,简化版问题: 给定一个小写字符组成的字符串S,(|S|<1e5,下标从1开始),现在有Q种操作,对于每个操作Q(Q<=1e5),输入opt, 如果opt==1,输入x,c,表示把S[x]改为c,(c是小写字母)。 如果opt==2,输入L,R,和字符串T,输出S[L-R]中有多少个字 阅读全文
posted @ 2018-03-10 21:48 nimphy 阅读(476) 评论(0) 推荐(0) 编辑
摘要: Mr. Fib is a mathematics teacher of a primary school. In the next lesson, he is planning to teach children how to add numbers up. Before the class, he 阅读全文
posted @ 2018-03-10 20:05 nimphy 阅读(597) 评论(0) 推荐(0) 编辑
摘要: Median Sum You are given N integers A1, A2, ..., AN. Consider the sums of all non-empty subsequences of A. There are 2N−1 such sums, an odd number. Le 阅读全文
posted @ 2018-03-10 17:43 nimphy 阅读(358) 评论(0) 推荐(0) 编辑
摘要: Each of Farmer John's N cows (1 ≤ N ≤ 1,000) produces milk at a different positive rate, and FJ would like to order his cows according to these rates 阅读全文
posted @ 2018-03-10 13:57 nimphy 阅读(259) 评论(0) 推荐(0) 编辑
摘要: 题意:求有向图里面有多少个三元环。 思路:枚举起点A,遍历A可以到的B,然后求C的数量,C的数量位B可以到是地方X集合,和可以到A的地方Y集合的交集(X&Y)。 B点可以枚举,也可以遍历。(两种都试过,区别不大。) 枚举代码: 遍历代码: 阅读全文
posted @ 2018-03-10 10:41 nimphy 阅读(374) 评论(0) 推荐(0) 编辑
摘要: You are given N sets, the i-th set (represent by S(i)) have C(i) element (Here "set" isn't entirely the same as the "set" defined in mathematics, and 阅读全文
posted @ 2018-03-10 09:33 nimphy 阅读(654) 评论(0) 推荐(0) 编辑