Task: | Tontti |
Sender: | retki5 |
Submission time: | 2015-10-01 22:04:45 +0300 |
Language: | C++ |
Status: | READY |
Result: | 0 |
group | verdict | score |
---|---|---|
#1 | TIME LIMIT EXCEEDED | 0 |
#2 | RUNTIME ERROR | 0 |
#3 | RUNTIME ERROR | 0 |
test | verdict | time | group | |
---|---|---|---|---|
#1 | TIME LIMIT EXCEEDED | -- | 1 | details |
#2 | TIME LIMIT EXCEEDED | -- | 1 | details |
#3 | TIME LIMIT EXCEEDED | -- | 1 | details |
#4 | TIME LIMIT EXCEEDED | -- | 1 | details |
#5 | TIME LIMIT EXCEEDED | -- | 1 | details |
#6 | RUNTIME ERROR | 0.13 s | 2 | details |
#7 | RUNTIME ERROR | 0.11 s | 2 | details |
#8 | RUNTIME ERROR | 0.12 s | 2 | details |
#9 | RUNTIME ERROR | 0.12 s | 2 | details |
#10 | RUNTIME ERROR | 0.12 s | 2 | details |
#11 | RUNTIME ERROR | 0.12 s | 3 | details |
#12 | RUNTIME ERROR | 0.11 s | 3 | details |
#13 | RUNTIME ERROR | 0.12 s | 3 | details |
#14 | RUNTIME ERROR | 0.13 s | 3 | details |
#15 | RUNTIME ERROR | 0.11 s | 3 | details |
Compiler report
input/code.cpp: In function 'int main()': input/code.cpp:45:9: warning: unused variable 'q' [-Wunused-variable] int q = 0, w = 0, e = 0, r = 0; ^ input/code.cpp:45:16: warning: unused variable 'w' [-Wunused-variable] int q = 0, w = 0, e = 0, r = 0; ^ input/code.cpp:45:23: warning: unused variable 'e' [-Wunused-variable] int q = 0, w = 0, e = 0, r = 0; ^ input/code.cpp:45:30: warning: unused variable 'r' [-Wunused-variable] int q = 0, w = 0, e = 0, r = 0; ^
Code
#include <iostream> #include <vector> #include <algorithm> #include <queue> int main() { int y, x, vvv; std::cin >> y >> x >> vvv; char ** fr; int ** rows; int *** tr; int max = std::min(x, y); tr = new int**[max + 1]; for (int i = 2; i < max + 1; i++) { tr[i] = new int*[y]; for (int a = 0; a < y; a++) { tr[i][a] = new int[x]; } } fr = new char*[y]; rows = new int*[y]; for (int i = 0; i < y; i++) { fr[i] = new char[x]; rows[i] = new int[x]; std::cin >> fr[i]; } for (int i = 0; i < y; i++) { for (int a = 0; a < x; a++) { //tr[2][i][a] =1 ; if (i == 0 || a == 0) { if (fr[i][a] == '*') tr[2][i][a] = 1; else tr[2][i][a] = 0; continue; } int q = 0, w = 0, e = 0, r = 0; if (fr[i - 1][a - 1] == '*') q = 1; if (fr[i - 1][a] == '*') w = 1; if (fr[i][a - 1] == '*') e = 1; if (fr[i][a] == '*') r = 1; tr[2][i][a] = q + w + e + r; } } for (int s = 3; s <= max; s++) { for (int i = s - 1; i < y; i++) { for (int a = s - 1; a < x; a++) { int q = 0, w = 0, e = 0, r = 0; //std::cout << s << ", " << i << ", " << a << std::endl; //tr[s][i][a] = 0; if (fr[i][a] == '*') tr[s][i][a]++; tr[s][i][a] = tr[s - 1][i - 1][a - 1]; for (int c = 1; c < s; c++) { if (fr[i][a - c] == '*') tr[s][i][a]++; } for (int c = 1; c < s; c++) { if (fr[i - c][a] == '*') tr[s][i][a]++; } } } } int ans = 0; for (int s = 2; s <= max; s++) { for (int i = 0; i < y; i++) { for (int a = 0; a < x; a++) { //std::cout << tr[s][i][a] << " "; if (tr[s][i][a] == vvv) ans++; } //std::cout << std::endl; } } std::cout << ans << "\n"; int d = 3; while (d == 3) { std::cin >> d; } return 0; }
Test details
Test 1
Group: 1
Verdict: TIME LIMIT EXCEEDED
input |
---|
10 10 1 ......*... .......*.. *..*....*. *....*.... ... |
correct output |
---|
94 |
user output |
---|
(empty) |
Test 2
Group: 1
Verdict: TIME LIMIT EXCEEDED
input |
---|
10 10 5 ********** ********** ********** ********** ... |
correct output |
---|
0 |
user output |
---|
(empty) |
Test 3
Group: 1
Verdict: TIME LIMIT EXCEEDED
input |
---|
10 10 10 **...*...* *..*.**.*. ...**.*..* *...**.*.. ... |
correct output |
---|
4 |
user output |
---|
(empty) |
Test 4
Group: 1
Verdict: TIME LIMIT EXCEEDED
input |
---|
10 10 5 ****...... *.*.**..** ....*.*..* ...*.***.. ... |
correct output |
---|
16 |
user output |
---|
(empty) |
Test 5
Group: 1
Verdict: TIME LIMIT EXCEEDED
input |
---|
10 10 2 **.***..*. ...*.*.... .***.*...* ***.***..* ... |
correct output |
---|
30 |
user output |
---|
(empty) |
Test 6
Group: 2
Verdict: RUNTIME ERROR
input |
---|
500 500 1 ................................. |
correct output |
---|
9552040 |
user output |
---|
(empty) |
Test 7
Group: 2
Verdict: RUNTIME ERROR
input |
---|
500 500 5 ................................. |
correct output |
---|
1536063 |
user output |
---|
(empty) |
Test 8
Group: 2
Verdict: RUNTIME ERROR
input |
---|
500 500 25000 **...*...**..*.*..*.**.*..*.*.... |
correct output |
---|
288 |
user output |
---|
(empty) |
Test 9
Group: 2
Verdict: RUNTIME ERROR
input |
---|
500 500 12500 **.**.*..*...*.**...*.***........ |
correct output |
---|
786 |
user output |
---|
(empty) |
Test 10
Group: 2
Verdict: RUNTIME ERROR
input |
---|
500 500 5000 .*.*.**..*.*.**.**..*..**...*.... |
correct output |
---|
1763 |
user output |
---|
(empty) |
Test 11
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2000 2000 1 ................................. |
correct output |
---|
489611392 |
user output |
---|
(empty) |
Test 12
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2000 2000 5 ................................. |
correct output |
---|
120725884 |
user output |
---|
(empty) |
Test 13
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2000 2000 400000 ..*..**.**.**.*.***...**.*..**... |
correct output |
---|
1849 |
user output |
---|
(empty) |
Test 14
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2000 2000 200000 ***.*....*.*..*....**..*..*.*.... |
correct output |
---|
2665 |
user output |
---|
(empty) |
Test 15
Group: 3
Verdict: RUNTIME ERROR
input |
---|
2000 2000 80000 **.**...*.***.**....**.*....*.... |
correct output |
---|
5587 |
user output |
---|
(empty) |