Submission #171280

# Submission time Handle Problem Language Result Execution time Memory
171280 2019-12-28T07:17:55 Z dennisstar Bitaro the Brave (JOI19_ho_t1) C++11
100 / 100
242 ms 88712 KB
#include <bits/stdc++.h>
#define fi first
#define se second
#define ryan bear
#define all(V) ((V).begin()), ((V).end())
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef long double ld;
typedef vector<int> vim;
typedef vector<ll> vlm;

int H, W;
char ar[3010][3010];
int c1[3010][3010], c2[3010][3010];
ll ans;

int main() {
	scanf("%d %d", &H, &W);
	for (int i=0; i<H; i++) {
		scanf("%s", ar[i]);
		for (int j=W-1; j>=0; j--) {
			c1[i][j]=c1[i][j+1];
			if (ar[i][j+1]=='O') c1[i][j]++;
		}
	}
	for (int i=H-1; i>=0; i--) {
		for (int j=0; j<W; j++) {
			c2[i][j]=c2[i+1][j];
			if (ar[i+1][j]=='I') c2[i][j]++;
			if (ar[i][j]=='J') ans+=(ll)c1[i][j]*c2[i][j];
		}
	}
	printf("%lld\n", ans);
	return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:20:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d %d", &H, &W);
  ~~~~~^~~~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:22:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", ar[i]);
   ~~~~~^~~~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 1 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 4 ms 504 KB Output is correct
5 Correct 3 ms 1500 KB Output is correct
6 Correct 4 ms 1528 KB Output is correct
7 Correct 3 ms 1432 KB Output is correct
8 Correct 4 ms 1528 KB Output is correct
9 Correct 3 ms 1528 KB Output is correct
10 Correct 3 ms 1400 KB Output is correct
11 Correct 3 ms 1528 KB Output is correct
12 Correct 3 ms 1528 KB Output is correct
13 Correct 3 ms 1400 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 1 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 4 ms 504 KB Output is correct
5 Correct 3 ms 1500 KB Output is correct
6 Correct 4 ms 1528 KB Output is correct
7 Correct 3 ms 1432 KB Output is correct
8 Correct 4 ms 1528 KB Output is correct
9 Correct 3 ms 1528 KB Output is correct
10 Correct 3 ms 1400 KB Output is correct
11 Correct 3 ms 1528 KB Output is correct
12 Correct 3 ms 1528 KB Output is correct
13 Correct 3 ms 1400 KB Output is correct
14 Correct 12 ms 7544 KB Output is correct
15 Correct 6 ms 4984 KB Output is correct
16 Correct 7 ms 4216 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 15 ms 8056 KB Output is correct
19 Correct 11 ms 8056 KB Output is correct
20 Correct 13 ms 7800 KB Output is correct
21 Correct 18 ms 8028 KB Output is correct
22 Correct 12 ms 7928 KB Output is correct
23 Correct 11 ms 8056 KB Output is correct
24 Correct 18 ms 8056 KB Output is correct
25 Correct 12 ms 8056 KB Output is correct
26 Correct 11 ms 7928 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 1 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 4 ms 504 KB Output is correct
5 Correct 3 ms 1500 KB Output is correct
6 Correct 4 ms 1528 KB Output is correct
7 Correct 3 ms 1432 KB Output is correct
8 Correct 4 ms 1528 KB Output is correct
9 Correct 3 ms 1528 KB Output is correct
10 Correct 3 ms 1400 KB Output is correct
11 Correct 3 ms 1528 KB Output is correct
12 Correct 3 ms 1528 KB Output is correct
13 Correct 3 ms 1400 KB Output is correct
14 Correct 12 ms 7544 KB Output is correct
15 Correct 6 ms 4984 KB Output is correct
16 Correct 7 ms 4216 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 15 ms 8056 KB Output is correct
19 Correct 11 ms 8056 KB Output is correct
20 Correct 13 ms 7800 KB Output is correct
21 Correct 18 ms 8028 KB Output is correct
22 Correct 12 ms 7928 KB Output is correct
23 Correct 11 ms 8056 KB Output is correct
24 Correct 18 ms 8056 KB Output is correct
25 Correct 12 ms 8056 KB Output is correct
26 Correct 11 ms 7928 KB Output is correct
27 Correct 214 ms 88144 KB Output is correct
28 Correct 27 ms 25980 KB Output is correct
29 Correct 14 ms 7900 KB Output is correct
30 Correct 3 ms 632 KB Output is correct
31 Correct 172 ms 72844 KB Output is correct
32 Correct 153 ms 88708 KB Output is correct
33 Correct 146 ms 88440 KB Output is correct
34 Correct 242 ms 84308 KB Output is correct
35 Correct 157 ms 88568 KB Output is correct
36 Correct 137 ms 88480 KB Output is correct
37 Correct 228 ms 88712 KB Output is correct
38 Correct 143 ms 72700 KB Output is correct
39 Correct 108 ms 72496 KB Output is correct