結果

問題 No.216 FAC
ユーザー ldsyb
提出日時 2016-02-25 23:08:59
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 360 bytes
コンパイル時間 620 ms
コンパイル使用メモリ 62,552 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-15 00:46:55
合計ジャッジ時間 1,459 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
using namespace std;

int main(){
   int k,n;
   cin >> n;
   int a[n],b[n],all[101] = {};
   for(int i = 0;i < n;i++) cin >> a[i];
   for(int i = 0;i < n;i++) cin >> b[i];
   for(int i = 0;i < n;i++) all[b[i]] += a[i];
   k = all[0];
   stable_sort(all,all + 101);
   cout << (k == all[100] ? "YES" : "NO") << endl;
}
0