Submission #775472

# Submission time Handle Problem Language Result Execution time Memory
775472 2023-07-06T12:22:15 Z Trisanu_Das Bitaro the Brave (JOI19_ho_t1) C++17
100 / 100
178 ms 20456 KB
#include<bits/stdc++.h>
using namespace std;
#define int long long
 main () {
	int h, w;
	cin >> h >> w;
	string v[h];
	for(int i = 0;i<h;i++)cin>>v[i];
	int cnt[w] = {0}, ans = 0, k = 0;
	for(int i = h-1;i>=0;i--) {
		k = 0;
		for(int j = w-1;j>=0;j--) {
			if(v[i][j] == 'J')ans+=cnt[j]*k;
			else if(v[i][j] == 'O')k++;
			else cnt[j]++;
		}
	}
	cout<<ans<<endl;
}

Compilation message

joi2019_ho_t1.cpp:4:2: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
    4 |  main () {
      |  ^~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 304 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 304 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 6 ms 724 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 3 ms 564 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 6 ms 980 KB Output is correct
19 Correct 4 ms 696 KB Output is correct
20 Correct 4 ms 956 KB Output is correct
21 Correct 6 ms 1024 KB Output is correct
22 Correct 5 ms 692 KB Output is correct
23 Correct 5 ms 980 KB Output is correct
24 Correct 6 ms 980 KB Output is correct
25 Correct 4 ms 700 KB Output is correct
26 Correct 4 ms 980 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 1 ms 212 KB Output is correct
3 Correct 0 ms 212 KB Output is correct
4 Correct 1 ms 300 KB Output is correct
5 Correct 1 ms 212 KB Output is correct
6 Correct 1 ms 212 KB Output is correct
7 Correct 1 ms 304 KB Output is correct
8 Correct 1 ms 212 KB Output is correct
9 Correct 1 ms 212 KB Output is correct
10 Correct 1 ms 212 KB Output is correct
11 Correct 1 ms 340 KB Output is correct
12 Correct 1 ms 212 KB Output is correct
13 Correct 1 ms 212 KB Output is correct
14 Correct 6 ms 724 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 3 ms 564 KB Output is correct
17 Correct 1 ms 212 KB Output is correct
18 Correct 6 ms 980 KB Output is correct
19 Correct 4 ms 696 KB Output is correct
20 Correct 4 ms 956 KB Output is correct
21 Correct 6 ms 1024 KB Output is correct
22 Correct 5 ms 692 KB Output is correct
23 Correct 5 ms 980 KB Output is correct
24 Correct 6 ms 980 KB Output is correct
25 Correct 4 ms 700 KB Output is correct
26 Correct 4 ms 980 KB Output is correct
27 Correct 172 ms 20104 KB Output is correct
28 Correct 1 ms 340 KB Output is correct
29 Correct 11 ms 1856 KB Output is correct
30 Correct 1 ms 340 KB Output is correct
31 Correct 125 ms 15896 KB Output is correct
32 Correct 139 ms 20364 KB Output is correct
33 Correct 133 ms 20436 KB Output is correct
34 Correct 141 ms 18304 KB Output is correct
35 Correct 155 ms 20456 KB Output is correct
36 Correct 131 ms 20388 KB Output is correct
37 Correct 178 ms 20404 KB Output is correct
38 Correct 94 ms 15868 KB Output is correct
39 Correct 92 ms 15756 KB Output is correct