Submission #3389566


Source Code Expand

using System;
using System.Linq;//リストの使用
using System.Collections.Generic;
class Program
{
	static void Main()
	{
		string[] input = Console.ReadLine().Split(' ');//Splitで区切り文字を指定して複数個受け取る。
		long n = long.Parse(input[0]);
		long k = long.Parse(input[1]);
    long[,] vertexes = new long[n,2];
    long[,] masses = new long[4*k,4*k];
    long answer = 0;
    for(long i = 0; i < n; i++)
    {
      var nums = Console.ReadLine().Split(' ');//1行ごとに受け取る
      vertexes[i,0] = long.Parse(nums[0]);
      vertexes[i,1] = long.Parse(nums[1]);
      vertexes[i,0] %= 2 * k;
      vertexes[i,1] %= 2 * k;
      if(nums[2] == "W")
      {
        if(vertexes[i,0] < k) vertexes[i,0] += k;//WをBに反転
        else vertexes[i,0] -= k;
        if(vertexes[i,1] < k) vertexes[i,1] += k;
        else vertexes[i,1] -= k;
      }
      masses[vertexes[i,0], vertexes[i,1]]++;
      masses[vertexes[i,0]+k, vertexes[i,1]]--;
      masses[vertexes[i,0], vertexes[i,1]+k]--;
      masses[vertexes[i,0]+k, vertexes[i,1]+k] += 2;
      masses[vertexes[i,0]+k, vertexes[i,1]+2*k]--;
      masses[vertexes[i,0]+2*k, vertexes[i,1]+k]--;
      masses[vertexes[i,0]+2*k, vertexes[i,1]+2*k]++;
    }

    for(long i = 1; i < 4*k; i++)//右側へたす
    {
      for(long j = 0; j < 4*k; j++)
      {
        masses[i,j] += masses[i-1,j];
      }
    }

    for(long j = 1; j < 4*k; j++)//上側へたす
    {
      for(long i = 0; i < 4*k; i++)
      {
        masses[i,j] += masses[i,j-1];
      }
    }

    for(long i = 0; i < 4*k; i++)
    {
      for(long j = 0; j < 4*k; j++)
      {
        answer = Math.Max(answer, masses[i,j]);
      }
    }
    
		Console.WriteLine(answer);
	}
}

Submission Info

Submission Time
Task D - Checker
User suikameron
Language C# (Mono 4.6.2.0)
Score 0
Code Size 1803 Byte
Status WA
Exec Time 531 ms
Memory 141504 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 2
WA × 1
AC × 12
WA × 19
Set Name Test Cases
Sample 0_000.txt, 0_001.txt, 0_002.txt
All 0_000.txt, 0_001.txt, 0_002.txt, 1_003.txt, 1_004.txt, 1_005.txt, 1_006.txt, 1_007.txt, 1_008.txt, 1_009.txt, 1_010.txt, 1_011.txt, 1_012.txt, 1_013.txt, 1_014.txt, 1_015.txt, 1_016.txt, 1_017.txt, 1_018.txt, 1_019.txt, 1_020.txt, 1_021.txt, 1_022.txt, 1_023.txt, 1_024.txt, 1_025.txt, 1_026.txt, 1_027.txt, 1_028.txt, 1_029.txt, 1_030.txt
Case Name Status Exec Time Memory
0_000.txt AC 25 ms 11348 KB
0_001.txt AC 377 ms 133856 KB
0_002.txt WA 21 ms 9044 KB
1_003.txt AC 374 ms 135904 KB
1_004.txt AC 22 ms 11092 KB
1_005.txt AC 22 ms 11092 KB
1_006.txt AC 22 ms 11092 KB
1_007.txt AC 24 ms 11120 KB
1_008.txt AC 374 ms 133856 KB
1_009.txt WA 23 ms 11196 KB
1_010.txt WA 22 ms 9148 KB
1_011.txt WA 23 ms 11196 KB
1_012.txt WA 25 ms 12128 KB
1_013.txt WA 377 ms 135904 KB
1_014.txt WA 148 ms 14524 KB
1_015.txt WA 149 ms 17300 KB
1_016.txt WA 148 ms 14524 KB
1_017.txt WA 156 ms 17852 KB
1_018.txt WA 531 ms 141500 KB
1_019.txt AC 35 ms 15176 KB
1_020.txt AC 34 ms 14304 KB
1_021.txt AC 34 ms 12256 KB
1_022.txt AC 35 ms 14304 KB
1_023.txt WA 34 ms 12256 KB
1_024.txt WA 35 ms 14304 KB
1_025.txt WA 135 ms 16580 KB
1_026.txt WA 490 ms 141500 KB
1_027.txt WA 128 ms 16580 KB
1_028.txt WA 484 ms 139456 KB
1_029.txt WA 129 ms 16580 KB
1_030.txt WA 504 ms 141504 KB