Gettin Error Please Help ! Dijstra's algorithm

Q - https://cses.fi/problemset/task/1671/
My solution -
[Forwarded from Voldemort]
#include
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
#define mod 1000000007

int main()
{
ll n, m;
cin >> n >> m;
vector<pair<ll, ll> >adj[n + 1];
for (ll i = 0; i < m; i++)
{
ll l, r, w;
cin >> l >> r >> w;
adj[l].push_back({r, w});
}
ll dis[n + 1];
for (ll i = 1; i <= n; i++)
dis[i] = INT_MAX;
dis[1] = 0;
priority_queue<pair<ll,ll> , vector<pair<ll,ll> >, greater<pair<ll,ll> > >pq;
ll vis[n + 1] = {0};
pq.push({0,1});
while (pq.empty() == false)
{
pair<ll,ll> x = pq.top();
pq.pop();
vis[x.second] = 1;
for (auto i : adj[x.second])
{
if (dis[x.second] + i.second < dis[i.first] && vis[i.first] == 0)
{
dis[i.first] = dis[x.second] + i.second;
pq.push({i.second,i.first});
}
}
}
for (ll i = 1; i <= n; i++)
cout << dis[i] << " ";
}
can somebody tell what is the error