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

analysis
according to a and b Value , Find the maximum value that can be deleted
Then for all a All minus this maximum , If it is less than 0 Then take 0
Look at this result and b Whether it is consistent or not
ac code
for _ in range(int(input())):
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
maxReduce = 0
for i in range(n):
maxReduce = max(maxReduce, a[i] - b[i])
expectedB = []
for i in range(n):
now = max(0, a[i] - maxReduce)
expectedB.append(now)
if expectedB != b:
print('NO')
else:
print('YES')
summary
Maximum simulation
边栏推荐
- SA token single sign on SSO mode 2 URL redirection propagation session example
- TI AM64x——最新16nm处理平台,专为工业网关、工业机器人而生
- 5 minutes to understand the red, blue and purple in the attack and defense drill
- 在 SAP Kyma 上部署一个 Go MSSQL API Endpoint
- On the sequence traversal of binary tree
- cf:D. Black and White Stripe【连续k个中最少的个数 + 滑动窗口】
- Do you know that public fields are automatically filled in
- 牛客刷题——两种排序方法
- Labelme for image data annotation
- 全志科技T3开发板(4核ARM Cortex-A7)——视频开发案例
猜你喜欢

全国院校MBA、EMBA、MPA、MEM、提前面试(预面试)时间批次已出(持续更新中)-文都管联院
Téléchargement et téléchargement des fichiers nécessaires au développement

map和set

* Jetpack 笔记 使用DataBinding

力扣刷题——根据二叉树创建字符串
開發中必備的文件的上傳與下載

Uni app Muke hot search project (I) production of tabbar

Flink CDC 在大健云仓的实践

Visual slam lecture notes-10-1

Cool visualization tool: first introduction to processing
随机推荐
Niu Ke's question -- Fibonacci series
cf:B. Array Decrements【模拟】
美国通胀率8.6%创41年历史新高!通胀高烧不退?股票、加密市场先跌为敬!
cf:C. Restoring the Duration of Tasks【找规律】
【题解】Codeforces Round #798 (Div. 2)
cf:D. Black and White Stripe【连续k个中最少的个数 + 滑动窗口】
力扣刷题——根据二叉树创建字符串
Complete in-depth learning of MySQL from 0 to 1 -- phase 2 -- basics
Non recursive traversal of binary tree
Ti am64x - the latest 16nm processing platform, designed for industrial gateways and industrial robots
cf:E. Price Maximization【排序 + 取mod + 双指针+ 配对】
How to manually execute workflow on SAP BTP
uni-app 慕客热搜项目实战(一)tabBar的制作
Flink CDC 在大健云仓的实践
Quanzhi technology T3 development board (4-core arm cortex-a7) - mqtt communication protocol case
Niuke's brush question -- judgment of legal bracket sequence
牛客刷题——Fibonacci数列
Force deduction questions -- create a string based on a binary tree
软件开发的整体流程
Do you know that public fields are automatically filled in