結果

問題 No.216 FAC
ユーザー daradara_sanma
提出日時 2017-07-09 08:40:42
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 389 bytes
コンパイル時間 599 ms
コンパイル使用メモリ 58,464 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2024-10-07 03:30:17
合計ジャッジ時間 1,455 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<iostream>
#include<cstdio>
#include<algorithm>
using namespace std;

int main() {
	int n, h[101] = {};
	cin >> n;

	int A[100], max = 0;
	for (int i = 0; i < n; i++)	cin >> A[i];
	for (int i = 0; i < n; i++)
	{
		int B;
		cin >> B;
		h[B] += A[i];
		if (max < h[B]) max = h[B];
	}

	if (max == h[0])
	{
		cout << "YES" << endl;
	}
	else
	{
		cout << "NO" << endl;
	}

	return 0;
}
0