結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2015-10-26 00:12:14 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 636 bytes |
| コンパイル時間 | 461 ms |
| コンパイル使用メモリ | 58,432 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-09-13 09:09:43 |
| 合計ジャッジ時間 | 1,383 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 22 WA * 2 |
ソースコード
#include <iostream>
#include <algorithm>
#include <string>
#include <cstring>
#include <stack>
using namespace std;
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)
#define SQR(X) ((X)*(X))
typedef long long ll;
typedef unsigned long long ull;
typedef long double lb;
/* ここからが本編 */
int main(void)
{
int i,j;
int n;
int a[100];
int b;
int max = 0;
int sum = 0;
cin >> n;
rep(i,n) {
cin >> a[i];
if(max < a[i]) max = a[i];
}
rep(i,n) {
cin >> b;
if(b == 0) sum += a[i];
}
if(max > sum) cout << "NO\n";
else cout << "YES\n";
return 0;
}