BestCoder #50
来源:互联网 发布:javascript generator 编辑:程序博客网 时间:2024/05/01 14:46
1001 Distribution money
WA过一发,因为忽视了金额的分布范围。
/** * 2015年8月8日 下午7:02:20 * PrjName:Bc50-01 * @ Semprathlon */import java.io.*;import java.util.*;public class Main { static int[] a; static int maxn=10001; public static void main(String[] args) throws IOException{ // TODO Auto-generated method stub StreamTokenizer in=new StreamTokenizer(new BufferedInputStream(System.in)); PrintWriter out=new PrintWriter(System.out); a=new int[maxn]; while(in.nextToken()!=StreamTokenizer.TT_EOF){ int n=(int)in.nval; Arrays.fill(a, 0); for(int i=1;i<=n;i++){ in.nextToken(); int k=(int)in.nval; a[k]++; } int ans=-1; for(int i=0;i<maxn;i++) if ((a[i]<<1)>n) ans=i; //if (n>1) out.println(ans); //else //out.println(-1); } out.flush(); out.close(); }}
1002 Run
明显搞复杂了,
平面上的整点就是无法构成正三角形、正五边形、正六边形,没这点见识就只有瞎弄。。。
1003 The mook jong
多么有教育意义的猜公式,猜不出就别偏执了。。。
f[i]=s[i-3]+1,s[i]=s[i-1]+f[i],…
0 0
- BestCoder #50
- bestcoder #50 div2
- BestCoder Round #50 Bribery
- BestCoder Round #50
- BestCoder
- bestcoder
- BestCoder Round #50 (div.2)
- BestCoder Round #50 (div.2)
- BestCoder Round 50 (div 2)
- BestCoder Round #50 (div.2)
- #BestCoder Round #50 (div.2)
- BestCoder Round #50 (div.2)
- BestCoder Round #50 (div.2) 1001
- BestCoder Round #50 (div.2) 1003
- BestCoder Round #50 (div.2) 1001
- hdu 5367 digger && BestCoder Round #50
- BestCoder Round #50 (div.2) & HDOJ5364 Search Result(模拟)
- BestCoder Round #50 (div.2) & HDOJ5366 The mook jong(dp)
- [Android源码解析] 清空应用内部文件缓存
- 附上windebug常用调试命令
- Nginx基本数据结构之ngx_http_request_t结构体
- Part3. OSGi之模块-Bundle
- windebug查看KeServiceDescriptorTable
- BestCoder #50
- linux内核中的IS_ERR()、PTR_ERR()、ERR_PTR()
- 【LeetCode】2(7)Remove Element(Easy)
- Java编程语言概述
- WIN7+WDK7600+VS2008+DDKWizard搭建内核驱动开发环境
- BestCoder #52
- leetcode 168: Excel Sheet Column Title
- 高大上的链路层简介
- String, StringBuffer, StringBuilder三者区别