結果

問題 No.216 FAC
ユーザー monburan_0401monburan_0401
提出日時 2018-09-09 23:15:46
言語 C
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 1,145 bytes
コンパイル時間 199 ms
コンパイル使用メモリ 28,696 KB
実行使用メモリ 4,500 KB
最終ジャッジ日時 2023-08-25 23:10:18
合計ジャッジ時間 1,419 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

//	1番に解いた人にしかスコアが加算されない
//	kはまだ誰も解いていない問題なら一瞬で解ける
//	kが優勝(同率でも)できるなら'YES'、できないなら'NO'
#include <stdio.h>
int main(void){
	int N;
	int a[100];		//	score
	int b[100];		//	number of person answered   0 <= b[i] <= 100
	int ans[2] = {0};		//	score ans[0]:k, ans[1]:another
	
	scanf("%d",&N);
	for(int i = 0; i < N; i++){
		scanf("%d",&a[i]);
	}
	for(int j = 0; j < N; j++){
		scanf("%d",&b[j]);
	}
	
/*	for(int k = 0; k < N; k++){		//	check ok
		printf("%d ",b[k]);
	}
	printf("\n");
*/	

/*  for(int l = 0; l < N; l++){
		ans[b[l]] += a[l];
	}
*/
    
    for(int i = 0; i < N; i++){
        if(b[i] == 0){
            ans[0] += a[i];
        }else{
            ans[1] += a[i];
        }
    }
 
/*	for(int m = 0; m < N; m++){		//	check ok
		printf("%d ",ans[m]);
	}
	printf("\n");
*/
	
/*	for(int n = 1; n < N; n++){
		if(ans[0] < ans[n]){
			printf("NO\n");
			return 0;
		}
	}
	printf("YES\n");
	return 0;
*/
    if(ans[0] >= ans[1]){
        printf("YES\n");
    }else{
        printf("NO\n");
    }
    
    return 0;
}
0