結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2017-03-23 10:54:44 |
| 言語 | C90 (gcc 12.3.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 429 bytes |
| コンパイル時間 | 90 ms |
| コンパイル使用メモリ | 21,120 KB |
| 実行使用メモリ | 5,376 KB |
| 最終ジャッジ日時 | 2024-07-05 20:32:24 |
| 合計ジャッジ時間 | 793 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 23 WA * 1 |
コンパイルメッセージ
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,max=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];
if(max<b[i]) max=b[i];
}
for (i = 1; i < n; i++) {
if(k[0] < k[b[i]]){flag=1;break;
}else flag=0;
}
printf(flag==0?"YES":"NO");
return 0;
}