http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=5 [题解]: 没想通这题暴力可以过.... [code]: #include<iostream> #include<stdio.h> #include<string.h> using namespace std; ]; int main() { int n,m; while(~scanf("%d%d",&n,&…
http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=1 [题解]:卡特兰数取模 h(n) = h(n-1)*(4*n-2)/(n+1) 这题我们公式选择错了,不过还是能AC的 因为要取模,应该选 h(n)=h(0)*h(n-1)+h(1)*h(n-2)+...+h(n-1)*h(0) (n>=2) [code-java]: import java.math.BigInteger; import java.util.Scanne…
[题解]: 最短路径问题,保证距离最短的同时,学妹权值最大,哈哈 [code]: #include<iostream> #include<queue> #include<stdio.h> #include<string.h> #include<stdlib.h> #define N 50005 #define INF 100000000 using namespace std; struct Edge { int to; int next; in…
[题解]:二进制拆分 任意一个整数都可以拆分成 2^0 + 2^1 + 2^2 + 2^3 + ....+ m [code]: #include <iostream> #include <stdio.h> #include <string.h> #include <math.h> using namespace std; int main() { int n; while(~scanf("%d",&n)) { ; ;;i++) {…
http://acm.csu.edu.cn/OnlineJudge/problem.php?cid=2037&pid=9 [题解]: 这题卡了一下,卡在负数的情况,负数输出 0 这题主要找到一个个相邻重复的位置,然后加1上去,看是否进位,直到满足条件为止 [code]: #include<iostream> #include<stdio.h> #include<string.h> #include<stdlib.h> using namespace…
Problem A: Small change 题解:http://www.cnblogs.com/crazyapple/p/3349469.html Problem B: Scoop water 题解:http://www.cnblogs.com/crazyapple/p/3349478.html Problem D: CX and girls 题解:http://www.cnblogs.com/crazyapple/p/3349480.html Problem F: ZZY and his…
题目链接  ZOJ Monthly, March 2018 Problem F 题意很明确 这个模数很奇妙,在$[0, mod)$的所有数满足任意一个数立方$48$次对$mod$取模之后会回到本身. 所以开$48$棵线段树,和一个永久标记.当对某个区间操作时对这个区间加一层永久标记. 即当前我要查找的第$x$层,实际找的是第$up[i] + x$层. 时间复杂度$O(48nlogn)$ #include <bits/stdc++.h> using namespace std; #define…
Problem F Funny Car Racing There is a funny car racing in a city with n junctions and m directed roads. The funny part is: each road is open and closed periodically. Each road is associate with two integers (a, b), that means the road will be open fo…
Home Web Board ProblemSet Standing Status Statistics   Problem F: 求平均年龄 Problem F: 求平均年龄 Time Limit: 1 Sec  Memory Limit: 128 MBSubmit: 720  Solved: 394[Submit][Status][Web Board] Description 定义一个Persons类,用于保存若干个人的姓名(string类型)和年龄(int类型),定义其方法 void ad…
Problem F. Door LockTime Limit: 20 Sec Memory Limit: 256 MB 题目连接 http://codeforces.com/gym/100500/attachments Description It was a beautiful night at Yekaterinburg, the sky was crystal clear with no clouds, and the view of the moon and the stars was…