結果

問題 No.216 FAC
コンテスト
ユーザー TLwiegehtt
提出日時 2015-07-08 03:10:18
言語 C90(gcc12)
(gcc 12.4.0)
コンパイル:
gcc-12 -O2 -std=c90 -DONLINE_JUDGE -o a.out _filename_ -lm
実行:
./a.out
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 423 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 175 ms
コンパイル使用メモリ 29,224 KB
最終ジャッジ日時 2026-02-23 18:41:04
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.c: In function ‘main’:
main.c:8:9: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
    8 |         scanf("%d", &n);
      |         ^~~~~~~~~~~~~~~
main.c:14:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   14 |                 scanf("%d", &a[i]);
      |                 ^~~~~~~~~~~~~~~~~~
main.c:19:17: warning: ignoring return value of ‘scanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
   19 |                 scanf("%d", &tmp);
      |                 ^~~~~~~~~~~~~~~~~

ソースコード

diff #
raw source code

#include <stdio.h>

int main(void){
	int yesno = 1;
	int i,n;
	int a[110];
	int b[110];
	scanf("%d", &n);
	for(i=0;i<110;i++){
		a[i] = b[i] = 0;
	}
	
	for(i=0;i<n;i++){
		scanf("%d", &a[i]);
	}
	
	for(i=0;i<n;i++){
		int tmp;
		scanf("%d", &tmp);
		b[tmp] += a[i];
	}
	
	for(i=1;i<=100;i++){
		if(b[0] < b[i]){
			yesno = 0;
			break;
		}
	}
	
	if(yesno == 1 ){
		printf("YES\n");
	}else{
		printf("NO\n");
	}
	return 0;
}
0