当前位置:网站首页>Cf:c. restoring the duration of tasks
Cf:c. restoring the duration of tasks
2022-06-11 18:47:00 【Review of the white speed Dragon King】

analysis
You can get a classification according to the end time of the current task and the start time of the next task
ac code
for _ in range(int(input())):
n = int(input())
s = list(map(int, input().split()))
f = list(map(int, input().split()))
ans = []
for i in range(n):
if i == 0:
ans.append(f[i] - s[i])
else:
if s[i] >= f[i - 1]:
ans.append(f[i] - s[i])
else:
ans.append(f[i] - f[i - 1])
for i in range(len(ans)):
if i != len(ans) - 1:
print(ans[i], end = ' ')
else:
print(ans[i])
summary
Find a regular expert
边栏推荐
- KMP!你值得拥有!!! 直接运行直接跑!
- Dynamic explosion effect
- 软件开发的整体流程
- 2022 coming of age ceremony, to every college entrance examination student
- cf:G. Count the Trains【sortedset + bisect + 模拟维持严格递减序列】
- Project management of workflow and business service on SAP BTP
- Niu Ke's question -- finding the least common multiple
- 全志科技T3开发板(4核ARM Cortex-A7)——MQTT通信协议案例
- Apipost精妙使用技巧
- cf:F. Shifting String【字符串按指定顺序重排 + 分组成环(切割联通分量) + 各组最小相同移动周期 + 最小公倍数】
猜你喜欢
随机推荐
開發中必備的文件的上傳與下載
信号的处理与捕捉
On the problem that the while loop condition in keil does not hold but cannot jump out
Balanced search binary tree -- AVL tree
*Use of jetpack notes room
全志科技T3开发板(4核ARM Cortex-A7)——视频开发案例
2022 coming of age ceremony, to every college entrance examination student
Niu Ke brushes the question - no two
求数据库设计毕业信息管理
Prevent enemy tanks from overlapping
* Jetpack 笔记 Room 的使用
牛客刷题——Fibonacci数列
公共字段自动填充,你了解吗
全国院校MBA、EMBA、MPA、MEM、提前面试(预面试)时间批次已出(持续更新中)-文都管联院
平衡搜索二叉树——AVL树
BottomSheetDialog 使用详解,设置圆角、固定高度、默认全屏等
Niuke's brush question -- judgment of legal bracket sequence
「案例分享」基于 AM57x+ Artix-7 FPGA开发板——PRU开发手册详解
BigDecimal基本使用与闭坑介绍
Project management of workflow and business service on SAP BTP








