結果
問題 |
No.216 FAC
|
ユーザー |
![]() |
提出日時 | 2018-09-06 01:53:41 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 633 bytes |
コンパイル時間 | 669 ms |
コンパイル使用メモリ | 66,440 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-16 06:25:58 |
合計ジャッジ時間 | 1,768 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 22 WA * 2 |
ソースコード
//inlclude前用define #define _USE_MATH_DEFINES //include #include<iostream> #include<string> #include<algorithm> #include<vector> #include<cmath> using namespace std; //typedef typedef vector<int> VI; typedef vector<string> VS; typedef vector<char> VC; int main() { int n; cin >> n; VI a(n), b(n); for (int i = 0; i < n; i++) cin >> a[i]; for (int i = 0; i < n; i++) cin >> b[i]; int sum = 0; for (int i = 0; i < n; i++) { if (b[i] == 0) { sum += a[i]; } } bool flag = true; for (int i = 0; i < n; i++) { if (a[i] > sum) flag = false; } if (flag) cout << "YES" << endl; else cout << "NO" << endl; return 0; }