結果

問題 No.216 FAC
ユーザー Haijinn
提出日時 2016-12-24 12:04:28
言語 C90
(gcc 12.3.0)
結果
WA  
実行時間 -
コード長 407 bytes
コンパイル時間 311 ms
コンパイル使用メモリ 20,608 KB
実行使用メモリ 6,824 KB
最終ジャッジ日時 2024-12-14 17:18:09
合計ジャッジ時間 1,207 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 3
other WA * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:15:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   15 |         scanf("%d",&n);
      |         ^~~~~~~~~~~~~~
main.c:17:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   17 |                 scanf("%d",&a[i]);
      |                 ^~~~~~~~~~~~~~~~~
main.c:20:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   20 |                 scanf("%d",&b[f]);
      |                 ^~~~~~~~~~~~~~~~~

ソースコード

diff #

#include <stdio.h>

int main(void)
{
	int n;
	int a[100];
	int b[100];
	int i;
	int f;
	int d;
	int j=0;
	int k=0;
	int r=0;
	
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a[i]);
	}
	for(f=0;f<n;f++){
		scanf("%d",&b[f]);
		printf("%d\n",b[f]);
	}
		
	
	
	for(d=0;d<n;d++){
		if(b[d]>0){
		r+=a[d];
		}else{
		j+=a[d];
		}
	}
	if(j>=r){
		printf("YES\n");
	}else{
		printf("NO\n");
		
	}
	
	return 0;
}
0