Submission #3165996


Source Code Expand

Copy
void main() {
	auto ip = readAs!(int[]), N = ip[0], X = ip[1];
	auto x = readAs!(int[]).map!(i => i - X).map!(i => i.abs);
	auto c = x[0];
	foreach(i; x[1..$]) {
		c = gcd(i, c);
	}
	c.writeln;
}

// ===================================

import std.stdio;
import std.string;
import std.functional;
import std.conv;
import std.algorithm;
import std.range;
import std.traits;
import std.math;
import std.container;
import std.bigint;
import std.numeric;
import std.conv;
import std.typecons;
import std.uni;
import std.ascii;
import std.bitmanip;
import core.bitop;

T readAs(T)() if (isBasicType!T) {
	return readln.chomp.to!T;
}
T readAs(T)() if (isArray!T) {
	return readln.split.to!T;
}

T[][] readMatrix(T)(uint height, uint width) if (!isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		res[i] = readAs!(T[]);
	}
	return res;
}

T[][] readMatrix(T)(uint height, uint width) if (isSomeChar!T) {
	auto res = new T[][](height, width);
	foreach(i; 0..height) {
		auto s = rs;
		foreach(j; 0..width) res[i][j] = s[j].to!T;
	}
	return res;
}

int ri() {
	return readAs!int;
}

double rd() {
	return readAs!double;
}

string rs() {
	return readln.chomp;
}

Submission Info

Submission Time
Task C - Skip
User private_yusuke
Language D (DMD64 v2.070.1)
Score 300
Code Size 1245 Byte
Status AC
Exec Time 24 ms
Memory 4348 KB

Judge Result

Set Name All Sample
Score / Max Score 300 / 300 0 / 0
Status
AC × 22
AC × 3
Set Name Test Cases
All hand_1, large_1, large_2, large_3, large_4, large_5, large_6, large_7, large_8, max_1, max_2, max_3, min_1, min_2, sample_01, sample_02, sample_03, small_1, small_2, small_3, small_4, small_5
Sample sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
hand_1 AC 1 ms 256 KB
large_1 AC 5 ms 2812 KB
large_2 AC 6 ms 1148 KB
large_3 AC 5 ms 892 KB
large_4 AC 1 ms 256 KB
large_5 AC 1 ms 256 KB
large_6 AC 1 ms 256 KB
large_7 AC 1 ms 256 KB
large_8 AC 1 ms 256 KB
max_1 AC 24 ms 4348 KB
max_2 AC 24 ms 4020 KB
max_3 AC 24 ms 3508 KB
min_1 AC 1 ms 256 KB
min_2 AC 1 ms 256 KB
sample_01 AC 1 ms 256 KB
sample_02 AC 1 ms 256 KB
sample_03 AC 1 ms 256 KB
small_1 AC 1 ms 256 KB
small_2 AC 1 ms 256 KB
small_3 AC 1 ms 256 KB
small_4 AC 1 ms 256 KB
small_5 AC 1 ms 256 KB