We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a7a18f8 commit 6b2fb74Copy full SHA for 6b2fb74
codeforces_day01/next_round.go
@@ -0,0 +1,34 @@
1
+package main
2
+
3
+import (
4
+ "bufio"
5
+ "fmt"
6
+ "os"
7
+ "strconv"
8
9
+ // "strconv"
10
+ "strings"
11
+)
12
13
14
+func main() {
15
+scanner:=bufio.NewScanner(os.Stdin)
16
+ // scanner.Split(bufio.ScanWords)
17
+ scanner.Scan()
18
+ t:=strings.Split(scanner.Text(), " ")
19
20
21
+ data:=strings.Split(scanner.Text(), " ")
22
+ count:=0;
23
+ k,_:=strconv.Atoi(t[1])
24
+ comapre,_:=strconv.Atoi(data[k-1])
25
+ if(k>=1&&k<=len(data)){
26
+ for i:=0;i<len(data);i++{
27
+ operand,_:=strconv.Atoi(data[i])
28
+ if(operand>=comapre && operand!=0){
29
+ count++
30
+ }
31
32
33
+ fmt.Println(count)
34
+}
0 commit comments