結果
問題 | No.1884 Sequence |
ユーザー |
|
提出日時 | 2022-03-25 21:50:48 |
言語 | D (dmd 2.109.1) |
結果 |
RE
|
実行時間 | - |
コード長 | 369 bytes |
コンパイル時間 | 1,713 ms |
コンパイル使用メモリ | 180,088 KB |
実行使用メモリ | 13,596 KB |
最終ジャッジ日時 | 2024-06-22 14:41:06 |
合計ジャッジ時間 | 4,831 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 3 RE * 37 |
コンパイルメッセージ
/home/linuxbrew/.linuxbrew/opt/dmd/include/dlang/dmd/std/numeric.d(2999): Warning: cannot inline function `std.numeric.gcdImpl!uint.gcdImpl`
ソースコード
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"); } }