Pagini recente » Borderou de evaluare (job #1853852) | Borderou de evaluare (job #2520136) | Borderou de evaluare (job #1239376) | Borderou de evaluare (job #80624) | Borderou de evaluare (job #2941922)
Borderou de evaluare (job #2941922)
Raport evaluator
Compilare:
main.cpp:3:156: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
3 | using namespace std;ifstream i("apm.in");ofstream o("apm.out");const t h=3e5;t p[h];vector<vector<t>>g[h+h],f;t a(t x){if(x^p[x])p[x]=a(p[x]);return p[x];}main(){t n,m,x,y,c,s=0;i>>n>>m;iota(p,p+h,0);while(m--){i>>x>>y>>c;g[c+h].push_back({x,y});}for(c=0;c<h+h;c++)for(auto e:g[c]){x=a(e[0]);y=a(e[1]);if(x^y){f.push_back(e);s+=c-h;}p[x]=y;}o<<s<<"\n"<<n-1<<"\n";for(auto e:f)o<<e[0]<<" "<<e[1]<<'\n';}
| ^~~~
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 14ms | 15781kb | Corect | 10 |
2 | 15ms | 15822kb | Corect | 10 |
3 | 14ms | 15872kb | Corect | 10 |
4 | 14ms | 15933kb | Corect | 10 |
5 | 15ms | 15859kb | Corect | 10 |
6 | 104ms | 24444kb | Corect | 10 |
7 | 183ms | 33116kb | Corect | 10 |
8 | 43ms | 19316kb | Corect | 10 |
9 | 47ms | 19628kb | Corect | 10 |
10 | 163ms | 30674kb | Corect | 10 |
Punctaj total | 100 |