結果

問題 No.216 FAC
ユーザー umaumax
提出日時 2017-05-02 21:16:55
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 413 bytes
コンパイル時間 577 ms
コンパイル使用メモリ 68,572 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-09-14 04:47:05
合計ジャッジ時間 1,552 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 23 WA * 1
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <map>

using namespace std;

int main(int argc, const char* argv[])
{
	int N;
	cin >> N;
	int as[N];
	int bs[N];
	map<int, int> m;
	for (auto&& a : as) cin >> a;
	for (auto&& b : bs) cin >> b;
	for (int i = 0; i < N; i++) {
		m[bs[i]] += as[i];
	}
	for (int i = 1; i < 100; i++) {
		if (m[i] > m[0]) {
			cout << "NO" << endl;
			return 0;
		}
	}
	cout << "YES" << endl;
	return 0;
}
0