# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
210478 | 2020-03-17T13:46:02 Z | gratus907 | Bitaro the Brave (JOI19_ho_t1) | C++17 | 254 ms | 160376 KB |
#include <bits/stdc++.h> using namespace std; #define ll long long #pragma GCC optimize("O3") #pragma GCC optimize("Ofast") #pragma GCC target("avx,avx2,fma") #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native") #define usecppio ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); #define all(x) ((x).begin()),((x).end()) #define int ll using pii = pair<int, int>; #define INF 0x7f7f7f7f7f7f7f7f const bool debug = false; char arrange[3030][3030]; int orb[3030][3030]; int ingot[3030][3030]; int h, w; int32_t main() { scanf("%lld %lld",&h, &w); for (int i = 1; i<=h; i++) scanf("%s",arrange[i]+1); for (int i = 1; i<=h; i++) { for (int j = 1; j<=w; j++) { if (arrange[i][j]=='O') orb[i][j]++; else if (arrange[i][j]=='I') ingot[i][j]++; } } for (int i = 1; i<=h; i++) { for (int j = w-1; j>=1; j--) { orb[i][j] += orb[i][j+1]; } } for (int i = 1; i<=w; i++) { for (int j = h-1; j>=1; j--) { ingot[j][i] += ingot[j+1][i]; } } int ans = 0; for (int i = 1; i<=h; i++) for (int j = 1; j<=w; j++) if (arrange[i][j]=='J') ans += orb[i][j+1]*ingot[i+1][j]; printf("%lld\n",ans); }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 380 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
5 | Correct | 5 ms | 1656 KB | Output is correct |
6 | Correct | 5 ms | 1528 KB | Output is correct |
7 | Correct | 6 ms | 1400 KB | Output is correct |
8 | Correct | 6 ms | 1656 KB | Output is correct |
9 | Correct | 5 ms | 1528 KB | Output is correct |
10 | Correct | 6 ms | 1400 KB | Output is correct |
11 | Correct | 6 ms | 1528 KB | Output is correct |
12 | Correct | 6 ms | 1528 KB | Output is correct |
13 | Correct | 6 ms | 1528 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 380 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
5 | Correct | 5 ms | 1656 KB | Output is correct |
6 | Correct | 5 ms | 1528 KB | Output is correct |
7 | Correct | 6 ms | 1400 KB | Output is correct |
8 | Correct | 6 ms | 1656 KB | Output is correct |
9 | Correct | 5 ms | 1528 KB | Output is correct |
10 | Correct | 6 ms | 1400 KB | Output is correct |
11 | Correct | 6 ms | 1528 KB | Output is correct |
12 | Correct | 6 ms | 1528 KB | Output is correct |
13 | Correct | 6 ms | 1528 KB | Output is correct |
14 | Correct | 13 ms | 9080 KB | Output is correct |
15 | Correct | 7 ms | 5112 KB | Output is correct |
16 | Correct | 11 ms | 5368 KB | Output is correct |
17 | Correct | 5 ms | 504 KB | Output is correct |
18 | Correct | 15 ms | 9976 KB | Output is correct |
19 | Correct | 15 ms | 9976 KB | Output is correct |
20 | Correct | 14 ms | 9848 KB | Output is correct |
21 | Correct | 16 ms | 9976 KB | Output is correct |
22 | Correct | 15 ms | 9848 KB | Output is correct |
23 | Correct | 14 ms | 9848 KB | Output is correct |
24 | Correct | 16 ms | 9976 KB | Output is correct |
25 | Correct | 14 ms | 9792 KB | Output is correct |
26 | Correct | 14 ms | 9848 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 376 KB | Output is correct |
2 | Correct | 5 ms | 380 KB | Output is correct |
3 | Correct | 5 ms | 376 KB | Output is correct |
4 | Correct | 5 ms | 376 KB | Output is correct |
5 | Correct | 5 ms | 1656 KB | Output is correct |
6 | Correct | 5 ms | 1528 KB | Output is correct |
7 | Correct | 6 ms | 1400 KB | Output is correct |
8 | Correct | 6 ms | 1656 KB | Output is correct |
9 | Correct | 5 ms | 1528 KB | Output is correct |
10 | Correct | 6 ms | 1400 KB | Output is correct |
11 | Correct | 6 ms | 1528 KB | Output is correct |
12 | Correct | 6 ms | 1528 KB | Output is correct |
13 | Correct | 6 ms | 1528 KB | Output is correct |
14 | Correct | 13 ms | 9080 KB | Output is correct |
15 | Correct | 7 ms | 5112 KB | Output is correct |
16 | Correct | 11 ms | 5368 KB | Output is correct |
17 | Correct | 5 ms | 504 KB | Output is correct |
18 | Correct | 15 ms | 9976 KB | Output is correct |
19 | Correct | 15 ms | 9976 KB | Output is correct |
20 | Correct | 14 ms | 9848 KB | Output is correct |
21 | Correct | 16 ms | 9976 KB | Output is correct |
22 | Correct | 15 ms | 9848 KB | Output is correct |
23 | Correct | 14 ms | 9848 KB | Output is correct |
24 | Correct | 16 ms | 9976 KB | Output is correct |
25 | Correct | 14 ms | 9792 KB | Output is correct |
26 | Correct | 14 ms | 9848 KB | Output is correct |
27 | Correct | 245 ms | 159864 KB | Output is correct |
28 | Correct | 19 ms | 26360 KB | Output is correct |
29 | Correct | 22 ms | 13944 KB | Output is correct |
30 | Correct | 7 ms | 760 KB | Output is correct |
31 | Correct | 192 ms | 131704 KB | Output is correct |
32 | Correct | 238 ms | 160248 KB | Output is correct |
33 | Correct | 228 ms | 159736 KB | Output is correct |
34 | Correct | 218 ms | 152696 KB | Output is correct |
35 | Correct | 237 ms | 160248 KB | Output is correct |
36 | Correct | 228 ms | 159864 KB | Output is correct |
37 | Correct | 254 ms | 160376 KB | Output is correct |
38 | Correct | 179 ms | 130936 KB | Output is correct |
39 | Correct | 171 ms | 131192 KB | Output is correct |