結果

問題 No.216 FAC
ユーザー funakoshi
提出日時 2019-08-19 13:48:08
言語 C
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 705 bytes
コンパイル時間 1,333 ms
コンパイル使用メモリ 29,184 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-10-04 05:50:16
合計ジャッジ時間 1,854 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 21 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdbool.h>
int main(void)
{
    int numofquestion;
    int qscore[200]={0};
    int score[200]={0};
    int answer[200]={0};
    scanf("%d",&numofquestion);
    for(int i=0;i<numofquestion;i++)
    {
        scanf("%d",&qscore[i]);
    }
    for(int i=0;i<numofquestion;i++)
    {
        scanf("%d",&answer[i]);
        score[answer[i]]+=qscore[i];
    }
    bool IsKcanwin=true;
    for(int i=1;i<numofquestion;i++)
    {
        if(score[0]<score[i])
        {
            IsKcanwin=false;
            break;
        }
    }
    if(IsKcanwin==true)
    {
        printf("YES");
    }
    else
    {
        printf("NO");
    }
    
}
0