結果

問題 No.1884 Sequence
ユーザー laneguelanegue
提出日時 2022-03-25 22:04:38
言語 D
(dmd 2.106.1)
結果
WA  
実行時間 -
コード長 545 bytes
コンパイル時間 2,439 ms
コンパイル使用メモリ 167,824 KB
実行使用メモリ 17,104 KB
最終ジャッジ日時 2023-09-04 16:31:03
合計ジャッジ時間 5,864 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
4,380 KB
testcase_01 AC 2 ms
4,380 KB
testcase_02 AC 1 ms
4,380 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 2 ms
4,376 KB
testcase_05 AC 1 ms
4,376 KB
testcase_06 AC 2 ms
4,376 KB
testcase_07 AC 1 ms
4,376 KB
testcase_08 AC 1 ms
4,376 KB
testcase_09 AC 1 ms
4,376 KB
testcase_10 AC 102 ms
14,612 KB
testcase_11 AC 101 ms
14,524 KB
testcase_12 AC 17 ms
7,648 KB
testcase_13 AC 18 ms
9,568 KB
testcase_14 AC 17 ms
7,640 KB
testcase_15 AC 62 ms
13,192 KB
testcase_16 AC 92 ms
14,628 KB
testcase_17 AC 34 ms
13,784 KB
testcase_18 AC 47 ms
13,640 KB
testcase_19 AC 38 ms
13,332 KB
testcase_20 AC 52 ms
13,652 KB
testcase_21 AC 42 ms
13,952 KB
testcase_22 AC 59 ms
13,320 KB
testcase_23 AC 92 ms
14,568 KB
testcase_24 AC 93 ms
14,492 KB
testcase_25 AC 93 ms
16,972 KB
testcase_26 AC 93 ms
14,552 KB
testcase_27 AC 19 ms
8,604 KB
testcase_28 AC 19 ms
9,136 KB
testcase_29 WA -
testcase_30 AC 20 ms
8,600 KB
testcase_31 AC 51 ms
10,316 KB
testcase_32 AC 92 ms
16,472 KB
testcase_33 AC 65 ms
14,652 KB
testcase_34 AC 65 ms
14,424 KB
testcase_35 AC 23 ms
9,484 KB
testcase_36 AC 53 ms
14,220 KB
testcase_37 AC 65 ms
14,608 KB
testcase_38 AC 65 ms
17,104 KB
testcase_39 AC 31 ms
10,404 KB
testcase_40 AC 35 ms
13,940 KB
testcase_41 AC 77 ms
14,120 KB
testcase_42 AC 77 ms
13,852 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
/dmd2/linux/bin64/../../src/phobos/std/numeric.d(2999): Warning: cannot inline function `std.numeric.gcdImpl!ulong.gcdImpl`

ソースコード

diff #

import std;

void main(){
	auto n = readln.chomp.to!long;
	auto a = readln.chomp.split.to!(long[]);
	auto b = a.filter!(x => x != 0).array.sort;
	if(b.length < 2){
		writeln("Yes");
		return;
	}
	auto m = b[1] - b[0];
	bool f = (b[0] == b[1]);
	for(auto i = 1; i < b.length - 1; i++){
		auto d = b[i + 1] - b[i];
		if(f){
			if(d > 0){
				m = -1;
				break;
			}
		}else{
			if(d == 0){
				m = -1;
				break;
			}
			m = m.gcd(d);
		}
	}
	stderr.writeln(m);
	if(b[$ - 1] - b[0] <= m * (n - 1)){
		writeln("Yes");
	}else{
		writeln("No");
	}
}
0