結果
| 問題 | No.1884 Sequence |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-03-25 21:50:48 |
| 言語 | D (dmd 2.112.0) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 369 bytes |
| 記録 | |
| コンパイル時間 | 737 ms |
| コンパイル使用メモリ | 172,148 KB |
| 実行使用メモリ | 12,468 KB |
| 最終ジャッジ日時 | 2026-07-27 04:37:39 |
| 合計ジャッジ時間 | 3,576 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / <nil> |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 3 RE * 37 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/numeric.d(3011): Warning: cannot inline function `std.numeric.gcdImpl!uint.gcdImpl`
private typeof(T.init % T.init) gcdImpl(T)(T a, T b)
^
ソースコード
import std;
void main(){
auto n = readln.chomp.to!int;
auto a = readln.chomp.split.to!(int[]);
auto b = a.filter!(x => x != 0).array.sort;
auto min = b[1] - b[0];
for(auto i = 1; i < b.length - 1; i++){
auto d = b[i + 1] - b[i];
min = min.gcd(d);
}
stderr.writeln(min);
if(b[$ - 1] - b[0] <= min * (n - 1)){
writeln("Yes");
}else{
writeln("No");
}
}