Submission #381637

# Submission time Handle Problem Language Result Execution time Memory
381637 2021-03-25T11:53:28 Z Iwanttobreakfree Bitaro the Brave (JOI19_ho_t1) C++17
50 / 100
1000 ms 23264 KB
#include <iostream>
#include <vector>
using namespace std;
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	long long int h,w;
	cin>>h>>w;
	char grid[h][w];
	int canti[h][w];
	int canto[h][w];
	vector<pair<int,int> > v;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			cin>>grid[i][j];
			canti[i][j]=0;
			canto[i][j]=0;
			if(grid[i][j]=='J')v.push_back(make_pair(i,j));
			if(grid[i][j]=='I'){
				for(int x=i;x>=0;x--)canti[x][j]++;
			}
			if(grid[i][j]=='O'){
				for(int x=j;x>=0;x--)canto[i][x]++;
			}
		}
	}
	int n=v.size();
	long long int sol=0;
	for(int j=0;j<n;j++){
		int x=v[j].first,y=v[j].second;
		sol+=canti[x][y]*canto[x][y];
	}
	cout<<sol<<'\n';
}
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 2 ms 492 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 2 ms 492 KB Output is correct
8 Correct 2 ms 492 KB Output is correct
9 Correct 2 ms 492 KB Output is correct
10 Correct 2 ms 492 KB Output is correct
11 Correct 2 ms 492 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 2 ms 640 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 2 ms 492 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 2 ms 492 KB Output is correct
8 Correct 2 ms 492 KB Output is correct
9 Correct 2 ms 492 KB Output is correct
10 Correct 2 ms 492 KB Output is correct
11 Correct 2 ms 492 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 2 ms 640 KB Output is correct
14 Correct 50 ms 2668 KB Output is correct
15 Correct 2 ms 364 KB Output is correct
16 Correct 20 ms 1900 KB Output is correct
17 Correct 1 ms 364 KB Output is correct
18 Correct 63 ms 3308 KB Output is correct
19 Correct 74 ms 2800 KB Output is correct
20 Correct 85 ms 3304 KB Output is correct
21 Correct 64 ms 3324 KB Output is correct
22 Correct 56 ms 3304 KB Output is correct
23 Correct 86 ms 3304 KB Output is correct
24 Correct 51 ms 3432 KB Output is correct
25 Correct 53 ms 2800 KB Output is correct
26 Correct 84 ms 3304 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Correct 1 ms 364 KB Output is correct
5 Correct 2 ms 492 KB Output is correct
6 Correct 1 ms 364 KB Output is correct
7 Correct 2 ms 492 KB Output is correct
8 Correct 2 ms 492 KB Output is correct
9 Correct 2 ms 492 KB Output is correct
10 Correct 2 ms 492 KB Output is correct
11 Correct 2 ms 492 KB Output is correct
12 Correct 1 ms 364 KB Output is correct
13 Correct 2 ms 640 KB Output is correct
14 Correct 50 ms 2668 KB Output is correct
15 Correct 2 ms 364 KB Output is correct
16 Correct 20 ms 1900 KB Output is correct
17 Correct 1 ms 364 KB Output is correct
18 Correct 63 ms 3308 KB Output is correct
19 Correct 74 ms 2800 KB Output is correct
20 Correct 85 ms 3304 KB Output is correct
21 Correct 64 ms 3324 KB Output is correct
22 Correct 56 ms 3304 KB Output is correct
23 Correct 86 ms 3304 KB Output is correct
24 Correct 51 ms 3432 KB Output is correct
25 Correct 53 ms 2800 KB Output is correct
26 Correct 84 ms 3304 KB Output is correct
27 Execution timed out 1084 ms 23264 KB Time limit exceeded
28 Halted 0 ms 0 KB -