結果
| 問題 |
No.216 FAC
|
| コンテスト | |
| ユーザー |
Konton7
|
| 提出日時 | 2020-01-18 15:26:21 |
| 言語 | C++17(gcc12) (gcc 12.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 1,000 ms |
| コード長 | 421 bytes |
| コンパイル時間 | 5,937 ms |
| コンパイル使用メモリ | 253,220 KB |
| 最終ジャッジ日時 | 2025-01-08 20:02:52 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 24 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
int main(){
int n, s;
cin >> n;
int a[n], b[n], p[101];
fill(p, p+100, 0);
rep(i, n)
cin >> a[i];
rep(i, n)
cin >> b[i];
rep(i, n)
p[b[i]] += a[i];
s = 0;
rep(i,101)
s = max(p[i], s);
cout << ( (s == p[0]) ? "YES" : "NO" );
}
Konton7