# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
207814 | DodgeBallMan | Bitaro the Brave (JOI19_ho_t1) | C++14 | 679 ms | 75184 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pii pair<int, int>
#define x first
#define y second
using namespace std;
const int N = 3010;
vector<pii> coord;
int h, w;
vector<int> o[N], in[N];
long long ans;
int main()
{
scanf("%d %d",&h,&w);
for( int i = 0 ; i < h ; i++ ) {
char arr[N];
scanf("%s",arr);
for( int j = 0 ; j < w ; j++ ) {
if( arr[j] == 'J' ) coord.emplace_back( pii( i, j ) );
else if( arr[j] == 'O' ) o[i].emplace_back( j );
else if( arr[j] == 'I' ) in[j].emplace_back( i );
}
}
for( pii i : coord ) {
int idx = upper_bound( o[i.x].begin(), o[i.x].end(), i.y ) - o[i.x].begin();
int idx2 = upper_bound( in[i.y].begin(), in[i.y].end(), i.x ) - in[i.y].begin();
ans += ( long long )( ( ( int )o[i.x].size() - idx ) * ( ( int )in[i.y].size() - idx2 ) );
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |