zero_shubham1

doesntMatter

May 10th, 2019
236
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.25 KB | None | 0 0
  1. package main
  2.  
  3. import (
  4.     "fmt"
  5. )
  6.  
  7.  
  8. func main() {
  9.     var n,tmp int
  10.     count := 0
  11.     fmt.Scanf("%d", &n)
  12.     aux := make([]int, n+1)
  13.  
  14.     for i := 0; i < n; i++ {
  15.         fmt.Scanf("%d", &tmp)
  16.         if aux[tmp] == 0 {
  17.             count++
  18.             aux[tmp] = 1
  19.         }
  20.     }
  21.  
  22. }
Add Comment
Please, Sign In to add comment