結果
問題 | No.216 FAC |
ユーザー |
|
提出日時 | 2018-10-18 19:51:01 |
言語 | JavaScript (node v23.5.0) |
結果 |
RE
|
実行時間 | - |
コード長 | 398 bytes |
コンパイル時間 | 42 ms |
コンパイル使用メモリ | 6,820 KB |
実行使用メモリ | 41,592 KB |
最終ジャッジ日時 | 2024-10-13 00:44:04 |
合計ジャッジ時間 | 2,478 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 4 RE * 20 |
ソースコード
let input = require('fs').readFileSync('/dev/stdin', 'utf8');input = input.split('\n').map(v => v.split(/\s/)).map(v => v.map(v => Number(v)));const sum = arr => arr.reduce((a, b) => a + b);const [N, a, b] = input;let TOTAL = Array(Math.max(...b) + 1).fill(0);TOTAL = TOTAL.map((v, i) => sum(a.filter((v, j) => b[j] == i)));console.log(Math.max(...TOTAL) == TOTAL[0] ? 'YES' : 'NO');