摘要:
Recently, you found a bot to play "Rock paper scissors" with. Unfortunately, the bot uses quite a simple algorithm to play: he has a string s=s1s2…sns 阅读全文
摘要:
Patrick likes to play baseball, but sometimes he will spend so many hours hitting home runs that his mind starts to get foggy! Patrick is sure that hi 阅读全文
摘要:
In Omkar's last class of math, he learned about the least common multiple, or LCMLCM . LCM(a,b)LCM(a,b) is the smallest positive integer xx which is d 阅读全文
摘要:
You have been blessed as a child of Omkar. To express your gratitude, please solve this problem for Omkar! An array aa of length nn is called complete 阅读全文
摘要:
给出一个长为 nn 的数列,以及 nn 个操作,操作涉及区间加法,单点查值。 Input 第一行输入一个数字 nn。 第二行输入 nn 个数字,第 ii 个数字为 aiai,以空格隔开。 接下来输入 nn 行询问,每行输入四个数字 optopt、ll、rr、cc,以空格隔开。 若 opt=0opt= 阅读全文
摘要:
题目描述 A 国有 n 座城市,编号从 1 到 n,城市之间有 m 条双向道路。每一条道路对车辆都有重量限制,简称限重。 现在有 q 辆货车在运输货物, 司机们想知道每辆车在不超过车辆限重的情况下,最多能运多重的货物。 输入格式 第一行有两个用一个空格隔开的整数 n,m表示 A 国有 n 座城市和 阅读全文
摘要:
题目描述 如题,已知一棵包含 NNN 个结点的树(连通且无环),每个节点上包含一个数值,需要支持以下操作: 操作 111: 格式: 1 x y z1\ x\ y\ z1 x y z 表示将树从 xxx 到 yyy 结点最短路径上所有节点的值都加上 zzz。 操作 222: 格式: 2 x y2\ x 阅读全文