結果

問題 No.216 FAC
ユーザー nak2yoshi
提出日時 2016-03-01 16:05:34
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 1,000 ms
コード長 423 bytes
コンパイル時間 842 ms
コンパイル使用メモリ 111,312 KB
実行使用メモリ 6,944 KB
最終ジャッジ日時 2024-06-12 03:11:55
合計ジャッジ時間 1,771 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

import std.stdio,
       std.conv,
       std.string,
       std.range,
       std.math,
       std.bigint,
       std.algorithm,
       core.bitop;

void main()
{
    auto N = readln.strip.to!int;
    auto a = readln.split.to!(int[]);
    auto b = readln.split.to!(int[]);

    int[int] score = [0: 0];
    iota(N).array.each!(i => score[b[i]] += a[i]);
    (score.values.reduce!max <= score[0] ? "YES" : "NO").writeln;
}
0