11 2014 档案
摘要:题目链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=119解题思路:RMQ算法。不会的可以去看看我总结的RMQ算法。http://blog.csdn.net/niushuai666/article/details/6624672代码如下:#in...
阅读全文
摘要:#include#include#includeusing namespace std;struct node{ __int64 num,pre,next;};int main(){ int n; freopen("in.txt","r",stdin); while(sca...
阅读全文
摘要:这里先只考虑x,y都大于0的情况如果x^2+y^2=r^2,则(r-x)(r+x)=y*y令d=gcd(r-x,r+x),r-x=d*u^2,r+x=d*v^2,显然有gcd(u,v)=1且u#include #include #include #include #include #include ...
阅读全文
摘要:习题8-1 Uva1149 11.8 #include #include using namespace std;int main(){// freopen("in.txt","r",stdin); int T; cin>>T; while(T--) { int n, m, mi; ...
阅读全文
摘要:习题7-1,UVa208,Time:11.6#include #include #include using namespace std;vectormap[10005];int vis[1005];int dfs(int s, int t, int n, int tmp[]){ if(s == t...
阅读全文
摘要:第一次刷书,感觉也是不一样,每天都有目标,也给了希望第六章说是数据结构,我倒是没那么多感觉是,递归用得挺多,还有vector,queue,等STL有很多题目不是做不出,其实只是想的时间少,不敢做,所以,刷书,是进步的,最好的,选择。11月6号,第七章开始
阅读全文
摘要:习题6-1,UVa673,Time:11.1#include #include#include#include#include#include using namespace std;int main() { int Case; string str; bool flag; ...
阅读全文