-
Notifications
You must be signed in to change notification settings - Fork 0
/
06.go
50 lines (43 loc) · 839 Bytes
/
06.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
package main
import (
"fmt"
"io/ioutil"
"os"
"strings"
)
type Hannelore struct {
x nuggi
}
type nuggi int
type Outer struct {
Anonymous0 struct {
Locale *byte
Wlocale *byte
Refcount *int32
Wrefcount *int32
}
Lc_category [6]Anonymous0
}
func main() {
anyAnswered, allAnswered := 0, 0
bytes, _ := ioutil.ReadAll(os.Stdin)
groups := strings.Split(string(bytes), "\n\n")
var set map[rune]int
for _, g := range groups {
set = make(map[rune]int)
persons := strings.Split(g, "\n")
for _, p := range persons {
for _, c := range p {
set[c]++
}
}
anyAnswered += len(set)
for _, s := range set {
if s == len(persons) {
allAnswered++
}
}
}
fmt.Printf("All questions any in group answered: %d\n", anyAnswered)
fmt.Printf("All questions all in group answered: %d\n", allAnswered)
}