# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
198864 | ZwariowanyMarcin | Parametriziran (COCI19_parametriziran) | C++14 | 458 ms | 1888 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define fi first
#define se second
#define mp make_pair
#define ss(x) (int) x.size()
#define pb push_back
#define LL long long
#define ld long double
#define cat(x) cerr << #x << " = " << x << endl
#define FOR(i, j, n) for(int i = j; i <= n; ++i)
#define boost cin.tie(0), ios_base::sync_with_stdio(0);
using namespace std;
const int N = 50005;
bitset <N> b[6][26];
bitset <N> a, d;
int n, m;
char s[N][10];
int main() {
scanf ("%d%d", &n, &m);
for (int i = 0; i < n; ++i) {
scanf ("%s", s[i]);
for (int j = 0; j < m; ++j) {
if (s[i][j] == '?')
for (int c = 0; c < 26; ++c)
b[j][c][i] = 1;
else
b[j][s[i][j] - 'a'][i] = 1;
}
}
LL ans = 0;
for (int i = 0; i < n; ++i) d[i] = i;
for (int i = 0; i < n; ++i) {
d[i] = 0;
a.set();
a = (a & d);
for (int j = 0; j < m; ++j)
if (s[i][j] != '?')
a = (a & b[j][s[i][j] -'a']);
ans += a.count();
}
printf ("%lld", ans);
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |