当前位置:网站首页>1061 True or False (15 points)
1061 True or False (15 points)
2022-08-11 07:48:00 【dumb bit】
题目要求:
代码:
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]);
}
}
}
结果:
边栏推荐
猜你喜欢
随机推荐
prometheus学习5altermanager
Implementation of FIR filter based on FPGA (5) - FPGA code implementation of parallel structure FIR filter
1101 B是A的多少倍 (15 分)
梅科尔工作室——BP神经网络
详述 MIMIC护理人员信息表(十五)
恒源云-Pycharm远程训练避坑指南
js判断图片是否存在
【LeetCode每日一题】——844.比较含退格的字符串
Unity游戏排行榜的制作与优化
redis操作
深度监督(中继监督)
There may be fields that cannot be serialized in the abnormal object of cdc and sqlserver. Is there anyone who can understand it? Help me to answer
tf.cast(),reduce_min(),reduce_max()
你是如何做好Unity项目性能优化的
TF中的条件语句;where()
1081 检查密码 (15 分)
Pinduoduo API interface
4.1-支持向量机
国密规范 SM2 SM3 SM4
无服务器+域名也能搭建个人博客?真的,而且很快