<commit_before>﻿using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Player
{
	static void Main(string[] args)
	{
		string[] inputs;
		inputs = Console.ReadLine().Split(' ');
		int W = int.Parse(inputs[0]); // width of the building.
		int H = int.Parse(inputs[1]); // height of the building.
		int N = int.Parse(Console.ReadLine()); // maximum number of turns before game over.
		inputs = Console.ReadLine().Split(' ');
		int X0 = int.Parse(inputs[0]);
		int Y0 = int.Parse(inputs[1]);

		var batman = new Point(X0, Y0);

		var points = createPoints(W, H);

		// game loop
		var sw = new Stopwatch();
		while (true)
		{
			string BOMBDIST = Console.ReadLine(); // Current distance to the bomb compared to previous distance (COLDER, WARMER, SAME or UNKNOWN)
			sw.Restart();

			setDistancesTo(batman, points);
			Debug("{0} ms: Calculated new distances", sw.ElapsedMilliseconds);
			switch (BOMBDIST)
			{
				case "UNKNOWN":
					break;
				case "COLDER":
					Debug("{0} ms: is colder", sw.ElapsedMilliseconds);
					//points = points.Where(x => x.Distance > x.OldDistance).ToArray();
					var allpoints = points.Select((point, index) => new { Point = point, Distance = point.Distance, lastDistance = point.OldDistance }).ToArray();
					Debug("{0} ms: shuffled points", sw.ElapsedMilliseconds);
					var validPoints = allpoints.Where(x => x.Distance > x.lastDistance).ToArray();
					Debug("{0} ms: Found valid points", sw.ElapsedMilliseconds);
					points = validPoints.Select(x => x.Point).ToArray();
					Debug("{0} ms: Reloaded points", sw.ElapsedMilliseconds);
					break;
				case "WARMER":
					Debug("{0} ms: is warmer", sw.ElapsedMilliseconds);
					//points = points.Where(x => x.Distance < x.OldDistance).ToArray();
					var validPoints2 = points
						.Select((point, index) => new { Point = point, Distance = point.Distance, lastDistance = point.OldDistance })
						.Where(x => x.Distance < x.lastDistance && x.Point != batman)
						.ToArray();
					points = validPoints2.Select(x => x.Point).ToArray();
					break;
				case "SAME":
					Debug("{0} ms: is same distance", sw.ElapsedMilliseconds);
					//points = points.Where(x => x.Distance == x.OldDistance).ToArray();
					var validPoints3 = points
						.Select((point, index) => new { Point = point, Distance = point.Distance, lastDistance = point.OldDistance })
						.Where(x => x.Distance == x.lastDistance)
						.ToArray();
					points = validPoints3.Select(x => x.Point).ToArray();
					break;
				default:
					throw new NotSupportedException("Got Distance: " + BOMBDIST);
			}
			Debug("{0} ms: Determined {1} st valid points", sw.ElapsedMilliseconds, points.Length);

			//printMap(points, W, H, batman);

			//batman = points.OrderBy(x => x.Distance).Skip(points.Length / 2).First();
			var count = points.Length;
			var nextPoint = points.Select((Point, index) => new { Point, Distance = Point.Distance })
				.OrderBy(x => x.Distance)<commit_msg>Cleaned up COLDER case<commit_after>﻿using System;
using System.Linq;
using System.IO;
using System.Text;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;

/**
 * Auto-generated code below aims at helping you parse
 * the standard input according to the problem statement.
 **/
class Player
{
	static void Main(string[] args)
	{
		string[] inputs;
		inputs = Console.ReadLine().Split(' ');
		int W = int.Parse(inputs[0]); // width of the building.
		int H = int.Parse(inputs[1]); // height of the building.
		int N = int.Parse(Console.ReadLine()); // maximum number of turns before game over.
		inputs = Console.ReadLine().Split(' ');
		int X0 = int.Parse(inputs[0]);
		int Y0 = int.Parse(inputs[1]);

		var batman = new Point(X0, Y0);

		var points = createPoints(W, H);

		// game loop
		var sw = new Stopwatch();
		while (true)
		{
			string BOMBDIST = Console.ReadLine(); // Current distance to the bomb compared to previous distance (COLDER, WARMER, SAME or UNKNOWN)
			sw.Restart();

			setDistancesTo(batman, points);
			Debug("{0} ms: Calculated new distances", sw.ElapsedMilliseconds);
			switch (BOMBDIST)
			{
				case "UNKNOWN":
					break;
				case "COLDER":
					Debug("{0} ms: is colder", sw.ElapsedMilliseconds);
					points = points.Where(x => x.Distance > x.OldDistance).ToArray();
					Debug("{0} ms: Found valid points", sw.ElapsedMilliseconds);
					break;
				case "WARMER":
					Debug("{0} ms: is warmer", sw.ElapsedMilliseconds);
					//points = points.Where(x => x.Distance < x.OldDistance).ToArray();
					var validPoints2 = points
						.Select((point, index) => new { Point = point, Distance = point.Distance, lastDistance = point.OldDistance })
						.Where(x => x.Distance < x.lastDistance && x.Point != batman)
						.ToArray();
					points = validPoints2.Select(x => x.Point).ToArray();
					break;
				case "SAME":
					Debug("{0} ms: is same distance", sw.ElapsedMilliseconds);
					//points = points.Where(x => x.Distance == x.OldDistance).ToArray();
					var validPoints3 = points
						.Select((point, index) => new { Point = point, Distance = point.Distance, lastDistance = point.OldDistance })
						.Where(x => x.Distance == x.lastDistance)
						.ToArray();
					points = validPoints3.Select(x => x.Point).ToArray();
					break;
				default:
					throw new NotSupportedException("Got Distance: " + BOMBDIST);
			}
			Debug("{0} ms: Determined {1} st valid points", sw.ElapsedMilliseconds, points.Length);

			//printMap(points, W, H, batman);

			//batman = points.OrderBy(x => x.Distance).Skip(points.Length / 2).First();
			var count = points.Length;
			var nextPoint = points.Select((Point, index) => new { Point, Distance = Point.Distance })
				.OrderBy(x => x.Distance)
{'fraction_non_alphanumeric': 0.1511411665257819, 'fraction_numerical': 0.007100591715976331, 'mean_word_length': 3.458176337603617, 'pattern_counts': {'":': 8, '<': 7, '<?xml version=': 0, '>': 33, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4298311', 'n_tokens_mistral': 2199, 'n_tokens_neox': 1841, 'n_words': 510}