- 博客(8)
- 收藏
- 关注
原创 oil deposits dfs
#include <iostream> #include <string.h> #include <algorithm> using namespace std; const int N=110; int map[N][N]; char array[N][N]; int dir[8][2]={{0,1},{1,0},{0,-1},{-1,0},{1,1},...
2019-01-30 14:34:38 226
原创 counting sheep dfs
#include <iostream> #include <string.h> #include <algorithm> #include <stdio.h> using namespace std; const int N=110; int dir[4][2]={1,0,-1,0,0,1,0,-1}; int map[N][N]; ch...
2019-01-30 14:16:50 291
原创 HDU 1312 Red and black dfs
#include <iostream> #include <algorithm> #include <string.h> using namespace std; const int N=30; int w,h,step; char array[N][N]; int ma[N][N]; //int dir[4][2]={{0,1},{1,0},{-1,0}...
2019-01-28 20:42:19 195
原创 HDU 6318 Swaps and inversions 树状数组
#include<iostream> #include<map> #include<algorithm> #include<cstring> #define ll long long using namespace std; const int N = 5e5+10; int n; ll c[N]; int a[N],b[N]; map<...
2019-01-27 15:30:19 210
原创 HDU 1556 color the ball 树状数组
#include <bits/stdc++.h> using namespace std; #define N 100009 int c[N],n; int lowbit(int i){ return (i&(-i)); } void add(int i,int data){ while(i<=n){ c[i]+=data; i+=lowbit(i)...
2019-01-26 17:39:22 200
原创 HDU 4325 Flowers 树状数组
#include <bits/stdc++.h> using namespace std; #define NN 100009 long long c[NN],n=100005; long long lowbit(long long i){ return (i&(-i)); } void add(long long i,long long data){ whil...
2019-01-26 17:33:17 207
原创 HDU 1166 敌兵布阵 树状数组
#include <bits/stdc++.h> using namespace std; const int N = 5e4 + 10; int t,n,tmp,i,j; int c[N]; int lowbit(int i){ return (i&-i); } void add(int i,int data){ while(i<=n){ ...
2019-01-25 14:59:19 148
原创 HDU 4970 Killing Monsters 树状数组
#include <bits/stdc++.h> using namespace std; #define N 100009 long long c[N],sum[N],n; long long lowbit(long long x){ return (x&(-x)); } void add(long long i,long long d){ while(i...
2019-01-25 14:54:40 150
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人