結果

問題 No.216 FAC
コンテスト
ユーザー tsuchinaga
提出日時 2019-02-21 10:07:35
言語 Go
(1.27.0 + ACL)
コンパイル:
/usr/bin/go_c
実行:
./Main
結果
AC  
実行時間 1 ms / 1,000 ms
+ 806µs
コード長 430 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,662 ms
コンパイル使用メモリ 263,960 KB
実行使用メモリ 9,860 KB
最終ジャッジ日時 2026-09-25 05:09:01
合計ジャッジ時間 11,358 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge3_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

package main

import "fmt"

func main() {
	var n, a, b int
	_, _ = fmt.Scan(&n)

	scores := make([]int, n)
	for i := range scores {
		_, _ = fmt.Scan(&a)
		scores[i] = a
	}

	max := 0
	persons := make([]int, 101)
	for i := 0; i < n; i++ {
		_, _ = fmt.Scan(&b)

		persons[b] += scores[i]
		if b != 0 && max < persons[b] {
			max = persons[b]
		}
	}

	if persons[0] >= max {
		fmt.Println("YES")
	} else {
		fmt.Println("NO")
	}
}
0