#include<bits/stdc++.h>
using namespace std ;
int main ()
{
int h,w;
cin>>h>>w;
char t[h+1][w+1];
for(int i=1;i<=h;i++)
for(int j=1;j<=w;j++)
cin>>t[i][j];
int c=0;
for(int i=1;i<=h;i++)
for(int k=i+1;k<=h;k++)
for(int j=1;j<=w;j++)
for(int l=j+1;l<=w;l++)
{
if(t[i][j]=='J' && t[i][l]=='O' && t[k][j]=='I')
c++;
}
cout<<c;
return 0 ;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
24 ms |
408 KB |
Output is correct |
6 |
Correct |
16 ms |
376 KB |
Output is correct |
7 |
Correct |
25 ms |
376 KB |
Output is correct |
8 |
Correct |
24 ms |
380 KB |
Output is correct |
9 |
Correct |
17 ms |
256 KB |
Output is correct |
10 |
Correct |
25 ms |
376 KB |
Output is correct |
11 |
Correct |
25 ms |
380 KB |
Output is correct |
12 |
Correct |
16 ms |
376 KB |
Output is correct |
13 |
Correct |
25 ms |
256 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
24 ms |
408 KB |
Output is correct |
6 |
Correct |
16 ms |
376 KB |
Output is correct |
7 |
Correct |
25 ms |
376 KB |
Output is correct |
8 |
Correct |
24 ms |
380 KB |
Output is correct |
9 |
Correct |
17 ms |
256 KB |
Output is correct |
10 |
Correct |
25 ms |
376 KB |
Output is correct |
11 |
Correct |
25 ms |
380 KB |
Output is correct |
12 |
Correct |
16 ms |
376 KB |
Output is correct |
13 |
Correct |
25 ms |
256 KB |
Output is correct |
14 |
Execution timed out |
1054 ms |
632 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
2 ms |
376 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
376 KB |
Output is correct |
4 |
Correct |
2 ms |
256 KB |
Output is correct |
5 |
Correct |
24 ms |
408 KB |
Output is correct |
6 |
Correct |
16 ms |
376 KB |
Output is correct |
7 |
Correct |
25 ms |
376 KB |
Output is correct |
8 |
Correct |
24 ms |
380 KB |
Output is correct |
9 |
Correct |
17 ms |
256 KB |
Output is correct |
10 |
Correct |
25 ms |
376 KB |
Output is correct |
11 |
Correct |
25 ms |
380 KB |
Output is correct |
12 |
Correct |
16 ms |
376 KB |
Output is correct |
13 |
Correct |
25 ms |
256 KB |
Output is correct |
14 |
Execution timed out |
1054 ms |
632 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |