Pagini recente » Borderou de evaluare (job #2283139) | Borderou de evaluare (job #2455460) | Borderou de evaluare (job #2074523) | Borderou de evaluare (job #2891207) | Borderou de evaluare (job #2628462)
Borderou de evaluare (job #2628462)
Raport evaluator
Compilare:
main.cpp:2:142: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
using namespace std;struct H{int n,d;bool operator<(const H&x)const{return d>x.d;}}h;int D[50001],n,m,i,j,c,I=INT_MAX;vector<H>v[50001];main(){ifstream f{"dijkstra.in"};ofstream g{"dijkstra.out"};f>>n>>m;while(m--)f>>i>>j>>c,v[i].push_back({j,c});fill(D+2,D+n+1,I);priority_queue<H>q;q.push({1,0});while(q.size()){h=q.top();q.pop();if(D[h.n]==h.d)for(H t:v[h.n])if(D[t.n]>h.d+t.d)D[t.n]=h.d+t.d,q.push({t.n,D[t.n]});}for(i=2;i<=n;++i)g<<(D[i]^I?D[i]:0)<<' ';}
^
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 4ms | 1310kb | OK | 10 |
2 | 4ms | 1310kb | OK | 10 |
3 | 6ms | 1441kb | OK | 10 |
4 | 7ms | 1441kb | OK | 10 |
5 | 29ms | 1835kb | OK | 10 |
6 | 52ms | 2359kb | OK | 10 |
7 | 74ms | 2621kb | OK | 10 |
8 | 157ms | 4313kb | OK | 10 |
9 | 117ms | 3801kb | OK | 10 |
10 | 289ms | 6029kb | OK | 10 |
Punctaj total | 100 |