Submission #471478

# Submission time Handle Problem Language Result Execution time Memory
471478 2021-09-09T13:20:39 Z fuad27 Bitaro the Brave (JOI19_ho_t1) C++17
100 / 100
292 ms 20660 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 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 216 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Correct 1 ms 216 KB Output is correct
8 Correct 1 ms 216 KB Output is correct
9 Correct 1 ms 216 KB Output is correct
10 Correct 1 ms 216 KB Output is correct
11 Correct 1 ms 216 KB Output is correct
12 Correct 1 ms 308 KB Output is correct
13 Correct 1 ms 216 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 216 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Correct 1 ms 216 KB Output is correct
8 Correct 1 ms 216 KB Output is correct
9 Correct 1 ms 216 KB Output is correct
10 Correct 1 ms 216 KB Output is correct
11 Correct 1 ms 216 KB Output is correct
12 Correct 1 ms 308 KB Output is correct
13 Correct 1 ms 216 KB Output is correct
14 Correct 7 ms 728 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 4 ms 572 KB Output is correct
17 Correct 1 ms 216 KB Output is correct
18 Correct 9 ms 984 KB Output is correct
19 Correct 7 ms 728 KB Output is correct
20 Correct 7 ms 984 KB Output is correct
21 Correct 9 ms 984 KB Output is correct
22 Correct 8 ms 728 KB Output is correct
23 Correct 9 ms 984 KB Output is correct
24 Correct 9 ms 984 KB Output is correct
25 Correct 8 ms 748 KB Output is correct
26 Correct 7 ms 956 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 0 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 1 ms 204 KB Output is correct
4 Correct 1 ms 212 KB Output is correct
5 Correct 1 ms 216 KB Output is correct
6 Correct 1 ms 308 KB Output is correct
7 Correct 1 ms 216 KB Output is correct
8 Correct 1 ms 216 KB Output is correct
9 Correct 1 ms 216 KB Output is correct
10 Correct 1 ms 216 KB Output is correct
11 Correct 1 ms 216 KB Output is correct
12 Correct 1 ms 308 KB Output is correct
13 Correct 1 ms 216 KB Output is correct
14 Correct 7 ms 728 KB Output is correct
15 Correct 1 ms 212 KB Output is correct
16 Correct 4 ms 572 KB Output is correct
17 Correct 1 ms 216 KB Output is correct
18 Correct 9 ms 984 KB Output is correct
19 Correct 7 ms 728 KB Output is correct
20 Correct 7 ms 984 KB Output is correct
21 Correct 9 ms 984 KB Output is correct
22 Correct 8 ms 728 KB Output is correct
23 Correct 9 ms 984 KB Output is correct
24 Correct 9 ms 984 KB Output is correct
25 Correct 8 ms 748 KB Output is correct
26 Correct 7 ms 956 KB Output is correct
27 Correct 271 ms 20168 KB Output is correct
28 Correct 2 ms 344 KB Output is correct
29 Correct 24 ms 1940 KB Output is correct
30 Correct 1 ms 344 KB Output is correct
31 Correct 220 ms 15824 KB Output is correct
32 Correct 258 ms 20660 KB Output is correct
33 Correct 252 ms 20360 KB Output is correct
34 Correct 268 ms 18420 KB Output is correct
35 Correct 256 ms 20400 KB Output is correct
36 Correct 237 ms 20444 KB Output is correct
37 Correct 292 ms 20440 KB Output is correct
38 Correct 174 ms 15872 KB Output is correct
39 Correct 160 ms 15928 KB Output is correct