Submission #3422684
Source Code Expand
package main
import (
"bufio"
"fmt"
"io"
"os"
"strconv"
)
var (
readString func() string
stdout *bufio.Writer
)
func init() {
readString = newReadString(os.Stdin)
stdout = bufio.NewWriter(os.Stdout)
}
func newReadString(ior io.Reader) func() string {
r := bufio.NewScanner(ior)
r.Buffer(make([]byte, 1024), int(1e+11))
r.Split(bufio.ScanWords)
return func() string {
if !r.Scan() {
panic("Scan failed")
}
return r.Text()
}
}
func readInt() int {
return int(readInt64())
}
func readInt64() int64 {
i, err := strconv.ParseInt(readString(), 0, 64)
if err != nil {
panic(err.Error())
}
return i
}
func readIntSlice(n int) []int {
b := make([]int, n)
for i := 0; i < n; i++ {
b[i] = readInt()
}
return b
}
func readLengthAndSlice() (int, []int) {
n := readInt()
return n, readIntSlice(n)
}
func printf(f string, args ...interface{}) (int, error) {
return fmt.Fprintf(stdout, f, args...)
}
func println(args ...interface{}) (int, error) {
return fmt.Fprintln(stdout, args...)
}
func eprintln(args ...interface{}) (int, error) {
return fmt.Fprintln(os.Stderr, args...)
}
// readString() string
// readInt() int
// readIntSlice(n int) []int
// readLengthAndSlice() []int
// -----------------------------------------------------------------------------
func rev(d []string) {
for i, j := 0, len(d)-1; i < j; i, j = i+1, j-1 {
d[i], d[j] = d[j], d[i]
}
}
func rot180(c [][]string) {
for i, j := 0, len(c)-1; i < j; i, j = i+1, j-1 {
c[i], c[j] = c[j], c[i]
rev(c[i])
rev(c[j])
}
}
func main() {
defer stdout.Flush()
c := make([][]string, 4)
for i := range c {
c[i] = make([]string, 4)
for j := range c[i] {
c[i][j] = readString()
}
}
rot180(c)
for i := range c {
sp := ""
for j := range c[i] {
printf("%s%s", sp, c[i][j])
sp = " "
}
println()
}
}
// -----------------------------------------------------------------------------
Submission Info
Submission Time |
|
Task |
B - 回転 |
User |
ktateish |
Language |
Go (1.6) |
Score |
100 |
Code Size |
2041 Byte |
Status |
AC |
Exec Time |
1 ms |
Memory |
640 KB |
Judge Result
Set Name |
All |
Score / Max Score |
100 / 100 |
Status |
|
Set Name |
Test Cases |
All |
00_sample_00.txt, 00_sample_01.txt, 01_all_dot.txt, 02_all_o.txt, 03_all_x.txt, rand_0.txt, rand_1.txt, rand_10.txt, rand_11.txt, rand_12.txt, rand_13.txt, rand_14.txt, rand_15.txt, rand_16.txt, rand_17.txt, rand_18.txt, rand_19.txt, rand_2.txt, rand_20.txt, rand_21.txt, rand_22.txt, rand_23.txt, rand_24.txt, rand_3.txt, rand_4.txt, rand_5.txt, rand_6.txt, rand_7.txt, rand_8.txt, rand_9.txt |
Case Name |
Status |
Exec Time |
Memory |
00_sample_00.txt |
AC |
1 ms |
640 KB |
00_sample_01.txt |
AC |
1 ms |
640 KB |
01_all_dot.txt |
AC |
1 ms |
640 KB |
02_all_o.txt |
AC |
1 ms |
640 KB |
03_all_x.txt |
AC |
1 ms |
640 KB |
rand_0.txt |
AC |
1 ms |
640 KB |
rand_1.txt |
AC |
1 ms |
640 KB |
rand_10.txt |
AC |
1 ms |
640 KB |
rand_11.txt |
AC |
1 ms |
640 KB |
rand_12.txt |
AC |
1 ms |
640 KB |
rand_13.txt |
AC |
1 ms |
640 KB |
rand_14.txt |
AC |
1 ms |
640 KB |
rand_15.txt |
AC |
1 ms |
640 KB |
rand_16.txt |
AC |
1 ms |
640 KB |
rand_17.txt |
AC |
1 ms |
640 KB |
rand_18.txt |
AC |
1 ms |
640 KB |
rand_19.txt |
AC |
1 ms |
640 KB |
rand_2.txt |
AC |
1 ms |
640 KB |
rand_20.txt |
AC |
1 ms |
640 KB |
rand_21.txt |
AC |
1 ms |
640 KB |
rand_22.txt |
AC |
1 ms |
640 KB |
rand_23.txt |
AC |
1 ms |
640 KB |
rand_24.txt |
AC |
1 ms |
640 KB |
rand_3.txt |
AC |
1 ms |
640 KB |
rand_4.txt |
AC |
1 ms |
640 KB |
rand_5.txt |
AC |
1 ms |
640 KB |
rand_6.txt |
AC |
1 ms |
640 KB |
rand_7.txt |
AC |
1 ms |
640 KB |
rand_8.txt |
AC |
1 ms |
640 KB |
rand_9.txt |
AC |
1 ms |
640 KB |