#include <bits/stdc++.h>
using namespace std;
// #define int ll
#define MAX LLONG_MAX
#define st first
#define nd second
#define endl '\n'
#define SZ(x) ((int)x.size())
#define ALL(x) x.begin(), x.end()
typedef long long ll;
typedef pair< int, int > ii;
typedef pair< int, ii > iii;
typedef vector< int > vi;
typedef vector< ii > vii;
typedef vector< iii > viii;
typedef vector< vi > vvi;
typedef vector< vii > vvii;
typedef vector< viii > vviii;
signed main(){
ios_base::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
int n, m; cin >> n >> m;
char a[n][m];
for(int i=0; i<n; i++){
for(int j=0; j<m; j++){
cin >> a[i][j];
}
}
int ans = 0;
for(int i=0; i<n; ++i){
for(int j=0; j<m; ++j){
for(int k=i+1; k<n; ++k){
for(int l=j+1; l<m; ++l){
if(a[i][j] == 'J' and a[i][l] == 'O' and a[k][j] == 'I'){
++ans;
}
}
}
}
}
cout << ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
20 ms |
332 KB |
Output is correct |
6 |
Correct |
8 ms |
328 KB |
Output is correct |
7 |
Correct |
16 ms |
340 KB |
Output is correct |
8 |
Correct |
17 ms |
344 KB |
Output is correct |
9 |
Correct |
10 ms |
324 KB |
Output is correct |
10 |
Correct |
16 ms |
336 KB |
Output is correct |
11 |
Correct |
18 ms |
212 KB |
Output is correct |
12 |
Correct |
8 ms |
212 KB |
Output is correct |
13 |
Correct |
16 ms |
340 KB |
Output is correct |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
20 ms |
332 KB |
Output is correct |
6 |
Correct |
8 ms |
328 KB |
Output is correct |
7 |
Correct |
16 ms |
340 KB |
Output is correct |
8 |
Correct |
17 ms |
344 KB |
Output is correct |
9 |
Correct |
10 ms |
324 KB |
Output is correct |
10 |
Correct |
16 ms |
336 KB |
Output is correct |
11 |
Correct |
18 ms |
212 KB |
Output is correct |
12 |
Correct |
8 ms |
212 KB |
Output is correct |
13 |
Correct |
16 ms |
340 KB |
Output is correct |
14 |
Execution timed out |
1073 ms |
596 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
20 ms |
332 KB |
Output is correct |
6 |
Correct |
8 ms |
328 KB |
Output is correct |
7 |
Correct |
16 ms |
340 KB |
Output is correct |
8 |
Correct |
17 ms |
344 KB |
Output is correct |
9 |
Correct |
10 ms |
324 KB |
Output is correct |
10 |
Correct |
16 ms |
336 KB |
Output is correct |
11 |
Correct |
18 ms |
212 KB |
Output is correct |
12 |
Correct |
8 ms |
212 KB |
Output is correct |
13 |
Correct |
16 ms |
340 KB |
Output is correct |
14 |
Execution timed out |
1073 ms |
596 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |