Skip to content

Commit e8f92a3

Browse files
committed
CF463B
1 parent 391da92 commit e8f92a3

File tree

2 files changed

+45
-0
lines changed

2 files changed

+45
-0
lines changed

main/400-499/463B.go

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
package main
2+
3+
import (
4+
"bufio"
5+
. "fmt"
6+
"io"
7+
)
8+
9+
// github.com/EndlessCheng/codeforces-go
10+
func CF463B(_r io.Reader, out io.Writer) {
11+
in := bufio.NewReader(_r)
12+
var n, v, ans int
13+
for Fscan(in, &n); n > 0; n-- {
14+
if Fscan(in, &v); v > ans {
15+
ans = v
16+
}
17+
}
18+
Fprint(out, ans)
19+
}
20+
21+
//func main() { CF463B(os.Stdin, os.Stdout) }

main/400-499/463B_test.go

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

0 commit comments

Comments
 (0)