fork download
  1. #include<bits/stdc++.h>
  2. using namespace std;
  3. void fastscan(int &number)
  4. {
  5. //variable to indicate sign of input number
  6. bool negative = false;
  7. register int c;
  8.  
  9. number = 0;
  10.  
  11. // extract current character from buffer
  12. c = getchar();
  13. if (c=='-')
  14. {
  15. // number is negative
  16. negative = true;
  17.  
  18. // extract the next character from the buffer
  19. c = getchar();
  20. }
  21.  
  22. // Keep on extracting characters if they are integers
  23. // i.e ASCII Value lies from '0'(48) to '9' (57)
  24. for (; (c>47 && c<58); c=getchar())
  25. number = number *10 + c - 48;
  26.  
  27. // if scanned input has a negative sign, negate the
  28. // value of the input number
  29. if (negative)
  30. number *= -1;
  31. }
  32. int main()
  33. {
  34. int a,b,c,d,e,f,g,h,i,j,k,l,cost=0,mini=0,aa,bb=0,cc;
  35. bool ar[a+1];
  36. fastscan(a);fastscan(b);
  37. int arr[a+1];
  38. for(c=1;c<=a;c++)
  39. fastscan(arr[c]);//cost
  40. vector < int > arr2[a+1];
  41. int arr5[a+1];
  42. memset(arr5,0,sizeof(arr5));
  43. for(c=0;c<b;c++)
  44. {
  45. fastscan(d);fastscan(e);
  46. arr2[d].push_back(e);//edges
  47. arr2[e].push_back(d);//edges
  48. }
  49. bool arr4[a+1];int flag=0;//bool arr5[a+1];
  50. memset(arr4,false,sizeof(arr4));}
  51.  
Success #stdin #stdout 0s 16064KB
stdin
Standard input is empty
stdout
Standard output is empty