結果
問題 | No.216 FAC |
ユーザー |
|
提出日時 | 2017-03-23 09:37:52 |
言語 | C90 (gcc 12.3.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 395 bytes |
コンパイル時間 | 85 ms |
コンパイル使用メモリ | 20,992 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-05 20:32:00 |
合計ジャッジ時間 | 948 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 WA * 3 |
コンパイルメッセージ
main.c: In function ‘main’: main.c:7:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 7 | scanf("%d", &n); | ^~~~~~~~~~~~~~~ main.c:9:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 9 | scanf("%d", &a[i]); | ^~~~~~~~~~~~~~~~~~ main.c:12:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 12 | scanf("%d", &b[i]); | ^~~~~~~~~~~~~~~~~~
ソースコード
#include <stdio.h>int main(void) {int i,n,a[100],b[100],k[100]={0},flag=0;scanf("%d", &n);for (i = 0; i < n; i++) {scanf("%d", &a[i]);}for (i = 0; i < n; i++) {scanf("%d", &b[i]);}for (i = 0; i < n; i++) {k[b[i]] += a[i];}for (i = 1; i < n; i++) {if(k[0] < k[i]){flag=1;break;}else flag=0;}printf(flag==0?"YES":"NO");return 0;}