当前位置:网站首页>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]);
}
}
}
结果:
边栏推荐
- 1101 How many times B is A (15 points)
- matplotlib
- Trill keyword search goods - API
- TF中的One-hot
- 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
- 你是如何做好Unity项目性能优化的
- 一张图了解JVM八大原子操作
- Pico neo3在Unity中的交互操作
- maxwell concept
- Production and optimization of Unity game leaderboards
猜你喜欢
随机推荐
1056 组合数的和 (15 分)
Redis测试
1051 Multiplication of Complex Numbers (15 points)
maxwell concept
[Recommender System]: Overview of Collaborative Filtering and Content-Based Filtering
SQL滑动窗口
结合均线分析k线图的基本知识
从苹果、SpaceX等高科技企业的产品发布会看企业产品战略和敏捷开发的关系
Tensorflow中使用tf.argmax返回张量沿指定维度最大值的索引
你是如何做好Unity项目性能优化的
项目2-年收入判断
Go语言实现Etcd服务发现(Etcd & Service Discovery & Go)
tf中自减操作;tf.assign_sub()
C语言每日一练——Day02:求最小公倍数(3种方法)
Pytorch模型转ONNX模型
语音信号处理:预处理【预加重、分帧、加窗】
tf.cast(), reduce_min(), reduce_max()
博途PLC 1200/1500PLC ModbusTcp通信梯形图优化汇总(多服务器多从站轮询)
技术分享 | 实战演练接口自动化如何处理 Form 请求?
TF中使用softmax函数;