Cyber Attack Run Error on last test case

Why am i getting run error on last test case? My code seems to work just fine.

Here is the code:

@apaarkamal
@Saurabh-Kumar-1331476656958199

bro sory for late reply… please provide Q link…unable to find the Q in new hackerblock.

I coudnt find the problem on hackerblocks: so i copied the question here ---->

CYBER ATTACK
A group of hackers want hack a network connecting n cities. The network is such that there may or may not be a direct communication between two cities. But there is always a way to communicate from any city u to any other city v through a series of connections(For example, if the city 1 is directly connected to city 2 and city 2 is directly connected to city 3, then city 1 can communicate with city 3 through city 2). There is a hacker in each of the n cities. They wanted to block some of the connections for hacking, also they want to remain connected through network, i.e. after blocking some connections, still there should be a way of communication from every city of every other city so that hackers can communicate.
Hackers know that there is a cost associated with each direct connection. Since they have a limited amount of money, s, they want block as many connections as they can. Help them find the number of connections they can block.

Input Format:
First line contains n, m and s, denoting the number of cities, number of direct connections, and the amount of money hackers have. Next m lines contains 3 integers each, u, v and c, denoting that there is a direct connection between node u and node v and the cost of breaking this connection is c.

Constraints:
1<=s, c<=10^12 1<=n<=50000 1<=m<=100000 1<=u,v<=n, edges are unique, and there is no self loop.

Output Format
On the first line, print the number of connections hackers can block, w and the minimum cost of blocking, c. Note that there can be multiple possible sets of w connections, which can be removed within the sum of costs, s. Consider that set, S, such that the total cost of blocking is minimum.

Sample Input
6 7 10
1 2 3
1 3 3
2 3 3
3 4 1
4 5 5
5 6 4
4 6 5
Sample Output
2 7

@Saurabh-Kumar-1331476656958199

after debuging it for an hour i found there is a mistake in comparator just use this
sort(g.rbegin(), g.rend());

bdw i dont know whats wrong in comparator its seems ok…

Thx solved it, weird error with comparator.