# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1086317 | kiethm07 | Bitaro the Brave (JOI19_ho_t1) | C++11 | 213 ms | 88512 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define pii pair<int,int>
#define iii pair<int,pii>
#define fi first
#define se second
#define vi vector<int>
#define all(x) x.begin(),x.end()
#define TEXT "a"
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ld;
const int inf = 1e9 + 7;
const ld eps = 1e-8;
const double pi = acos(-1);
const int N = 3005;
int n,m;
char a[N][N];
int row[N][N], col[N][N];
int main(){
cin.tie(0) -> sync_with_stdio(0);
if (fopen(TEXT".inp","r")){
freopen(TEXT".inp","r",stdin);
freopen(TEXT".out","w",stdout);
}
cin >> n >> m;
for (int i = 1; i <= n; i++){
for (int j = 1; j <= m; j++) cin >> a[i][j];
}
for (int i = 1; i <= n; i++){
for (int j = 1; j <= m; j++){
col[i][j] = col[i][j - 1] + (a[i][j] == 'O');
}
}
for (int j = 1; j <= m; j++){
for (int i = 1; i <= n; i++){
row[i][j] = row[i - 1][j] + (a[i][j] == 'I');
}
}
ll res = 0;
for (int i = 1; i <= n; i++){
for (int j = 1; j <= m; j++){
if (a[i][j] != 'J') continue;
ll x = row[n][j] - row[i][j];
ll y = col[i][m] - col[i][j];
res += x * y;
}
}
cout << res << "\n";
return 0;
}
컴파일 시 표준 에러 (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... |