結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2017-12-06 16:22:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 629 bytes |
コンパイル時間 | 925 ms |
コンパイル使用メモリ | 88,932 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-29 01:01:37 |
合計ジャッジ時間 | 1,874 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <iostream>#include <algorithm>#include <vector>#include <string>#include <iomanip>#include <cmath>#include <functional>using namespace std;#define diff(x,y) ((x > y) ? (x - y) : (y - x))#define us(x) (x > 0) ? x : x * -1#define lli long long intint main() {int n, x, k = 0;vector <int> p(101, 0);cin >> n;vector <int> score(n);for (int i = 0; i < n; i++)cin >> score[i];for (int i = 0; i < n; i++) {cin >> x;if (x)p[x] += score[i];elsek += score[i];}sort(p.begin(), p.end(), greater<int>());if (k < p[0]) cout << "NO" << endl;else cout << "YES" << endl;return 0;}