Submission #110331

# Submission time Handle Problem Language Result Execution time Memory
110331 2019-05-10T17:32:19 Z pamaj Bitaro the Brave (JOI19_ho_t1) C++14
0 / 100
6 ms 384 KB
#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 10;

int numO[maxn], numI[maxn];

int main()
{
	char tab[maxn][maxn];

	int H, W;

	cin >> H >> W;

	for(int i = 0; i < H; i++)
	{
		for(int j = 0; j < W; j++)
		{
			cin >> tab[i][j];
		}
	}

	for(int i = 0; i < H; i++)
	{
		for(int j = 0; j < W; j++)
		{
			if(tab[i][j] == 'O') numO[i]++;
		}
	}

	for(int i = 0; i < W; i++)
	{
		for(int j = 0; j < H; j++)
		{
			if(tab[j][i] == 'I') numI[i]++;
		}
	}


	int cont = 0;

	for(int i = 0; i < H - 1; i++)
	{
		for(int j = 0; j < W - 1; j++)
		{
				if(tab[i][j] == 'J')
					cont += numO[i]*numI[j];
		}
	}

	cout << cont << "\n";
}
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Incorrect 2 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Incorrect 2 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 6 ms 384 KB Output is correct
4 Incorrect 2 ms 384 KB Output isn't correct
5 Halted 0 ms 0 KB -