WhiteHat Coding
Открыть в Telegram
650
Подписчики
Нет данных24 часа
-27 дней
-330 день
Архив постов
C++
Learn JS Code
Juspay Exam
#include<bits/stdc++.h>
using namespace std;
vector<pair<int,int>>adj[1000001];
int main(){
int n;
cin>>n;
unordered_map<int,int>mp;
for(int i=0;i<n;++i){
int x;
cin>>x;
mp[x]=INT_MAX;
}
int e;
cin>>e;
for(int i=0;i<e;++i){
int x,y,d;
cin>>x>>y>>d;
adj[x].push_back({y,d});
}
int src,dest;
cin>>src>>dest;
set<pair<int,int>>s;
mp[src]=0;
s.insert({0,src});
while(!s.empty()){
pair<int,int>tmp=*(s.begin());
s.erase(s.begin());
int u=tmp.second;
for(auto i=adj[u].begin();i!=adj[u].end();++i){
int v=(*i).first;
int weight=(*i).second;
if(mp[v]>mp[u]+weight){
if(mp[v]!=INT_MAX)
s.erase(s.find({mp[v],v}));
mp[v]=mp[u]+weight;
s.insert({mp[v],v});
}
}
}
if(mp[dest]==INT_MAX)
cout<<"-1"<<endl;
else
cout<<mp[dest]<<endl;
return 0;
}
C++
Learn JS Code
Juspay Exam ✅
Share @whitehatcoding❤️
** Check some prepsat coding uploaded..
If u want more pls share make 1k our channel 💥👨💻
Share @whitehatcoding **
Guys don`t sell my codes...😢
If u want sell pls share our channel 😊✅ @whitehatcoding❤️
Guys share the screenshot in large groups and Share with your friends ✅🔥 @whitehatcoding❤️
I don't see anyone sharing 🥲
palindrome code✅
python
prepsat
If u want more ans..share @whitehatcoding❤️ make 1k👨💻
PREPSAT Solutions If u want...
Share our channel make 1k✅
@whitehatcoding
https://t.me/whitehatcoding
https://t.me/whitehatcoding
Share our channel to ur friends✅ @whitehatcoding👨💻😊
ᴡᴇ ᴅᴏɴ'ᴛ ɴᴇᴇᴅ ᴀɴʏ ᴏᴛʜᴇʀ ᴛʜɪɴɢs ᴊᴜsᴛ ʀᴇᴀᴄᴛ ᴏɴ ᴘᴏsᴛs ᴀɴᴅ ᴍᴀᴋᴇ ᴜs ʜᴀᴘᴘʏ ❤️🤩
👉AWS Certified Cloud Practitioner 😃
GLOBAL CERTIFICATION
👉Azure Fundamentals Certification❤️
Solutions / Dumps available ✅
Contact @ILOVEU_143👨💻
100% clearance guarantee 🔥🔥
Share @Coding_000 ❤️
Haven't received PrepSAT test mail? 🤔
Fill this form within 2 hours & receive the mail by tommorow 🤩
📍 Apply Link https://bit.ly/PrepSAT_RegistrationLink
In case if you have any query feel free to reach out to us here : https://bit.ly/prime-wa
Team @Coding_000❤️
Dont Miss this opportunity✅
Register Fast✅
