結果

問題 No.216 FAC
ユーザー tyochiaityochiai
提出日時 2016-06-05 01:59:50
言語 Go
(1.22.1)
結果
WA  
実行時間 -
コード長 541 bytes
コンパイル時間 10,476 ms
コンパイル使用メモリ 220,912 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-04-19 08:22:50
合計ジャッジ時間 11,370 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

package main

import "fmt"

var (
	N int
	a []int
	b []int
)

func input() {
	fmt.Scanf("%d\n", &N)

	a = make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &a[i])
	}
	fmt.Scanf("\n")

	b = make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scanf("%d", &b[i])
	}
	fmt.Scanf("\n")
}

func resolve() {
	score := make([]int, 101)
	for i := 0; i < N; i++ {
		score[b[i]] += a[i]
	}
	for i := 1; i < len(score); i++ {
		if score[0] < score[i] {
			fmt.Println("NO")
			return
		}
	}
	fmt.Println("YES")
}

func main() {
	input()
	resolve()
}
0