結果
問題 |
No.216 FAC
|
ユーザー |
![]() |
提出日時 | 2016-07-12 17:49:32 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 589 bytes |
コンパイル時間 | 1,965 ms |
コンパイル使用メモリ | 174,600 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 01:04:23 |
合計ジャッジ時間 | 2,908 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> #define REP(i,n) for(int i=0; i<(n); i++) using namespace std; int main() { cin.tie(0); ios::sync_with_stdio(false); int N; cin >> N; vector<int> score(N); for( auto&& x : score ) { cin >>x; } vector<int> no(N); for( auto&& x : no ) { cin >>x; } map<int, int> mp; REP( i, N ) { mp[ no[i] ] += score[i]; } int MAX{INT_MIN}, LO{}; for( auto& x : mp ) { //left over if( x.first == 0 ) { LO += x.second; } else { //max score MAX = max( MAX, x. second ); } } cout << ( LO >= MAX ? "YES" : "NO" ) << endl; return 0; }