結果

問題 No.216 FAC
ユーザー ldsyb
提出日時 2016-02-25 23:07:44
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 358 bytes
コンパイル時間 586 ms
コンパイル使用メモリ 63,568 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-09-22 13:47:36
合計ジャッジ時間 1,418 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1 WA * 2
other AC * 9 WA * 15
権限があれば一括ダウンロードができます

ソースコード

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[0] ? "YES" : "NO") << endl;
}
0