結果

問題 No.3387 23578 Sequence
コンテスト
ユーザー VvyLw
提出日時 2025-12-02 10:07:22
言語 D
(dmd 2.109.1)
結果
AC  
実行時間 2 ms / 2,000 ms
コード長 308 bytes
コンパイル時間 1,149 ms
コンパイル使用メモリ 164,760 KB
実行使用メモリ 7,852 KB
最終ジャッジ日時 2025-12-02 10:07:25
合計ジャッジ時間 2,472 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

import std;
void main() {
    const n = readln.chomp.to!int;
    const a = readln.split.to!(int[]);
    const x = a[0] + a[$-1];
    writeln(yes(iota(0, n).map!(i => a[i] + a[n - 1 - i]).all!(e => e == x)));
}

pragma(inline)
string yes(const bool b) pure @nogc nothrow @safe {
    return b ? "Yes" : "No";
}
0