自定义博客皮肤VIP专享

*博客头图:

格式为PNG、JPG,宽度*高度大于1920*100像素,不超过2MB,主视觉建议放在右侧,请参照线上博客头图

请上传大于1920*100像素的图片!

博客底图:

图片格式为PNG、JPG,不超过1MB,可上下左右平铺至整个背景

栏目图:

图片格式为PNG、JPG,图片宽度*高度为300*38像素,不超过0.5MB

主标题颜色:

RGB颜色,例如:#AFAFAF

Hover:

RGB颜色,例如:#AFAFAF

副标题颜色:

RGB颜色,例如:#AFAFAF

自定义博客皮肤

-+
  • 博客(34)
  • 收藏
  • 关注

原创 1A--Theatre Square

注意:64位. #include #include using namespace std; int main() { unsigned long long n,m,a; cin >> n >> m >> a; unsigned long long lennumber,widnumber; if(n % a == 0) lennumber =

2014-07-31 19:39:06 284

原创 csu1256

1256: 天朝的单行道 Time Limit: 1 Sec  Memory Limit: 128 MB Submit: 169  Solved: 50 [Submit][Status][Web Board] Description     在另一个平行宇宙中,有一个神奇的国度名叫天朝。天朝一共有N个城市(标号分别为1, 2, …, N),M条道路,为了方便交通管制,天朝的M

2014-07-31 17:01:35 347

原创 hdu2503

map的应用。输入一个字典,字典格式为“英语à外语”的一一映射关系。 然后输入若干个外语单词,输出他们的 英语翻译单词,如果字典中不存在这个单词,则输出“eh”。

2014-07-30 23:42:53 368

原创 hdu1004

map的在acm中应用。 Map 简介: map是一类关联式容器。它的特点是增加和删除节点对迭代器的影响很小,除了那个操作节点,对其他的节点都没有什么影响。对于迭代器来说,可以修改实值,而不能修改key。

2014-07-30 18:28:59 369

原创 hdu1698

线段树的应用。 #include #include #include using namespace std; int sum[400020],setv[400020]; int _sum; void build(int rt,int L,int R) { if(L == R) sum[rt] = 1; else { int M = (L +

2014-07-30 16:48:53 301

原创 hdu1754

线段树的应用 #include #include #include #include #define maxx 200003 using namespace std; int cat[4 * maxx],N,F,p,v,ql,qr; void update(int r,int L,int R) { int mid = (L + R) / 2; if(L == R)

2014-07-29 23:37:37 280

原创 hdu1874

总共四种做法,dijkstra,bellman,spfa,floyd

2014-07-28 22:42:09 257

原创 hdu1711

numbersequence #include #include using namespace std; int a[1000002],b[10002],n,m; int next[10002]; void getnext(int *s,int *next) { next[0] = next[1] = 0; for(int i = 1;i < m;i ++)

2014-07-26 21:40:26 291

原创 poj3984

用BFS做, #include #include using namespace std; struct node { int x,y,pre; }dog[110]; int cat[110][110]; int rabbit[4][2] = {{1,0},{0,1},{-1,0},{0,-1}}; void print(int i) { if(dog[i].pr

2014-07-26 20:04:39 360

原创 hdu1213

并查集的思想,只要有相关关系的

2014-07-26 19:59:14 330

原创 hdu1575

矩阵快速幂的应用,先定义一个结构体,定义矩阵和矩阵乘法,方便以后直接调用,再写一个矩阵快速幂的函数,进行相关运算。其实对于比较大的指数运算时,快速幂的优势是很明显的,时间复杂度降低到很小。 #include #include #include #define mode 9973 using namespace std; int n; struct matrix { int ma

2014-07-26 13:40:47 417

原创 hdu2035

本题数据不是很大,应该用公式

2014-07-26 11:44:00 434

原创 hdu2199

二分法,当然也是搜索类的题。做题时注意二分法的实质

2014-07-24 20:03:21 415

原创 poj3342

树状动态规划 本题

2014-07-23 11:02:24 524

原创 csu1340

#include using namespace std; int main() { int t; cin>>t; while(t--) { int a; bool lucky=false; cin>>a; while(a) { if(a%10==7)lucky=true; a/=10; } cout<<(lucky?"Lucky":"Unlucky")<<'\n'; } return 0; }

2014-07-20 21:04:01 313

