NPTEL Getting Started with Competitive Programming Week 6 Programming Assignment, Quiz Solution 2024

แชร์
ฝัง
  • เผยแพร่เมื่อ 31 ม.ค. 2025

ความคิดเห็น • 5

  • @NPTELASSIGNMENTSOLUTIONS-k2f
    @NPTELASSIGNMENTSOLUTIONS-k2f  5 หลายเดือนก่อน +1

    Link For Programming Assignments : github.com/NPTEL-Programming-Solutions/NPTEL

  • @pinisettijagadeeshnagasaty2504
    @pinisettijagadeeshnagasaty2504 5 หลายเดือนก่อน

    Thanks bro

  • @kartikeygupta4075
    @kartikeygupta4075 5 หลายเดือนก่อน

    Big thankyou brother , you are a great help

  • @BENARJIKAITEPALLI
    @BENARJIKAITEPALLI 5 หลายเดือนก่อน

    bro i got different question 2nd one
    You are given an undirected graph of n vertices numbered from 0 to n - 1 and m edges between them.
    Each edge of the graph is weighted, each weight is a positive integer.
    You are given the list of edges along with their weights, but the list is damaged: some of the weights read as 0. If an edge has 0 weight, it means the information about its original weight is lost.
    You want the length of the shortest path between vertices s and t in the graph to be exactly L.
    Is it possible to restore some or all of the missing weights to make this happen?
    Input
    The first line contains five integers n, m, L, s, t (2 ≤ n ≤ 1000,  1 ≤ m ≤ 10000,  1 ≤ L ≤ 10^9,  0 ≤ s, t ≤ n - 1,  s ≠ t) - the number of vertices, number of edges, the desired length of shortest path, starting vertex and ending vertex respectively.
    Then, m lines describing the edges of the graph follow. i-th of them contains three integers, ui, vi, wi (0 ≤ ui, vi ≤ n - 1,  ui ≠ vi,  0 ≤ wi ≤ 10^9). ui and vi denote the endpoints of the edge and wi denotes its weight. If wi is equal to 0 then the weight of the corresponding edge was erased.
    It is guaranteed that there is at most one edge between any pair of vertices.
    Output
    Print "NO" (without quotes) if it's not possible to assign the missing weights to achieve the desired effect. Otherwise, print "YES".
    Examples
    input
    5 5 13 0 4
    0 1 5
    2 1 2
    3 2 3
    1 4 0
    4 3 4
    output
    YES
    input
    2 1 2390 0 1
    0 1 0
    output
    YES
    input
    2 1 99 1 0
    0 1 101
    output
    NO