結果

問題 No.232 めぐるはめぐる (2)
ユーザー yukirinyukirin
提出日時 2016-02-28 16:19:48
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 1,014 bytes
コンパイル時間 11,193 ms
コンパイル使用メモリ 223,032 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 06:27:06
合計ジャッジ時間 13,596 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 141 ms
6,816 KB
testcase_01 AC 141 ms
6,940 KB
testcase_02 AC 141 ms
6,940 KB
testcase_03 AC 145 ms
6,944 KB
testcase_04 AC 1 ms
6,944 KB
testcase_05 WA -
testcase_06 AC 1 ms
6,944 KB
testcase_07 AC 2 ms
6,940 KB
testcase_08 AC 101 ms
6,940 KB
testcase_09 AC 1 ms
6,940 KB
testcase_10 AC 2 ms
6,940 KB
testcase_11 WA -
testcase_12 AC 1 ms
6,944 KB
testcase_13 WA -
testcase_14 AC 2 ms
6,940 KB
testcase_15 AC 1 ms
6,944 KB
testcase_16 AC 1 ms
6,940 KB
testcase_17 AC 1 ms
6,940 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 AC 1 ms
6,944 KB
testcase_22 AC 1 ms
6,940 KB
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 1 ms
6,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var rdr = bufio.NewReaderSize(os.Stdin, 1000000)

func main() {
	sc.Split(bufio.ScanWords)
	t, a, b := nextInt(), nextInt(), nextInt()

	c := a
	if b > a {
		c = b
	}

	if c > t {
		fmt.Println("NO")
		return
	}

	fmt.Println("YES")
	around := t - c

	for i := 0; i < around/2; i++ {
		fmt.Println("v")
		fmt.Println("^")
	}

	m := a
	if b < a {
		m = b
	}
	if around%2 == 1 && m != 0 {
		m--
		fmt.Println(">")
		fmt.Println("^")
	}

	for i := 0; i < m; i++ {
		fmt.Println(">^")
	}

	if around%2 == 1 && m != -1 {
		m++
	}

	if m == 0 && around%2 == 1 {
		if a > 0 {
			fmt.Println("<")
			fmt.Println(">^")
			a--
		} else {
			fmt.Println("v")
			fmt.Println(">^")
			b--
		}
	}

	for i := 0; i < a-m; i++ {
		fmt.Println("^")
	}
	for i := 0; i < b-m; i++ {
		fmt.Println(">")
	}
	return
}

func nextLine() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	i, _ := strconv.Atoi(nextLine())
	return i
}
0