摘要: 留下题目 以启发思维:Given an array, your task is to find the k-th occurrence (from left to right) of an integer v. To make the problem more difficult (and inte... 阅读全文
posted @ 2015-11-20 15:15 Peccavi 阅读(223) 评论(0) 推荐(0) 编辑
摘要: 难点:1. 要可以从题目中想到运用stack 然而这一点是十分明显的:进入中转站之后先进后出2. UVa读入需要动脑筋盲点:1. current++代表着车已出站 若进入中转站则不能current++2. 不需要再定义一个a数组来存1,2,...,n 因为可以直接和i比较今日附上程序以便日后对照:/... 阅读全文
posted @ 2015-11-19 18:23 Peccavi 阅读(187) 评论(0) 推荐(0) 编辑
摘要: head=1;tail=1;que[head]=1;while(head<=tail){ for(i=2;i<=n;i++){ if(map[que[head]][i]==1 && dist[i]==0){ que[++tail]=i; ... 阅读全文
posted @ 2015-11-19 18:10 Peccavi 阅读(111) 评论(0) 推荐(0) 编辑
摘要: 难点:Q:如何用0 0结束输入?A:第一种尝试:while(scanf("%d",&n)!=0&&scanf("%d",&m)!=0){ ... }这样会TLETLE原因并非算法有问题(20000个数快排可以拿下无需顾虑) 而是读不进去n和m而且注意scanf自身有返回值 无法读入时返回值是-... 阅读全文
posted @ 2015-11-19 10:48 Peccavi 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 难点:Q:如何读入多行字符直到文件结束?A:while((c=getchar())!=EOF){ ...} 阅读全文
posted @ 2015-11-18 16:51 Peccavi 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 1.Q:如何引用pi的精确值?A:#include int main(){ const double pi = acos(-1.0); ...}2.Q:如何在屏幕上打印出"%d"? What about "\n"?A:printf("%%d");printf("\\n");3.Q:如何为... 阅读全文
posted @ 2015-11-18 14:09 Peccavi 阅读(103) 评论(0) 推荐(0) 编辑
摘要: USACO经典的数学模拟题 终于明白了为什么lcxUSACO如此厉害。。。 阅读全文
posted @ 2015-11-18 12:52 Peccavi 阅读(138) 评论(0) 推荐(0) 编辑
摘要: 难点:Q: 在题目没有申明有多少组数据时 如何停止读入?A: while(scanf("%d",&n) != EOF){ ...}盲点:有多组数据时 数组记得清零 i.e.#include ...memset(k,0,sizeof(k)); 阅读全文
posted @ 2015-11-18 12:47 Peccavi 阅读(153) 评论(0) 推荐(0) 编辑
摘要: 2015.11.28~2015.12.14 这27天 给自己的一个承诺NOI intensive planning:上午刷题库 下午学知识要刷的题库:1. NOI题库(每个section做两道题)2. UVa题库(根据进度走 学以致用)要看的书:1. 算法竞赛入门经典:训练指南2. CP(compa... 阅读全文
posted @ 2015-11-18 12:39 Peccavi 阅读(100) 评论(0) 推荐(0) 编辑
摘要: https://www.byvoid.com/blog/c-effecthttps://www.byvoid.com/blog/noip-allsolutions/#.E5.8D.95.E8.AF.8D.E6.8E.A5.E9.BE.99http://www.matrix67.com/blog/http://www.pudn.com/downloads2/sourcecode/others/detail3823.htmlhttp://wenku.baidu.com/view/9b1bd241be1e650e52ea991e.htmlhttp://blog.sina.com.cn/s/artic 阅读全文
posted @ 2013-09-04 18:53 Peccavi 阅读(178) 评论(0) 推荐(0) 编辑