結果
問題 | No.216 FAC |
ユーザー |
![]() |
提出日時 | 2015-07-26 16:48:39 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 2 ms / 1,000 ms |
コード長 | 326 bytes |
コンパイル時間 | 431 ms |
コンパイル使用メモリ | 53,496 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-15 00:40:15 |
合計ジャッジ時間 | 1,339 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’: main.cpp:4:19: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result] 4 | int main() { scanf("%d", &n); | ~~~~~^~~~~~~~~~
ソースコード
#include <iostream>using namespace std;int n, a[1111111], c[1111111], b;int main() { scanf("%d", &n);int k = 0, kk = 0;for(int i=0; i<n; i++) {cin >> a[i];}int max = 0;for(int i=0; i<n; i++) {cin >> b;c[b] += a[i];max = c[b] > max ? c[b] : max;}if(c[0] >= max) {puts("YES");}else {puts("NO");}return 0;}