Submission #11301894


Source Code Expand

Copy
void main() {
	auto ip = readAs!(long[]), N = ip[0], X = ip[1], Y = ip[2];
	X--; Y--;
	auto darr = new long[][](N, N);
	foreach(ref v; darr) v[] = -1;
	foreach(i; 0..N) {
		foreach(j; i+1..N) {
			auto tmp = j - i;
			tmp = min(tmp, abs(i - X) + 1 + abs(j - Y));
			darr[i][j] = tmp;
		}
	}
	auto res = new int[](N);
	foreach(i; 0..N) foreach(j; i+1..N) {
		res[darr[i][j]]++;
	}
	res[1..$].each!writeln;
}

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

import std.stdio;
import std.string;
import std.functional;
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 D - Line++
User private_yusuke
Language D (DMD64 v2.070.1)
Score 400
Code Size 1447 Byte
Status AC
Exec Time 25 ms
Memory 34300 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 4
AC × 17
Set Name Test Cases
Sample 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt
All 00_sample_01.txt, 00_sample_02.txt, 00_sample_03.txt, 00_sample_04.txt, 01_small_01.txt, 01_small_02.txt, 01_small_03.txt, 01_small_04.txt, 01_small_05.txt, 02_large_01.txt, 02_large_02.txt, 02_large_03.txt, 02_large_04.txt, 02_large_05.txt, 03_hand_01.txt, 03_hand_02.txt, 03_hand_03.txt
Case Name Status Exec Time Memory
00_sample_01.txt AC 1 ms 256 KB
00_sample_02.txt AC 1 ms 256 KB
00_sample_03.txt AC 1 ms 256 KB
00_sample_04.txt AC 1 ms 256 KB
01_small_01.txt AC 1 ms 380 KB
01_small_02.txt AC 1 ms 380 KB
01_small_03.txt AC 1 ms 380 KB
01_small_04.txt AC 1 ms 380 KB
01_small_05.txt AC 1 ms 380 KB
02_large_01.txt AC 25 ms 34300 KB
02_large_02.txt AC 24 ms 32764 KB
02_large_03.txt AC 24 ms 33660 KB
02_large_04.txt AC 24 ms 32892 KB
02_large_05.txt AC 25 ms 33020 KB
03_hand_01.txt AC 25 ms 33276 KB
03_hand_02.txt AC 24 ms 32892 KB
03_hand_03.txt AC 25 ms 33916 KB