dhaval.daiict's blog

By dhaval.daiict, history, 6 years ago, In English

Golang Compiler of Codeforces hosted on windows and it's contain lots of bug code are not goes to in status because of some scan function issue. after some time i got

This page isn’t working codeforces.com didn’t send any data. ERR_EMPTY_RESPONSE

and my code is

package main

import (
	"fmt"
)

func main() {
	var n int
	fmt.Scanf("%d", &n)
a := make([]int, n)
	
	for i := 0; i < n; i++ {
		fmt.Scanf("%d",&a[i])
	}
	min :=a[0]
	max :=a[0]
	var co int
for i := 1; i < n; i++ {
		if a[i]< min {
		min = a[i]
		co++			
	}
 if a[i]> max {
		max = a[i]
		co++			
	}
	}
	fmt.Println(co)
}
  • Vote: I like it
  • +8
  • Vote: I do not like it

| Write comment?