2018年11月27日

1006 Sign In and Sign Out

摘要: 水题~ #include<iostream> #include<algorithm> #include<string.h> #define maxn 25 using namespace std; typedef long long ll; char s[maxn],ttime[10]; int m 阅读全文

posted @ 2018-11-27 21:22 FTA_Macro 阅读(97) 评论(0) 推荐(0) 编辑

1005 Spell It Right

摘要: 开个string数组存数字英文。 因为数为10100,所以和最多为900,int求和就够了。水题~ #include<iostream> #include<algorithm> #include<string.h> #define maxn 25 using namespace std; typed 阅读全文

posted @ 2018-11-27 20:58 FTA_Macro 阅读(94) 评论(0) 推荐(0) 编辑

1023 Have Fun with Numbers

摘要: 因为最多有20个字符,int和long long都不行,所以只能用字符串操作。水题~ #include<iostream> #include<algorithm> #include<string.h> #define maxn 25 using namespace std; typedef long 阅读全文

posted @ 2018-11-27 20:10 FTA_Macro 阅读(67) 评论(0) 推荐(0) 编辑

2018年11月26日

1008 Elevator

摘要: 水题~ #include <iostream> #include <cstring> #include <string> #include <sstream> #include <string> #include <cstdio> #include <algorithm> #include <vec 阅读全文

posted @ 2018-11-26 23:06 FTA_Macro 阅读(109) 评论(0) 推荐(0) 编辑

1002 A+B for Polynomials

摘要: 水题~ 最好是把得到所有的幂放在一个数组里,然后排序去重,不过这题的幂最大只有1000,所以这么写了。 一开始没看到保留一位小数,wa了一发,难受。 #include <iostream> #include <cstring> #include <string> #include <sstream> 阅读全文

posted @ 2018-11-26 20:47 FTA_Macro 阅读(140) 评论(0) 推荐(0) 编辑

1001 A+B Format

摘要: 这道水题有个巨坑:1000的输出是1,000而不是100,0。因为这个改了一早上代码。 还有一个要注意的是和为0的时候,这个简单。 #include <iostream> #include <cstring> #include <string> #include <sstream> #include 阅读全文

posted @ 2018-11-26 12:19 FTA_Macro 阅读(186) 评论(0) 推荐(0) 编辑

2017年9月3日

POJ 1007 DNA Sorting

摘要: Description One measure of ``unsortedness'' in a sequence is the number of pairs of entries that are out of order with respect to each other. For inst 阅读全文

posted @ 2017-09-03 11:10 FTA_Macro 阅读(122) 评论(0) 推荐(0) 编辑

2017年8月21日

HDU 4841 圆桌问题

摘要: 圆桌上围坐着2n个人。其中n个人是好人,另外n个人是坏人。如果从第一个人开始数数,数到第m个人,则立即处死该人;然后从被处死的人之后开始数数,再将数到的第m个人处死……依此方法不断处死围坐在圆桌上的人。试问预先应如何安排这些好人与坏人的座位,能使得在处死n个人之后,圆桌上围坐的剩余的n个人全是好人。 阅读全文

posted @ 2017-08-21 20:07 FTA_Macro 阅读(308) 评论(0) 推荐(0) 编辑

2017年8月17日

HDU 1274 展开字符串

摘要: 在纺织CAD系统开发过程中,经常会遇到纱线排列的问题。 该问题的描述是这样的:常用纱线的品种一般不会超过25种,所以分别可以用小写字母表示不同的纱线,例如:abc表示三根纱线的排列;重复可以用数字和括号表示,例如:2(abc)表示abcabc;1(a)=1a表示a;2ab表示aab;如果括号前面没有 阅读全文

posted @ 2017-08-17 17:54 FTA_Macro 阅读(326) 评论(0) 推荐(0) 编辑

2017年8月11日

HDU 2044 一只小蜜蜂...

摘要: Problem Description 有一只经过训练的蜜蜂只能爬向右侧相邻的蜂房,不能反向爬行。请编程计算蜜蜂从蜂房a爬到蜂房b的可能路线数。其中,蜂房的结构如下所示。 Input 输入数据的第一行是一个整数N,表示测试实例的个数,然后是N 行数据,每行包含两个整数a和b(0<a<b<50)。 O 阅读全文

posted @ 2017-08-11 15:16 FTA_Macro 阅读(132) 评论(0) 推荐(0) 编辑

导航