2012年9月2日

STL -- vector

摘要: vector1.创建具有一定数量的元素且每个元素具有相同初始值的向量:vector<int> v(10, 1); //向量中有10个元素,每个元素都是12.用下标方式访问向量中的元素vector<int> v(3); //具有3个元素的向量v[1] = 2; //给第二个元素赋值,注意向量下标由0开始cout << v[2] << endl;3.用sort(需要声明头文件“#include<algorithm>”)给向量中的元素排序,若无声明排序函数,默认按照数值大小的非降序排列sort(v.begin(), v.end()); // 阅读全文

posted @ 2012-09-02 21:37 铁树银花 阅读(174) 评论(0) 推荐(0) 编辑

Oil Deposits(DFS,基础题)

摘要: Oil DepositsTime Limit: 2000/1000 MS (Java/Others)Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5776Accepted Submission(s): 3360原题链接:点击打开链接Problem DescriptionThe GeoSurvComp geologic survey company is responsible for detecting underground oil deposits. GeoSurvComp works with one larg 阅读全文

posted @ 2012-09-02 20:41 铁树银花 阅读(196) 评论(0) 推荐(0) 编辑

变形课(DFS, 简单)

摘要: 变形课Time Limit: 2000/1000 MS (Java/Others)Memory Limit: 131072/65536 K (Java/Others)Total Submission(s): 7064Accepted Submission(s): 2622原题链接:点击打开链接Problem Description呃......变形课上Harry碰到了一点小麻烦,因为他并不像Hermione那样能够记住所有的咒语而随意的将一个棒球变成刺猬什么的,但是他发现了变形咒语的一个统一规律:如果咒语是以a开头b结尾的一个单词,那么它的作用就恰好是使A物体变成B物体.Harry已经将他所会 阅读全文

posted @ 2012-09-02 17:45 铁树银花 阅读(318) 评论(0) 推荐(0) 编辑

Find Terrorists(素数筛选+素因子分解)

摘要: Find TerroristsTime limit: 5 secondsThe Prime Minister and his Accumulated Council of Ministers(ACM) are trying hard to find all possible terrorist locations. In his dream, the Prime Minister gets a message from God suggesting that the answer to all terrorist problems are numbers(say one such number 阅读全文

posted @ 2012-09-02 15:45 铁树银花 阅读(305) 评论(0) 推荐(0) 编辑

Minesweeper(暴力,注意特判)

摘要: MinesweeperTime Limit:3000MSMemory Limit:0KB64bit IO Format:%lld & %lluSubmitStatusPracticeUVALive 4335原题链接:点击打开链接DescriptionMinesweeper is a single-player computer game. Theobjective of the game is to clear an abstract minefield withoutdetonating a mine. When the game is started, the player is 阅读全文

posted @ 2012-09-02 09:11 铁树银花 阅读(399) 评论(0) 推荐(0) 编辑

导航