摘要: 画出矩形,并能通过键盘控制小方块在矩形内移动MainActivity.javapackage cn.lesson.test;import android.app.Activity;import android.os.Bundle;import android.view.KeyEvent;import... 阅读全文
posted @ 2014-05-15 10:26 剑风云 阅读(378) 评论(0) 推荐(1)
摘要: //#define LOCAL#include#include#include#includeint const MAX_N=1001;typedef struct Point{ double x,y; bool operatorVec[i].y) { ... 阅读全文
posted @ 2014-05-15 09:40 剑风云 阅读(281) 评论(0) 推荐(0)
摘要: 为了照到点Point(x0,y0),圆心可以在一个范围内移动,我们设该范围为(x,y)(Vec[i].x,Vec[i].y)表示第如果圆心在这个范围内,则第i个点就一定能照到,sum表示为了能照到前i个点,最靠近右边的圆的边界坐标。#define LOCAL#include#include#incl... 阅读全文
posted @ 2014-05-15 09:23 剑风云 阅读(311) 评论(0) 推荐(0)
摘要: DiscountStrategy.javapackage edu.strategy;abstract public class DiscountStrategy{ abstract public double calculateDiscount();}FlatRateStrategy.java... 阅读全文
posted @ 2014-05-14 21:40 剑风云 阅读(531) 评论(0) 推荐(0)
摘要: 注意是>=//#define LOCAL#include#include#include#include#includeusing namespace std;int T,maxx;std::map word_count;std::map::iterator be,ed,result;string ... 阅读全文
posted @ 2014-05-13 20:25 剑风云 阅读(190) 评论(0) 推荐(0)
摘要: 注意java不要有包名(并且严格按照输出,一个换行符都不能少):import java.math.BigInteger;import java.util.Scanner;public class Main { public static void main(String[] args) { ... 阅读全文
posted @ 2014-05-13 17:53 剑风云 阅读(154) 评论(0) 推荐(0)
摘要: //#define LOCAL#include#includeint const MAX_N=10001;int N,T;std::pair P[MAX_N];void solve(){ char c_now='#',c_next; int i=0,sum=0; while(tru... 阅读全文
posted @ 2014-05-13 16:57 剑风云 阅读(144) 评论(0) 推荐(0)
摘要: 观察可以发现,0,1,2,……,n结尾的分组中,maxsum a[0] = a[0]maxsum a[1] = max( a[0] + a[1] ,a[1]) = max( maxsum a[0] + a[1] ,a[1])maxsum a[2] = max( max ( a[0] + a[1] +... 阅读全文
posted @ 2014-05-13 15:50 剑风云 阅读(350) 评论(0) 推荐(0)
摘要: 二分搜索思想:bool C(double x)可以得到长度为x的绳子//#define LOCAL#include#includeint const MAX_N=10005;int const MAX_M=100;double const INF=100000000;int N,K;double d... 阅读全文
posted @ 2014-05-13 10:32 剑风云 阅读(298) 评论(0) 推荐(0)
摘要: 二分查找的一点思考二分查找算法实现#define LOCAL#include#include#includeint const MAX_N=21) { int mid=(ub+lb)/2; if(a[mid]>=k) { ub=m... 阅读全文
posted @ 2014-05-12 20:58 剑风云 阅读(224) 评论(0) 推荐(0)