이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
#define int long long int
#define inf 1e15
#define endl '\n';
using pii = pair<int,int>;
using piii = pair<int,pii>;
using piiii = pair<pii,pii>;
int mod = 1e9+7;
char grid[505][505];
int32_t main()
{
//freopen("file.in" , "r" , stdin);freopen("file.out" , "w" , stdout);
ios_base::sync_with_stdio(0);cin.tie(0);
int H, W;
cin >> H >> W;
for (int i = 0; i < H; i++)
for (int j = 0; j < W; j++)
cin >> grid[i][j];
int cnt = 0;
for (int i = 0; i < H; i++)
{
for (int j = 0; j < W; j++)
{
if (grid[i][j] == 'J')
{
for (int k = i + 1; k < H; k++)
{
for (int l = j + 1; l < W; l++)
{
if (grid[i][l] == 'O' && grid[k][j] == 'I')
{
cnt++;
}
}
}
}
}
}
cout << cnt << endl;
}
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |
| # | Verdict | Execution time | Memory | Grader output |
|---|
| Fetching results... |