- 博客(62)
- 收藏
- 关注
原创 C++ 可调用对象的总结
C++总共有5种可调用对象: 普通函数, 函数指针, lambada, 函数对象(仿函数), bind创建的对象(主要将多元谓词降次)具体代码如下:#include #include #include #include using namespace std;using namespace std::placeholders;//can't use std onlyconst
2014-12-21 19:52:11 593
原创 Codeforces 6C. Alice, Bob and Chocolate
C. Alice, Bob and Chocolatetime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputAlice and Bob like games. And no
2014-12-07 15:35:44 669
原创 Codeforces 6B. President's Office
B. President's Officetime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputPresident of Berland has a very vast o
2014-12-07 15:33:42 688
原创 Codeforces 6A. Triangle
A. Triangletime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputJohnny has a younger sister Anne, who is very cl
2014-12-07 15:30:42 491
原创 Codeforces 5E. Bindian Signalizing
E. Bindian Signalizingtime limit per test4 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputEveryone knows that long ago on the
2014-12-07 15:28:52 998
原创 Codeforces 5D. Follow Traffic Rules
D. Follow Traffic Rulestime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputEverybody knows that the capital of B
2014-12-07 15:24:22 816
原创 Codeforces 5C. Longest Regular Bracket Sequence
C. Longest Regular Bracket Sequencetime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputThis is yet another pro
2014-12-07 15:22:07 736
原创 Codeforces 5B. Center Alignment
B. Center Alignmenttime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputAlmost every text editor has a built-in f
2014-12-07 15:15:23 767
原创 Codeforces 5A. Chat Server's Outgoing Traffic
A. Chat Server's Outgoing Traffictime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputPolycarp is working on a ne
2014-12-07 15:12:59 736
原创 Codeforces 4D. Mysterious Present
D. Mysterious Presenttime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputPeter decided to wish happy birthday t
2014-12-07 15:09:41 742
原创 Codeforces 4C. Registration system
C. Registration systemtime limit per test5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputA new e-mail service "Berlandesk" is
2014-12-07 14:58:49 644
原创 Codeforces 4B. Before an Exam
B. Before an Examtime limit per test0.5 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputTomorrow Peter has a Biology exam. He doe
2014-12-07 14:57:11 595
原创 Codeforces 4A. Watermelon
A. Watermelontime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputOne hot summer day Pete and his friend Billy de
2014-12-07 14:55:44 386
原创 Codeforces 3D. Least Cost Bracket Sequence
D. Least Cost Bracket Sequencetime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputThis is yet another problem on
2014-12-07 14:53:19 513
原创 Codeforces 3C. Tic-tac-toe
C. Tic-tac-toetime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputCertainly, everyone is familiar with tic-tac-t
2014-12-07 14:14:28 803
原创 Codeforces 3B. Lorry
B. Lorrytime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputA group of tourists is going to kayak and catamaran
2014-12-07 14:10:45 785
原创 Codefoeces 3A. Shortest path of the king
A. Shortest path of the kingtime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputThe king is left alone on the ch
2014-12-07 13:50:53 586
原创 Codefoeces 2B. The least round way
B. The least round waytime limit per test5 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputThere is a square matrix n × n, consi
2014-12-07 13:45:01 462
原创 Codeforces 2A. Winner
A. Winnertime limit per test1 secondmemory limit per test64 megabytesinputstandard inputoutputstandard outputThe winner of the card game popular in Berland "Ber
2014-12-07 13:27:14 459
原创 Codeforces 1B. Spreadsheets
B. Spreadsheetstime limit per test10 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputIn the popular spreadsheets systems (for ex
2014-12-07 13:24:17 539
原创 Codeforces 1A. Theatre Square
A. Theatre Squaretime limit per test2 secondsmemory limit per test64 megabytesinputstandard inputoutputstandard outputTheatre Square in the capital city of Berl
2014-12-07 13:20:14 403
原创 拓扑排序+有向无环图(DAG)的检测
/***************************拓扑排序的两张方法:1.dfs搜索2.模拟人工的拓扑两种方法的效率都是O(V + E)$$拓扑排序的方法也是有向无环图检测的方法****************************//*拓扑排序 dfs搜索 - 邻接表可以判断一个图是否有环*/#include #include #include usin
2014-10-31 22:15:39 2548
原创 HDU-1003 Max Sum-动态规划-难度2
Max SumTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 129864 Accepted Submission(s): 30100Problem DescriptionGiven a seq
2014-03-20 10:16:51 677
原创 LeetCode Palindrome Number
Palindrome Number Determine whether an integer is a palindrome. Do this without extra space.click to show spoilers.Some hints:Could negative integers be palindromes? (ie, -1)If you a
2014-03-11 19:53:23 347
原创 LeetCode Reverse Integer
Reverse Integer Reverse digits of an integer.Example1: x = 123, return 321Example2: x = -123, return -321注意点需要考虑 反转会溢出的问题;代码int reverse(int x){ int flag, sum = 0; while(x) {
2014-03-11 19:17:48 378
原创 LeetCode Add Two Numbers
Add Two Numbers You are given two linked lists representing two non-negative numbers. The digits are stored in reverse order and each of their nodes contain a single digit. Add the two numbers and r
2014-03-11 16:25:00 451
原创 LeetCode Two Sum Total
Given an array of integers, find two numbers such that they add up to a specific target number.The function twoSum should return indices of the two numbers such that they add up to the target, w
2014-03-09 20:31:25 488
原创 LeetCode Reverse Words in a String Total
Reverse Words in a String Total Given an input string, reverse the string word by word.For example,Given s = "the sky is blue",return "blue is sky the".Clarification:What constitut
2014-03-09 19:28:29 592
原创 算法竞赛入门经典-课后练习-2-10-排列
#include #include #include #include #include using namespace std;ifstream fin("f:\\input.txt");ofstream fout("f:\\output.txt");int main(){ //freopen("f:\\input.txt", "r", stdin); //freope
2013-12-27 16:09:09 616
原创 算法竞赛入门经典-书本例子-3-3-竖式计算
#include #include #include #include #include #include using namespace std;int main(){ int count = 0; char s[20]; cin >> s; for(int abc = 100; abc != 1000; ++abc) { for(int de = 10; d
2013-12-27 16:06:14 539
原创 算法竞赛入门经典-课后练习-3-1-2分数统计
#include #include #include #include #include #include #include #include using namespace std;struct Score{ int size; double points;};vector student;vector ans;int main(){ freopen(
2013-12-27 16:00:39 653
原创 UVa10010 - Where's Waldorf?-字符串(8方向搜索)-难度3
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=951 Where's Waldorf? Given a m by n grid of letters, ( ), and a l
2013-12-27 15:51:03 583
原创 UVa409 - Excuses, Excuses!-字符串-难度2
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=350代码+思路#include #include #include #include #include #include #include #include us
2013-12-25 18:04:09 468
原创 UVa537 - Artificial Intelligence?-字符串(混合字符实数输入)-难度3
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=350代码+思路/* * 1.用字符输入,当碰到实数的时候换实数输入,省去了把字符转换为实数的步骤 * 2.每次遇见'\n'或者文件输入结束
2013-12-25 17:19:56 519
原创 UVa401 - Palindromes-字符串(镜像字符串)-难度2
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=342 Palindromes A regular palindrome is a string of numbers or lett
2013-12-25 14:56:40 752
原创 UVa10815 - Andy's First Dictionary- 字符串(map的使用)-难度2
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1756Problem B: Andy's First DictionaryTime limit: 3 seconds
2013-12-24 18:45:50 608
原创 UVa10115 - Automatic Editing- 字符串(子串替换)-难度2
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=96&page=show_problem&problem=1056Problem E: Automatic EditingSource file:autoedit.{c, cpp, java,
2013-12-24 16:30:29 742
原创 UVa10361-Automatic Poetry-字符串-难度1
题目链接:http://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem&problem=1302Problem IAutomatic PoetryInput: standard inputOutput: standard outputTime Limit:
2013-12-24 11:53:32 623
原创 OpenCV学习-第二章-视频播放控制-支持滚动条随着视频播放自动移动
支持滚动条随着视频播放自动移动/*第三个OpenCV程序*/#include "opencv/cv.h"#include "opencv/highgui.h"int g_slider_position = 0;CvCapture *g_capture = NULL;void onTrackbarSlide(int pos){ /* * Function:Sets a pro
2013-12-23 15:29:16 891
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人