全部评论
9 45第二题直接cout的。。😂😂😂
分享
public class DiDi {
public static void main(String[] args) {
// TODO Auto-generated method stub
Scanner sc = new Scanner(System.in);
int n=sc.nextInt();
int total=sc.nextInt();
int cost=sc.nextInt();
int[] num1=new int[n];
int[] num2=new int[n];
for(int i=0;i<n;i++) {
num1[i]=sc.nextInt();
}
for(int i=0;i<n;i++){
num2[i]=sc.nextInt();
}
int[][] dp=new int[n+1][n+1];
int res=0;
for(int i=1;i<n+1;i++) {
for(int j=1;j<n+1;j++) {
if(num1[i-1]==num2[j-1]) {
dp[i][j]=Math.max(dp[i-1][j-1]+1,dp[i][j-1]);
}else {
dp[i][j]=Math.max(dp[i][j-1], dp[i-1][j]);
}
}
}
System.out.println(Math.min(total/cost, dp[n][n]));
}
}
过了45 哪里不对啊
分享
春招专场
官网直投
我惊了,我case跟你相反😂😂😂😂
分享
相关推荐
04-23 23:21
摄影/摄像 点赞 评论 收藏
转发
北京中电45所 对自研产品进行测试或质量保证 工资待遇约了下周谈,可能每月应该会比东软多个4-6k的样子,不过可能会涉及到绩效工资,还不清楚占比多少。
点赞 评论 收藏
转发
03-07 14:01
已编辑
点赞 评论 收藏
转发
点赞 评论 收藏
转发