# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
15043 |
2015-07-11T06:46:08 Z |
hongjun7 |
빨간 직사각형 (kriii3_QQ) |
C++ |
|
1000 ms |
45176 KB |
#include <cstdio>
int n, m;
int nu[3005][3005];
char S[3005][3005];
int main() {
scanf("%d%d", &n, &m);
for (int i = 1; i <= n; i++) scanf("%s", S[i] + 1);
for (int i = 1; i <= n; i++) {
for (int j = m; j >= 1; j--) {
nu[i][j] = S[i][j] == 'B' ? 0 : nu[i][j+1] + 1;
}
}
long long res = 0;
for (int i = 1; i <= m; i++) {
for (int j = 1; j <= n; j++) {
int v = 2147483647;
for (int k = j; k >= 1; k--) {
if (v > nu[k][i]) v = nu[k][i];
res += v;
}
}
}
printf("%lld", res);
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
0 ms |
45176 KB |
Output is correct |
2 |
Correct |
0 ms |
45176 KB |
Output is correct |
3 |
Correct |
0 ms |
45176 KB |
Output is correct |
4 |
Correct |
0 ms |
45176 KB |
Output is correct |
5 |
Correct |
0 ms |
45176 KB |
Output is correct |
6 |
Correct |
0 ms |
45176 KB |
Output is correct |
7 |
Correct |
0 ms |
45176 KB |
Output is correct |
8 |
Correct |
0 ms |
45176 KB |
Output is correct |
9 |
Correct |
0 ms |
45176 KB |
Output is correct |
10 |
Correct |
1 ms |
45176 KB |
Output is correct |
11 |
Correct |
0 ms |
45176 KB |
Output is correct |
12 |
Correct |
0 ms |
45176 KB |
Output is correct |
13 |
Correct |
0 ms |
45176 KB |
Output is correct |
14 |
Correct |
0 ms |
45176 KB |
Output is correct |
15 |
Correct |
0 ms |
45176 KB |
Output is correct |
16 |
Correct |
0 ms |
45176 KB |
Output is correct |
17 |
Correct |
0 ms |
45176 KB |
Output is correct |
18 |
Correct |
1 ms |
45176 KB |
Output is correct |
19 |
Correct |
0 ms |
45176 KB |
Output is correct |
20 |
Correct |
0 ms |
45176 KB |
Output is correct |
21 |
Correct |
85 ms |
45176 KB |
Output is correct |
22 |
Correct |
103 ms |
45176 KB |
Output is correct |
23 |
Correct |
103 ms |
45176 KB |
Output is correct |
24 |
Correct |
95 ms |
45176 KB |
Output is correct |
25 |
Correct |
116 ms |
45176 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
45176 KB |
Output is correct |
2 |
Correct |
63 ms |
45176 KB |
Output is correct |
3 |
Correct |
982 ms |
45176 KB |
Output is correct |
4 |
Correct |
982 ms |
45176 KB |
Output is correct |
5 |
Correct |
973 ms |
45176 KB |
Output is correct |
6 |
Correct |
973 ms |
45176 KB |
Output is correct |
7 |
Correct |
981 ms |
45176 KB |
Output is correct |
8 |
Correct |
976 ms |
45176 KB |
Output is correct |
9 |
Correct |
980 ms |
45176 KB |
Output is correct |
10 |
Correct |
986 ms |
45176 KB |
Output is correct |
11 |
Correct |
972 ms |
45176 KB |
Output is correct |
12 |
Correct |
58 ms |
45176 KB |
Output is correct |
13 |
Correct |
970 ms |
45176 KB |
Output is correct |
14 |
Correct |
62 ms |
45176 KB |
Output is correct |
15 |
Correct |
59 ms |
45176 KB |
Output is correct |
16 |
Correct |
56 ms |
45176 KB |
Output is correct |
17 |
Correct |
59 ms |
45176 KB |
Output is correct |
18 |
Correct |
62 ms |
45176 KB |
Output is correct |
19 |
Correct |
62 ms |
45176 KB |
Output is correct |
20 |
Correct |
63 ms |
45176 KB |
Output is correct |
21 |
Correct |
141 ms |
45176 KB |
Output is correct |
22 |
Correct |
131 ms |
45176 KB |
Output is correct |
23 |
Correct |
655 ms |
45176 KB |
Output is correct |
24 |
Correct |
723 ms |
45176 KB |
Output is correct |
25 |
Correct |
505 ms |
45176 KB |
Output is correct |
26 |
Correct |
242 ms |
45176 KB |
Output is correct |
27 |
Correct |
540 ms |
45176 KB |
Output is correct |
28 |
Correct |
338 ms |
45176 KB |
Output is correct |
29 |
Correct |
290 ms |
45176 KB |
Output is correct |
30 |
Correct |
393 ms |
45176 KB |
Output is correct |
31 |
Execution timed out |
1000 ms |
45172 KB |
Program timed out |
32 |
Halted |
0 ms |
0 KB |
- |