Submission #2119491
Source Code Expand
#include <bits/stdc++.h> using namespace std; int n, k; int arr[2001][2001]; int arr_doubled[4001][4001]; int get(int y, int x){ return arr_doubled[y+k-1][x+k-1]+arr_doubled[y-1][x-1]-arr_doubled[y-1][x+k-1]-arr_doubled[y+k-1][x-1]; } int main() { /*int n = 2; int m = 4; int sum = 0; for (int i=1; i<=n; i++){ int x = m*(m+1)/2; sum += n*m*m-n*x+m*n-i*m*m+i*x-m*i+m*m-x+m; } cout << sum;*/ cin >> n >> k; for (int i=0; i<n; i++){ int x, y; char c; cin >> x >> y >> c; if (c == 'W'){ x += k; } x %= 2*k; y %= 2*k; arr[y][x]++; } for (int i=0; i<4*k; i++){ for (int j=0; j<4*k; j++){ arr_doubled[i][j] = arr_doubled[i][j-1]+arr[i%(2*k)][j%(2*k)]; } } for (int i=0; i<4*k; i++){ for (int j=1; j<4*k; j++){ arr_doubled[j][i] += arr_doubled[j-1][i]; } } int biggest = -1; for (int i=0; i<2*k+1; i++){ for (int j=0; j<2*k+1; j++){ biggest = max(get(i, j)+get(i+k, j+k), biggest); } } cout << biggest; return 0; }
Submission Info
Submission Time | |
---|---|
Task | D - Checker |
User | CatDog456 |
Language | C++14 (GCC 5.4.1) |
Score | 0 |
Code Size | 1107 Byte |
Status | RE |
Exec Time | 339 ms |
Memory | 78464 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 500 | ||||
Status |
|
|
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 | RE | 97 ms | 2304 KB |
0_001.txt | RE | 221 ms | 63744 KB |
0_002.txt | RE | 97 ms | 2304 KB |
1_003.txt | RE | 222 ms | 63744 KB |
1_004.txt | RE | 97 ms | 2304 KB |
1_005.txt | RE | 97 ms | 2304 KB |
1_006.txt | RE | 98 ms | 2304 KB |
1_007.txt | RE | 99 ms | 9216 KB |
1_008.txt | RE | 221 ms | 65792 KB |
1_009.txt | RE | 99 ms | 2304 KB |
1_010.txt | RE | 98 ms | 2304 KB |
1_011.txt | RE | 97 ms | 2432 KB |
1_012.txt | RE | 101 ms | 11264 KB |
1_013.txt | RE | 224 ms | 78080 KB |
1_014.txt | RE | 208 ms | 2304 KB |
1_015.txt | RE | 210 ms | 2304 KB |
1_016.txt | RE | 210 ms | 2304 KB |
1_017.txt | RE | 212 ms | 11264 KB |
1_018.txt | RE | 339 ms | 78464 KB |
1_019.txt | RE | 104 ms | 9216 KB |
1_020.txt | RE | 105 ms | 9216 KB |
1_021.txt | RE | 105 ms | 9216 KB |
1_022.txt | RE | 104 ms | 9216 KB |
1_023.txt | RE | 104 ms | 9216 KB |
1_024.txt | RE | 105 ms | 9216 KB |
1_025.txt | RE | 176 ms | 2432 KB |
1_026.txt | RE | 318 ms | 67840 KB |
1_027.txt | RE | 174 ms | 2432 KB |
1_028.txt | RE | 303 ms | 78336 KB |
1_029.txt | RE | 175 ms | 2432 KB |
1_030.txt | RE | 297 ms | 63744 KB |