Pagini recente » Borderou de evaluare (job #1205420) | Borderou de evaluare (job #2529921) | Borderou de evaluare (job #917165) | Borderou de evaluare (job #1516187) | Borderou de evaluare (job #2941929)
Borderou de evaluare (job #2941929)
Raport evaluator
Compilare:
main.cpp: In function 'int main()':
main.cpp:3:235: warning: operation on 'i' may be undefined [-Wsequence-point]
3 | std::ifstream r("apm.in");std::ofstream w("apm.out");struct s{int x,y,z;}e[1<<20];int c(s a,s b){v a.z<b.z;}int m,k,i,j,z,t[1<<20],x,y;int f(int x){v t[x]^x?t[x]=f(t[x]):x;}int main(){r>>m>>m;for(;i<m;)r>>e[i].x>>e[i].y>>e[i].z,t[i]=i++;std::sort(e,e+m,c);for(;j<m;j++){x=f(e[j].x),y=f(e[j].y);if(x^y)z+=e[j].z,t[x]=y,e[k++]=e[j];}w<<z<<" "<<k<<" ";while(k--)w<<e[k].x<<" "<<e[k].y<<" ";}
| ~^~
main.cpp:3:235: warning: operation on 'i' may be undefined [-Wsequence-point]
Test |
Timp executie |
Memorie folosita |
Mesaj |
Punctaj/test |
1 | 0ms | 184kb | Cost incorect | 0 |
2 | 0ms | 184kb | Cost incorect | 0 |
3 | 0ms | 184kb | Cost incorect | 0 |
4 | 0ms | 184kb | Cost incorect | 0 |
5 | 0ms | 184kb | Cost incorect | 0 |
6 | 43ms | 2048kb | Cost incorect | 0 |
7 | 65ms | 2875kb | Cost incorect | 0 |
8 | 13ms | 876kb | Cost incorect | 0 |
9 | 18ms | 1081kb | Cost incorect | 0 |
10 | 63ms | 3121kb | Cost incorect | 0 |
Punctaj total | 0 |