Skip to content

Commit 445a214

Browse files
committed
CF996A
1 parent 1214d21 commit 445a214

File tree

2 files changed

+41
-0
lines changed

2 files changed

+41
-0
lines changed

main/900-999/996A.go

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
package main
2+
3+
import (
4+
. "fmt"
5+
"io"
6+
)
7+
8+
// github.com/EndlessCheng/codeforces-go
9+
func CF996A(in io.Reader, out io.Writer) {
10+
var n int
11+
Fscan(in, &n)
12+
Fprint(out, n/100+n/20%5+n/10%2+n/5%2+n%5)
13+
}
14+
15+
//func main() { CF996A(os.Stdin, os.Stdout) }

main/900-999/996A_test.go

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package main
2+
3+
import (
4+
"github.com/EndlessCheng/codeforces-go/main/testutil"
5+
"testing"
6+
)
7+
8+
// https://codeforces.com/problemset/problem/996/A
9+
// https://codeforces.com/problemset/status/996/problem/A
10+
func TestCF996A(t *testing.T) {
11+
// just copy from website
12+
rawText := `
13+
inputCopy
14+
125
15+
outputCopy
16+
3
17+
inputCopy
18+
43
19+
outputCopy
20+
5
21+
inputCopy
22+
1000000000
23+
outputCopy
24+
10000000`
25+
testutil.AssertEqualCase(t, rawText, 0, CF996A)
26+
}

0 commit comments

Comments
 (0)