HDOJ 1004 Let the Balloon Rise
来源:互联网 发布:淘宝买家匿名提取软件 编辑:程序博客网 时间:2024/06/14 06:42
HDACM1004
此题思路较为简单,找到出现最多的就记录那个色球下标就好了
import java.util.Scanner;public class Main{ public static void main(String[] args) { Scanner sc = new Scanner(System.in); while (sc.hasNext()) { int n = sc.nextInt(); if (n==0) { break; } String[] strs = new String[n]; for (int i = 0; i < strs.length; i++) { strs[i] = sc.next(); } int max = 0; int max_i = 0; for (int i = 0; i < strs.length; i++) { int count = 1; for (int j = i+1; j < strs.length; j++) { if (strs[i].equals(strs[j])) { count++; } } if (max<count) { max = count; max_i = i; } } System.out.println(strs[max_i]); } }}
阅读全文
0 0
- HDOJ 1004 Let the Balloon Rise (map)
- HDOJ-1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- hdoj 1004 Let the Balloon Rise
- hdoj.1004 Let the Balloon Rise 20140726
- HDOJ Let the Balloon Rise 1004
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise(水题)
- 【HDOJ】【1004】Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDoj 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- hdoj 1004 Let the Balloon Rise (map)
- HDOJ 1004 Let the Balloon Rise
- HDOJ 1004 Let the Balloon Rise
- python 字典排序问题
- 启动ubuntu,出现stopping log initial device creation的解决方法
- 检测到在集成的托管管道模式下不适用的ASP.NET设置的解决方法(非简单设置为【经典】模式)。
- Js学习之路七 --- 获取时间、charAt()
- java学习初探十七之IO流_FileInputStream
- HDOJ 1004 Let the Balloon Rise
- 【CodeForces】 652B
- vijos1523 [NOI2002]贪吃的九头龙(树形dp)
- js ajax请求
- python学习——爬下网站的所有图片并保存在本地
- 全硬件TCP/IP协议栈学习笔记(第四天:全硬件TCP/IP协议模块学习)
- jquery封装获取表单数据组成Json数据
- 关于Class对象、类加载机制、虚拟机运行时的内存布局的全面解析和推测
- 物联网学习之数据库与物联网搜索引擎详解