結果
問題 |
No.216 FAC
|
ユーザー |
![]() |
提出日時 | 2017-02-01 14:14:43 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 374 bytes |
コンパイル時間 | 761 ms |
コンパイル使用メモリ | 20,352 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-12-24 02:18:13 |
合計ジャッジ時間 | 1,734 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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(i=0;i<n;i++){ if(b[i]==0){ r+=a[i]; }else{ k+=a[i]; } } if(r>=k){ printf("YES\n"); }else{ printf("NO\n"); } return 0; }