HDU 1555 How many days?
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1555模拟一下就行了..注意不要忘了musing namespace std;int main(){ int m,k; int ans; while(cin>>m>>k&&m+k!=0) ...
阅读全文
NYOJ 168 房间安排
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=168模拟即可:#include using namespace std;int sign[200];int main(){ int t; int n; int i; in...
阅读全文
NYOJ 113 字符串替换
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=113直接用string类里的fin()和replace()成员函数即可#include #includeusing namespace std;int main(){ string dat...
阅读全文
NYOJ 4 ASCII码排序
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=4水题#include #includeusing namespace std;int main(){ int n; cin>>n; char data[5]; while...
阅读全文
HDU 1321 Reverse Text
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1321水题....记得要吃换行符#include#include int main(){ char data[100]; int t; scanf("%d",&t); getchar(); while(t--...
阅读全文
HDU 1234 开门人和关门人
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1234直接用strcmp()比较时间即可#include #include int main(){ bool judge(char t1[],char t2[]); char id[20]; char t1[...
阅读全文
NYOJ 912 领帽子
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=912全错位排列,按照欧拉给出的递推公式:f(n)=(n-1) {f(n-1)+f(n-2)}#include using namespace std;int main(){ long long ...
阅读全文
NYOJ 95 众数问题
摘要:链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=95理解题意后就很简单了..数组标记法#include using namespace std;int sign[100000];int main(){ int n; int m; cin>>n;...
阅读全文
HDU 3346 Lucky Number
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=3346少输出一个感叹号,,wa好几次......#include #include #include using namespace std;int main(){ char buf[100]; int t;...
阅读全文
BNUOJ 1013 YC大牛的判题任务
摘要:链接:http://www.bnuoj.com/bnuoj/problem_show.php?pid=1013水题..用结构体二级排序即可..#include #include using namespace std;typedef struct{ int num; int time;}pro;pr...
阅读全文
BNUOJ 1011 人工智能?
摘要:链接:http://www.bnuoj.com/bnuoj/problem_show.php?pid=1011简单题,..字符串查找注意有有小数出现#include #include #include #include using namespace std;string data;int main...
阅读全文
HDU 1035 Robot Motion
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1035简单模拟题...但有几个细节需要注意:1>当输入为0 0 时程序会不会正常结束(如果scanf("%d%d%d",....)是不可以滴)2>走到边缘是不结束的,只要迈出去才算3>注意loop的步数,不要...
阅读全文
HDU 1214 圆桌会议
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1214把每个桌子分成两半,分开考虑。比如,圆桌7个人的话,就分成一个4人的,一个3人的单向序列...分别算出把每个序列反向排序需要的最少交换次数(6,3)。。两个的和即为结果9 ,,再求每个长度为 i 的单向...
阅读全文
HDU 2602 Bone Collector
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=2602简单01背包#include #define MAX( a, b ) ((a>b)?(a):(b)) using namespace std;typedef struct { int value; in...
阅读全文
HDU 1157 Who's in the Middle
摘要:链接:http://acm.hdu.edu.cn/showproblem.php?pid=1157水题。。~~·~洪水#include #include int data[10005];int comp(const void *a,const void * b){ return *(int*)a -...
阅读全文