結果

問題 No.216 FAC
ユーザー nCk_cvnCk_cv
提出日時 2015-08-03 02:38:09
言語 C++11
(gcc 11.4.0)
結果
RE  
実行時間 -
コード長 871 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 55,160 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-09-25 00:42:34
合計ジャッジ時間 4,838 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 RE -
testcase_01 RE -
testcase_02 RE -
testcase_03 AC 2 ms
4,500 KB
testcase_04 RE -
testcase_05 RE -
testcase_06 WA -
testcase_07 AC 1 ms
4,376 KB
testcase_08 RE -
testcase_09 RE -
testcase_10 AC 2 ms
4,380 KB
testcase_11 RE -
testcase_12 RE -
testcase_13 RE -
testcase_14 RE -
testcase_15 RE -
testcase_16 RE -
testcase_17 RE -
testcase_18 RE -
testcase_19 RE -
testcase_20 RE -
testcase_21 RE -
testcase_22 RE -
testcase_23 RE -
testcase_24 RE -
testcase_25 RE -
testcase_26 RE -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <cstdio>
#include <climits>
#include <vector>
#include <algorithm>
#include <queue>
#include <stdio.h>
#include <string>
#include <memory.h>


#define REP(i,n) for(int i=0;i<(int)n;++i)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define ALL(c) (c).begin(), (c).end()
#define INF 99999999

using namespace std;
static int score[101];
int main() {
    int n;
    scanf("%d",&n);
    
    int a[n];
    int b[n];
    for(int i = 0; i < n; i++) {
        scanf("%d",&a[n]);
    }
    for(int i = 0; i < n; i++) {
        scanf("%d",&b[n]);
    }
    
    for(int i = 0; i < n; i++) {
        score[b[i]] += a[i];
    }
    
    for(int i = 1; i < n+1; i++) {
        if(score[0] < score[i]) {
            printf("NO\n");
            return 0;
        }
    }
    printf("YES\n");
    
    
    
    
    
    
    
    
    

}







0