oj之旅
小少年驭风
在学校读书的小伙子
展开
-
Rectangle
#include using namespace std; #include #include char sum[10000]; int flag=0; int weishu(long long n) { int zhi=0; while(n!=0) { n=n/10; zhi++; } return zhi; } void原创 2017-05-05 08:44:19 · 317 阅读 · 0 评论 -
uva 213 信息解码还是挺符合人的认知 有注释可以看看
#include using namespace std; #include #include #include #include char chr[8][1<<8]={'\0'}; void inch(string s)//good!!!! { memset(chr,'\0',sizeof(chr)); int flag=0; int len=s.length();//定原创 2017-05-15 10:00:16 · 261 阅读 · 0 评论 -
Ants POJ - 1852
#include #include #include //int pos[1000050]; using namespace std; int main() { int l,n,t,m; scanf("%d",&t); for(int i=1;i<=t;i++) { int min1=0,max1=0; scanf("%d%d",&l原创 2017-07-25 15:42:13 · 223 阅读 · 0 评论 -
Lake Counting POJ - 2386
#include #include using namespace std; char t[105][105]; int n,m; void dfs(int x,int y) { t[x][y]='.'; int nx,ny; for(int dx=-1;dx<=1;dx++) { for(int dy=-1;dy<=1;dy++)原创 2017-08-01 13:23:24 · 203 阅读 · 0 评论 -
硬币问题2.2(1)
#include using namespace std; #include int main() { int m[6]={1,5,10,50,100,500}; int n[6]; int total=0; for(int i=0;i<6;i++) { scanf("%d",&n[i]); } scanf("%d",&tot原创 2017-09-20 16:31:51 · 200 阅读 · 0 评论 -
区间问题
贪心算法即可#include #include #include using namespace std; const int Maxn=100000; typedef pair p; p c[Maxn]; int cmp(const p &a,const p &b) { if(a.second<b.second) return 1; else return 0;原创 2017-10-25 09:08:17 · 247 阅读 · 0 评论 -
01bag problem measure1:most easiest way to find the answer.measure2:use the easier way to solve
i travel the whole binary tree.#include<iostream> #include<stdio.h> #define Max_N 100 using namespace std; int res=0,Max=0; int N,W; int t[Max_N][2]; void fun(int i,int j) { if(i==N) ...原创 2018-03-23 16:10:00 · 189 阅读 · 0 评论