【求和排序问题】手机游戏LoveLive!学园偶像祭 Java编写活动小工具Medley Festival最强刷分组合计算小程序(1)

这个非洲人的游戏不是你随手就能抽到max combo组合的- -||

所以我们抽到相对高一点的组合就可以满足了- -||

而随到什么3个400+combo这种,看都不用看直接抬走

所以怎么组合才会决定去刷分?

前5够了吧?

其实跟max combo差了100多的都可以抬走了

然而有时候排到第10都没差上100呢?

算了还是保留前5吧


到这里,大部分读者都不知道我想表达什么w

因为你们都不是LLer,不玩LL手游

所以我有必要用通俗的语言描述一下问题


问题背景:

手机游戏LoveLive!学院偶像祭(一个音乐抽卡游戏)的一种活动形式Medley Festival

连续演奏3首歌,最后得到一个总分

这个总分需要参与High Score榜单排名可以获得一些非常好的奖励(博主梦寐以求的奖励

游戏里面,打击基础分是一样的(就是无论打完这首歌要点多少次屏幕,第1次点击的分数是固定的——这和其他一些音游不一样)

所以当3首歌要打击的次数总和(以下简称物量)最多的时候,可以获得最高的分数

然后,歌曲有3种属性,每种属性都会抽8首歌出来作为活动曲目。

每次抽到的3首歌属性是一致的。

所以为了简化问题,我们可以理解为曲池只有8首歌,随机抽3首演奏。

那么我怎么才知道这3首组合是不是物量比较多的组合?


比如日服第16回Medley Festival的Smile 曲池:

曲名 物量

Aqours☆HEROES 515
元気全開DAY!DAY!DAY! 592
届かない星だとしても 563
青空Jumping Heart 471
決めたよHand in Hand 569
Guilty Night, Guilty Kiss! 443
Pops heartで踊るんだもん! 532
MIRAI TICKET 536


前5的组合分别是:

第1组:1724Combo,曲目:元気全開DAY!DAY!DAY!,決めたよHand in Hand,届かない星だとしても
第2组:1697Combo,曲目:元気全開DAY!DAY!DAY!,決めたよHand in Hand,MIRAI TICKET
第3组:1693Combo,曲目:元気全開DAY!DAY!DAY!,決めたよHand in Hand,Pops heartで踊るんだもん!
第4组:1691Combo,曲目:元気全開DAY!DAY!DAY!,届かない星だとしても,MIRAI TICKET
第5组:1687Combo,曲目:元気全開DAY!DAY!DAY!,届かない星だとしても,Pops heartで踊るんだもん!

(红组BOOM AGAIN!跟第15回一毛一样)


通俗易懂的问题描述(面向ACM程序设计的):

给出8个正整数,从中随机抽3个数,求出他们的和。

然后在这些求得的和中,取出最大的5个数,输出这5个数,并输出求得这个和的原来3个加数,按组输出。

如果存在并列第5(或4,3,2,1;总之排序后在第6个位置以后的只要和第5位的数相等,都算),则把并列的都输出。


示例输入:

12

2

5

18

16

9

1

6


示例输出:

46=18+16+12

43=18+16+9

40=18+16+6

39=18+16+5

39=18+12+9


准备工作:

包含所有曲目信息的数据库,用一个文件保存。会单开一个附录表示,因为不是程序的重点。程序设计中路径为D:/SongInfo.dat


【1】构造歌曲资料类


最基本的歌曲类,包含SIF里歌曲的所有信息(歌名,歌手,类型,各难度星级和物量等等;但不包括怎么打call,初回销量多少这种和手游无关的信息,要注意)

每个成员变量都设个getter,因为都会用得上。

此外,有可能会根据难度关键字来提取数据,因此加一个带参方法以便根据难度得到对应数据。public int GetNote(String Diff);

print()函数是测试用的,打印该歌曲的所有资料。

构造方法初始化一部分资料,因为一首歌登陆游戏时这些数据都是已经确定且不会变更的(赋值为-1的三个数据除外,要过一段时间才会知道)

该部分编写时遇到问题都是基础问题,从略。

package songInfo;

import exceptions.DifficultyDoNotExistException;

public class SongData {
	private String Name;		//歌名
	private String Vocal;		//歌手
	private String Type;		//歌曲类型(Smile,Pure,Cool)
	private int BPM;			//BPM
	private int LastTime;		//持续时间
	private int EasyDiff;		//easy难度
	private int EasyNote;		//easy物量
	private int NormalDiff;	//normal难度
	private int NormalNote;	//normal物量
	private int HardDiff;		//hard难度
	private int HardNote;		//hard物量
	private int ExpertDiff;	//expert难度
	private int RandomDiff;	//随机难度
	private int ExpertNote;	//expert物量
	private int MasterDiff;	//master难度
	private int MasterNote;	//master物量
	SongData(String name, String vocal, String type, int bpm, int lastTime, int easyDiff, int easyNote, int normalDiff, int normalNote, int hardDiff, int hardNote, int expertDiff, int expertNote){
		Name=name;
		Vocal=vocal;
		Type=type;
		BPM=bpm;
		LastTime=lastTime;
		EasyDiff=easyDiff;
		EasyNote=easyNote;
		NormalDiff=normalDiff;
		NormalNote=normalNote;
		HardDiff=hardDiff;
		HardNote=hardNote;
		ExpertDiff=expertDiff;
		ExpertNote=expertNote;
		RandomDiff=-1;
		MasterDiff=-1;
		MasterNote=-1;
	}
	public void SetRandom(int diff)
	{
		RandomDiff=diff;
	}
	public void SetMaster(int diff, int note)
	{
		MasterDiff=diff;
		MasterNote=note;
	}
	public int GetEasyDiff()
	{
		return EasyDiff;
	}
	public int GetEasyNote()
	{
		return EasyNote;
	}
	public int GetNormalDiff()
	{
		return NormalDiff;
	}
	public int GetNormalNote()
	{
		return NormalNote;
	}
	public int GetHardDiff()
	{
		return HardDiff;
	}
	public int GetHardNote()
	{
		return HardNote;
	}
	public int GetExpertDiff()
	{
		return ExpertDiff;
	}
	public int GetRandomDiff()
	{
		return RandomDiff;
	}
	public int GetExpertNote()
	{
		return ExpertNote;
	}
	public int GetMasterDiff()
	{
		return MasterDiff;
	}
	public int GetMasterNote()
	{
		return MasterNote;
	}
	/**
	 * 根据难度返回物量值
	 * @param Diff	难度
	 * @return	物量
	 * @throws DifficultyDoNotExistException 难度不存在异常
	 */
	public int GetNote(String Diff) throws DifficultyDoNotExistException{
		if(Diff=="Easy")return EasyNote;
		else if(Diff=="Normal")return NormalNote;
		else if(Diff=="Hard")return HardNote;
		else if(Diff=="Expert")return ExpertNote;
		else if(Diff=="Master")return MasterNote;
		else throw new DifficultyDoNotExistException();
	}
	public String GetName()
	{
		return Name;
	}
	public int GetBPM()
	{
		return BPM;
	}
	public int GetLastTime()
	{
		return LastTime;
	}
	public String GetVocal()
	{
		return Vocal;
	}
	public String GetType()
	{
		return Type;
	}
	public void print()
	{
		System.out.println("Name:"+Name);
		System.out.println("Type:"+Type);
		System.out.println("BPM:"+BPM);
		System.out.println("LastTime:"+LastTime);
		System.out.println("Easy: ☆" + EasyDiff + ", "+ EasyNote +"Combo");
		System.out.println("Normal: ☆" + NormalDiff + ", "+ NormalNote +"Combo");
		System.out.println("Hard: ☆" + HardDiff + ", "+ HardNote +"Combo");
		System.out.println("Expert: ☆" + ExpertDiff +"/"+RandomDiff+ ", "+ ExpertNote +"Combo");
		System.out.println("Master: ☆" + MasterDiff + ", "+ MasterNote +"Combo");
	}
}

下一篇将记录歌单的构成,容我先休息一天XXXXXXD

18
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值