結果

問題 No.216 FAC
ユーザー cureskol
提出日時 2020-03-29 18:56:25
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 342 bytes
コンパイル時間 1,526 ms
コンパイル使用メモリ 169,052 KB
実行使用メモリ 6,820 KB
最終ジャッジ日時 2025-01-02 15:41:28
合計ジャッジ時間 2,562 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

template<typename T>
void fin(T a){
  cout<<a<<endl;
  exit(0);
}

signed main(){
  int n;cin>>n;
  vector<int> a(n),b(n);
  for(int i=0;i<n;i++)cin>>a[i];
  map<int,int> m;
  for(int i=0;i<n;i++){
    int q;cin>>q;
    m[q]+=a[i];
  }
  for(auto p:m)if(p.second>m[0])fin("NO");
  fin("YES");
}
0