08 2018 档案
摘要:每一篇文章中,做题顺序不一定从前到后,最好先做最好拿分的填空题等整理文章思路,再做选项较少的段落主旨(细节)匹配题。 在名词的对于句子的匹配中,一个名词可能不止出现一次,暂时搞不清就先用排除法。 做题时注意时间,有舍才有得,迷惑性太强的先放过去。 小作文两段 静态图:饼状图为主,2饼比较 动态图:柱
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2089 include include include define N 1000010 int flag[N]; using namespace std; int main() { int n; int m; i
阅读全文
摘要:代码来自tourist,先码 http://codeforces.com/contest/755/problem/B
阅读全文
摘要:https://vjudge.net/contest/250229 problem/A include include include include include define eps 1e 7 define PI acos( 1.0) using namespace std; struct n
阅读全文
摘要:POJ 2318 链接(http://poj.org/problem?id=2318) 图论入门之判断直线与点的位置关系 include using namespace std; struct node { int x1,x2,y1,y2; }p[5050]; bool is_in(int x,in
阅读全文
摘要:CCPC网络赛结束了,一个新的阶段开始了。 转载Samuel Ullman这篇惊艳的文章,时刻提醒自己。 愿世间所有人青春永驻。 译文 原文
阅读全文
摘要:Perferences Key Binding ; User
阅读全文
摘要:不要轻易尝试! 运行前务必确保计算机所有文件已保存
阅读全文
摘要:1068 include using namespace std; struct man { int index; int score; }p[5050]; bool cmp(man x, man y) { if(x.score != y.score) return x.score y.score;
阅读全文
摘要:万能头文件 include PI 四舍五入 (https://zhidao.baidu.com/question/2117495607995670467.html) 记录函数运行时间 include include using namespace std; int main() { clock_t
阅读全文
摘要:关于set(http://www.cnblogs.com/yaoyueduzhen/p/4536929.html)
阅读全文
摘要:```
#define mem(a) memset(a,0,sizeof(a)) int read()
{ int x=0,f=1;char ch=getchar(); while(!isdigit(ch)){if(ch=='-')f=-1;ch=getchar();} while(isdigit(ch))x=x*10+ch-'0',ch=getchar(); r...
阅读全文
摘要:```
{
"cmd" : ["exo-open --launch TerminalEmulator bash -c \"g++ $file_name -o ${file_base_name} -lm -Wall; ./${file_base_name}; exec bash\""],//-x
"selector" : "source.c, source.c++",
"shell":true,...
阅读全文
摘要:答题就是贪心算法,[题目链接](http://codeforces.com/problemset/problem/1027/C) 笔者主要想借这个题谈一下如何缩短代码运行时间 1.scanf与cin,优先选择scanf 2.memset最好不要用 3.本题中,不需要开一个1e6的数组储存输入数据 4
阅读全文
摘要:cf B题,莫名其妙过,g++显示输入输出%lld有错误提示,,,目前查资料无解,,, 原题(http://codeforces.com/gym/227252/standings/friends/true)
阅读全文
摘要:map函数的启蒙篇,如何实现字符串对于数值的映射达到查重效果(map中同一个元素只能存在一次)。 map函数提供了find()以及count()。 include include include include include using namespace std; vector word; ma
阅读全文
摘要:代码来自蓝书第三章第一题,思路很清晰。主要实现过程中需要区分以下数据结构: stack queue priority_queue include include include include using namespace std; const int maxn = 1000 + 10; int
阅读全文
摘要:UVA 11729 大体是贪心做法,执行时间长的先交代 训练指南原题解 include include include using namespace std; struct Job { int j, b; bool operator x.j; } }; int main() { int n, b,
阅读全文
摘要:STL入门教程 写在前面:博主在学习STL的时候遇到了很多困扰,博主认为其根本原因是因为大多数初学者同笔者一样,急于求成,想尽快实现自己需要的功能,特别是对迭代器了解不深。笔者希望通过这篇文章,让各位读者真正认识STL这个常见、方便而优秀的模板库,也希望这篇博文成为最优秀STL入门教程之一。 STL
阅读全文
摘要:输入输出相同#includechar*s="#include%cchar*s=%c%s%c;main(){printf(s,10,34,s,34);}";main(){printf(s,10,34,s,34);}
阅读全文
摘要:UVA 11059#includeusing namespace std;int main() { int S[20], kase = 0, n; while(cin >> n && n) { for(int i = 0; i > S...
阅读全文
摘要:UVA 725sprintf(buf, "%05d%05d", abcde, fghij);0补位,避免153078 / 02469 = 62数据出现。153078 / 02469 = 62中,153078 / 2469 = 62,由于没有补位,也整好满足相除等于62...
阅读全文
摘要:UVA 10815 set#include#include#include#includeusing namespace std;set dict;string s, buf;int main() { while(cin >> s) //???这里需要Ctrl+...
阅读全文
摘要:背包问题模板const int MAXN = 101;const int SIZE = 50001;int dp[SIZE];int volume[MAXN], value[MAXN], c[MAXN];int n, v; // 总物品数,背包...
阅读全文
摘要:HDU 2602 Bone Collector(dp之01背包问题)题目描述:典型的01背包问题。 #include #include #include #define N 1010using namespace std; int dp[N][N]; int tem...
阅读全文
摘要:HDU 2084 数塔 (dp)题目描述:有如下所示的数塔,要求从顶层走到底层,若每一步只能走到相邻的结点,则经过的结点的数字之和最大是多少?题目限制:数塔高度#define N 110using namespace std;int main(){ int c;...
阅读全文
摘要:HDU 1520 Anniversary party(树形dp)树形dp第一题!!!题意很清晰,思路也很明确。很容易找到根节点,即最大的boss,通过根节点向下dp。状态转移方程: int to = vec[x][i]; dfs(to); dp[x][1] += dp...
阅读全文
摘要:POJ 2823 Sliding Window(优先队列)简单来说,优先队列的构造用一位数组就可以实现。通过特定限制条件,伴随着每一个数据的输入处理数组。以此题为例,获取每一个子区间内的最小值,一个简单方法就是构造一个单调递增的数列,并且不断维持这个数列。显然,在这个...
阅读全文
摘要:POJ 1321 棋盘问题 (DFS)先直接贴代码#include#include#includeusing namespace std;char p[10][10];bool vis[10];int ans;int n, k;void dfs(int line, i...
阅读全文
摘要:POJ 2676 Suduku先直接贴代码#include #include #include #include using namespace std;const int N = 15;int p[N][N];bool row[N][N];bool col[N][N...
阅读全文
摘要:Segment Occurrences[题目大意]有两个长度为m,n的字符串,以及查询次数q次;每次查询提供两个数据a&&b,问在长度为m的字符串的第a到第b个字符的区域内有多少个n这样的字符串。[总结]看似很水的一道题居然没做出来。发现自己对于数据的输入输出还是存在...
阅读全文
摘要:POJ 2492[题目大意]詹姆斯莫里亚蒂教授认为一种稀有的虫子种间也有同性恋!在T种情况下,给出n只虫子(自动排序为第一到第n),并给出m组例子,每组例子种包含两个数据。表示这两只虫子会发生性交。问:根据这些数据能否判断出这种稀有的虫子中存在同性恋呢?[核心要点]最...
阅读全文
摘要:HDU 3088[题目大意]首先输入两个数,M,N,均为自然数。表明有{1,2,3,……,M}连续集合。并有N个陈述语句,表示为a,b,c;意为从集合中的第a个数开始累加,一直到b,他们的总和为c。请你判断这N个陈述句中错误的语句数量。[核心要点]这是一个单纯的并查集...
阅读全文
摘要:POJ 2992[题目大意]求组合C(n,k)的全部因子个数。[核心要点](数论基本知识)第一:C(n,k) = n! / k! / (n - k )!无需证明,可自己推导第二:对于所有正整数n,都可按素因子分解为n=p1^a1*p2^a2*....*pk^ak(其中...
阅读全文

浙公网安备 33010602011771号