原创 csu1468

#include using namespace std; int main() { int T,t0 = 0; int N,L; cin >> T; if((T >= 1) && (T <= 200)) { while(t0 < T) { cin >> N >> L; i

2014-07-20 21:03:51 317

原创 csu1284

#include #include using namespace std; int main() { int T,t0 = 0; int N; cin >> T; if((T >= 1) && (T <= 100)) { while(t0 < T) { cin >> N;

2014-07-20 21:01:38 255

原创 csu1178

#include #include using namespace std; int main() { char *p = new char[1000000]; int t1 = 0,t2 = 0,t3 = 0; while(cin >> p) { int t = strlen(p); if(t < 1000000)

2014-07-20 20:59:39 295

原创 csu1160

#include using namespace std; int main() { int x; int p[8]; while(cin >> x) { if((x >= 0) && (x <= 2147483648)) { for(int i = 0;i < 8;i ++) {

2014-07-20 20:57:39 406

原创 CSU1003

#include using namespace std; int main() { int T,t0 = 0; int n = -1; int jingyan = 0; cin >> T; if((T > 0) && (T < 120)) { while(t0 < T) { int t = 0; cin >> n; if((n >= 0) && (n <

2014-07-20 20:53:03 296

原创 csu1018

#include using namespace std; int main() { int T,t0 = 0; int a,b,c; int t1 = 0,t2 = 0,t3 = 0,t4 = 0; cin >> T; while(t0 < T) { cin >> a >> b; if((a > 0) && (

2014-07-20 20:52:47 284

原创 poj1915

#include #include using namespace std; int x1,y1,x2,y2,m,chess[310][310],chess2[310][310]; int knightx[8] = {1,1,-1,-1,2,2,-2,-2}; int knighty[8] = {2,-2,2,-2,1,-1,1,-1}; void bfs() { memset(ches

2014-07-20 20:47:19 345

原创 poj1006

#include using namespace std; int f(int p,int e,int i ,int d); int main() { int p,e,i,d; for(int t = 1;;t++) { cin >> p >> e >> i >> d; if((p >= 0)&&(e >= 0)&&(i >=0)&&(

2014-07-20 20:42:47 300

原创 poj1007

#include using namespace std; int main() { int n,m; cin >> n >> m; char **p; p = new char *[m]; for(int i = 0;i < m;i ++) p[i] = new char [n]; for(int row = 0;row <

2014-07-20 20:42:10 302

原创 poj1004

#include using namespace std; int main() { double account,averge,amount = 0; int t = 1; while(t <= 12) { cin >> account; amount = amount + account

2014-07-20 20:38:21 354

原创 poj1005

#include #include #define pi 3.1415926 using namespace std; int f(float x,float y); int main() { int N; float x,y; cin >> N; for(int t = 1;t <= N;t++) { cin >> x >> y;

2014-07-20 20:37:18 351

原创 poj1003

#include using namespace std; int main(void) { double t, c; while(cin >> t && t) { if((t>0.01)&&(t<=5.20)) { int t1 = (int)(t * 10) % 10; int t2 = (int)(t * 100

2014-07-20 20:37:03 289

原创 hdu1241

Oil Depositsoil deposits本题

2014-07-18 22:09:59 472

原创 poj2243

Knight Moves duiyu

2014-07-18 21:52:24 839

原创 poj1159

动态规划 刚开始时

2014-07-17 23:25:34 351

原创 poj2081

没什么说的,简而言之就是一个数组的问题,还是要注意的

2014-07-17 23:12:40 300

原创 poj1458

Common Subsequence Time Limit:1000MS Memory Limit:10000K 最长公共子序列,注意状态方程的确立,在求dp的两个for循环中,逐次求出应有的解,注意状态转移过程,最后求出应有的解。 #include #include #include using namespace std; int dp[1000][1000]; char cat

2014-07-17 23:05:12 291

原创 poj1163

动态规划 本题是标准的动态规划,

2014-07-17 22:45:12 319

原创 poj1837

#include #include using namespace std; int dp[21][15001]; int main() {     int a,b;     int num1[21];     int num2[21];     cin >> a >> b;     for(int i = 1;i         cin >> num1[i];

2014-07-15 22:21:23 285

空空如也

空空如也

TA创建的收藏夹 TA关注的收藏夹

TA关注的人

提示
确定要删除当前文章?
取消 删除