Difficult Player Grouping JAVA 未验证AC
来源:互联网 发布:狼人杀抿身份数据 编辑:程序博客网 时间:2024/06/05 08:59
import java.util.ArrayList;import java.util.Arrays;import java.util.Collection;import java.util.Collections;import java.util.Scanner;public class Main {public static void main(String[] args) {// TODO Auto-generated method stubScanner scanner = new Scanner(System.in);int T = scanner.nextInt();int[] result = new int[T];while (T-- > 0) {// 英雄个数int heroNumber = scanner.nextInt();int[] choiceList = new int[heroNumber];for (int index = 0; index < heroNumber; index++) {choiceList[index] = scanner.nextInt();}int groupNumber = 0;Arrays.sort(choiceList);while (choiceList[heroNumber - 1] != 0 && choiceList[heroNumber - 2] != 0&& choiceList[heroNumber - 3] != 0) {choiceList[heroNumber - 1] = choiceList[heroNumber - 1] - 1;choiceList[heroNumber - 2] = choiceList[heroNumber - 2] - 1;choiceList[heroNumber - 3] = choiceList[heroNumber - 3] - 1;groupNumber++;Arrays.sort(choiceList);}result[T] = groupNumber / 2;}for (int index = result.length - 1; index >= 0; index--) {System.out.println(result[index]);}}}
0 0
- Difficult Player Grouping JAVA 未验证AC
- [网易笔试]Difficult Player Grouping
- Difficult Player Grouping(2015网易游戏笔试题)
- 网易游戏2016校园招聘“游戏研发&平台开发”在线笔试——D题 Difficult Player Grouping
- 未AC
- [未AC]HDU1002
- HDU4069(未AC)
- UVa1589(未ac)
- 未AC 题
- uva10142(未ac)
- uva336(未ac)
- java访问未验证证书的HTTPS
- java访问未验证证书的HTTPS
- 字符串验证Java工具类(未测试)
- java 生成验证码 (未测试)
- java实现验证码完整版(未测试)
- GROUPING
- grouping
- java基础面试题(1)
- java第7天
- GestureDetector方法中的几个参数
- Python操作MySQL数据库9个实用实例
- export `=' not a valid identifier的一般原因
- Difficult Player Grouping JAVA 未验证AC
- 判断iOS设备型号
- linux TOP命令各参数详解【转载】
- 如何修改hosts
- 织梦dedecms如何自动获取当前系统时间
- 类的定义3
- OSX下同时安装opencv2 和 opencv3
- CodeForces 622B
- build模式小例子