Submission #531985

# Submission time Handle Problem Language Result Execution time Memory
531985 2022-03-02T02:54:19 Z nguyentunglam Bitaro the Brave (JOI19_ho_t1) C++14
100 / 100
281 ms 9168 KB
#include<bits/stdc++.h>
#define forin(i, a, b) for(int i = a; i <= b; i++)
#define forde(i, a, b) for(int i = a; i >= b; i--)
#define fi first 
#define se second
#define ll long long
using namespace std;
const int N = 3e3 + 10;
char a[N][N];
int row[N], col[N];
long long res; 
int main()
{
	int h, w; cin >> h >> w;
	forin(i, 1, h) 
	{
		string s; cin >> s;
		forin(j, 0, s.size()-1) a[i][j+1] = s[j];
	}
	forde(i, h, 1) forde(j, w, 1) 
	{
		if (a[i][j] == 'O') row[i]++;
		if (a[i][j] == 'I') col[j]++;
		if (a[i][j] == 'J') res +=row[i]*col[j];
	}
	cout << res;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:2:41: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
    2 | #define forin(i, a, b) for(int i = a; i <= b; i++)
......
   18 |   forin(j, 0, s.size()-1) a[i][j+1] = s[j];
      |         ~~~~~~~~~~~~~~~~                 
joi2019_ho_t1.cpp:18:3: note: in expansion of macro 'forin'
   18 |   forin(j, 0, s.size()-1) a[i][j+1] = s[j];
      |   ^~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 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 332 KB Output is correct
5 Correct 1 ms 588 KB Output is correct
6 Correct 1 ms 588 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 1 ms 588 KB Output is correct
9 Correct 1 ms 588 KB Output is correct
10 Correct 1 ms 460 KB Output is correct
11 Correct 1 ms 588 KB Output is correct
12 Correct 1 ms 588 KB Output is correct
13 Correct 1 ms 460 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 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 332 KB Output is correct
5 Correct 1 ms 588 KB Output is correct
6 Correct 1 ms 588 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 1 ms 588 KB Output is correct
9 Correct 1 ms 588 KB Output is correct
10 Correct 1 ms 460 KB Output is correct
11 Correct 1 ms 588 KB Output is correct
12 Correct 1 ms 588 KB Output is correct
13 Correct 1 ms 460 KB Output is correct
14 Correct 7 ms 1776 KB Output is correct
15 Correct 1 ms 1484 KB Output is correct
16 Correct 4 ms 972 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 8 ms 1680 KB Output is correct
19 Correct 8 ms 1740 KB Output is correct
20 Correct 7 ms 1740 KB Output is correct
21 Correct 8 ms 1740 KB Output is correct
22 Correct 7 ms 1740 KB Output is correct
23 Correct 7 ms 1696 KB Output is correct
24 Correct 9 ms 1776 KB Output is correct
25 Correct 7 ms 1692 KB Output is correct
26 Correct 7 ms 1740 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 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 332 KB Output is correct
5 Correct 1 ms 588 KB Output is correct
6 Correct 1 ms 588 KB Output is correct
7 Correct 1 ms 460 KB Output is correct
8 Correct 1 ms 588 KB Output is correct
9 Correct 1 ms 588 KB Output is correct
10 Correct 1 ms 460 KB Output is correct
11 Correct 1 ms 588 KB Output is correct
12 Correct 1 ms 588 KB Output is correct
13 Correct 1 ms 460 KB Output is correct
14 Correct 7 ms 1776 KB Output is correct
15 Correct 1 ms 1484 KB Output is correct
16 Correct 4 ms 972 KB Output is correct
17 Correct 1 ms 332 KB Output is correct
18 Correct 8 ms 1680 KB Output is correct
19 Correct 8 ms 1740 KB Output is correct
20 Correct 7 ms 1740 KB Output is correct
21 Correct 8 ms 1740 KB Output is correct
22 Correct 7 ms 1740 KB Output is correct
23 Correct 7 ms 1696 KB Output is correct
24 Correct 9 ms 1776 KB Output is correct
25 Correct 7 ms 1692 KB Output is correct
26 Correct 7 ms 1740 KB Output is correct
27 Correct 242 ms 9168 KB Output is correct
28 Correct 4 ms 7116 KB Output is correct
29 Correct 16 ms 1080 KB Output is correct
30 Correct 1 ms 332 KB Output is correct
31 Correct 193 ms 7680 KB Output is correct
32 Correct 240 ms 9116 KB Output is correct
33 Correct 197 ms 9092 KB Output is correct
34 Correct 201 ms 8836 KB Output is correct
35 Correct 222 ms 9124 KB Output is correct
36 Correct 204 ms 9116 KB Output is correct
37 Correct 281 ms 9028 KB Output is correct
38 Correct 144 ms 7672 KB Output is correct
39 Correct 147 ms 7620 KB Output is correct