当前位置:网站首页>1061 判断题 (15 分)
1061 判断题 (15 分)
2022-08-11 06:46:00 【呆比特】
题目要求:
代码:
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//輸入
Scanner scanner = new Scanner(System.in);
int n = scanner.nextInt();
int m = scanner.nextInt();
scanner.nextLine();
String []fenShu = scanner.nextLine().split(" ");
String []daAn = scanner.nextLine().split(" ");
int []deFen = new int[n];
for (int i = 0; i <n; i++) {
String[] s = scanner.nextLine().split(" ");
int sum = 0;
for (int j = 0; j < m; j++) {
if (Integer.valueOf(s[j]) == Integer.valueOf(daAn[j]))
sum += Integer.valueOf(fenShu[j]);
}
deFen[i] = sum;
}
for (int i = 0; i < n; i++) {
System.out.println(deFen[i]);
}
}
}
结果:
边栏推荐
- 下一代 无线局域网--强健性
- 【Pytorch】nn.ReLU(inplace=True)
- 【LaTex-错误和异常】\verb ended by end of line.原因是因为闭合边界符没有在\verb命令所属行中出现;\verb命令的正确和错误用法、verbatim环境的用法
- Redis测试
- 从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
- 【LeetCode每日一题】——682.棒球比赛
- Redis + lua implements distributed interface current limiting implementation scheme
- prometheus学习4Grafana监控mysql&blackbox了解
- Shell:三剑客之awk
- 1688 product interface
猜你喜欢

李沐d2l(十)--卷积层Ⅰ

How to choose professional, safe and high-performance remote control software

Taobao sku API interface (PHP example)

伦敦银规则有哪些?

Coordinate system in navigation and positioning

MindManager2022全新正式免费思维导图更新

Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter

buu—Re(5)

SQL滑动窗口

Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)
随机推荐
年薪40W测试工程师成长之路,你在哪个阶段?
深度监督(中继监督)
NTT的Another Me技术助力创造歌舞伎演员中村狮童的数字孪生体,将在 “Cho Kabuki 2022 Powered by NTT”舞台剧中首次亮相
Find the shops that have sold more than 1,000 yuan per day for more than 30 consecutive days in the past six months
linux 安装mysql服务报错
机器学习总结(二)
Daily sql--statistics the total salary of employees in the past three months (excluding the latest month)
jar服务导致cpu飙升问题-带解决方法
Activity的四种状态
EasyPlayer针对H.265视频不自动播放设置下,loading状态无法消失的解决办法
【Pytorch】nn.Linear,nn.Conv
TF通过feature与label生成(特征,标签)集合,tf.data.Dataset.from_tensor_slices
What are the things that should be planned from the beginning when developing a project with Unity?How to avoid a huge pit in the later stage?
Get Pinduoduo product information operation details
tf中自减操作;tf.assign_sub()
【LeetCode每日一题】——682.棒球比赛
2022-08-09 第四小组 修身课 学习笔记(every day)
进制转换间的那点事
DDR4内存条电路设计
Unity程序员如何提升自己的能力