• 2024-03-01LeetCode 2345. Finding the Number of Visible Mountains
    原题链接在这里:https://leetcode.com/problems/finding-the-number-of-visible-mountains/description/题目:Youaregivena 0-indexed 2Dintegerarray peaks where peaks[i]=[xi,yi] statesthatmountain i hasapeakatcoordinates (xi,yi).Amountaincan
  • 2024-02-17P9325 [CCC 2023 S2] Symmetric Mountains
    原题链接题解,请看题解区————能不能利用已经算过的值来减少后续计算量呢?如果你toolongonline2:n为一的时候只输出零code#include<bits/stdc++.h>usingnamespacestd;inta[5005]={0};intf[5005][5005]={0};intmain(){intn;cin>>n;for(inti=1
  • 2023-08-28Codeforces Round 888 (Div. 3)G. Vlad and the Mountains(数据结构,图论)
    题目链接:https://codeforces.com/contest/1851/problem/G 大致题意: 给出n个点m条边的无向图,每个点有点权h【i】。从点i到点j会消耗h【j】-h【i】的能量,如果小于0,那么就是恢复对应绝对值的能量。 进行q次询问,每次询问包含起点s,终点t,能量e,能量在移动过程中不能小
  • 2023-08-11G. Vlad and the Mountains
    G.VladandtheMountainsVladdecidedtogoonatriptothemountains.Heplanstomovebetween$n$mountains,someofwhichareconnectedbyroads.The$i$-thmountainhasaheightof$h_i$.Ifthereisaroadbetweenmountains$i$and$j$,Vladcanmo