結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
Haijinn
|
| 提出日時 | 2016-12-24 12:07:26 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 384 bytes |
| コンパイル時間 | 115 ms |
| コンパイル使用メモリ | 20,480 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-12-14 17:18:10 |
| 合計ジャッジ時間 | 939 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 16 WA * 8 |
コンパイルメッセージ
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]);
| ^~~~~~~~~~~~~~~~~
ソースコード
#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]);
}
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;
}
Haijinn