title: How to improve execution time in go
body: <p>I was writing this code for "competitive Programming". It consisted of only 1 loop but gave "Time Limit Exceed" if n = 100000.  Can Go be considered for competitive Programming?</p>
  
  <pre><code>fmt.Scanln(&amp;n, &amp;k, &amp;m)
  for i := 0; i &lt; n; i++ {
      fmt.Scanf("%d", &amp;z)
      if m &gt;= 0 {
          if z &gt; x {
              x = z
              m--
          }
          if i == n-1 {
              m++
          }
      } else {
          if cnt == 0 {
              x = 0
          }
          x += z
          cnt++
      }
  }
  if m == 0 {
      f = float64(x / (n - m))
  }
  if k &lt; m {
      x += k
  } else {
      x += m
  }
  f = float64(x)
  fmt.Println(f)
  </code></pre>
  
  <hr>
  
  <p>"<a href="http://codeforces.com/problemset/problem/1111/B" rel="nofollow noreferrer">codeforces.com/problemset/problem/1111/B</a> -- Average Superhero Gang Power"</p>