답안 #96752

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
96752 2019-02-11T17:30:58 Z tpoppo Parametriziran (COCI19_parametriziran) C++14
0 / 110
3 ms 508 KB
#include <bits/stdc++.h>

using namespace std;
const int MAXN = 10;
const int MAXM = 6;


bitset<MAXN> v[MAXM][27];

string s[MAXN];
int n,m;
int rs;
bitset<MAXN> ones;
int main() {
    cin.tie(0);
    ios_base::sync_with_stdio(0);
    cin>>n>>m;
    for(int t=0;t<n;t++){
        cin>>s[t];
        for(int j = 0;j<m;j++){
            if(s[t][j] == '?'){
                for(int i=0;i<27;i++){
                    v[j][i][t] = 1;
                }
            }else{
                v[j][s[t][j] - 'a'][t] = 1;
            }
        }
    }
    for(int i=0;i<n;i++) ones[i] = 1;


    for(int i=0;i<n;i++){
        ones[i] = 0;
        bitset<MAXN> good = ones;


        for(int j=0;j<m;j++){
            if(s[i][j] == '?') continue;
            good &= v[j][s[i][j] - 'a'];
            //cout<<s[i]<<": "<<good<<" - "<<v[j][s[i][j] - 'a']<<endl;


        }
        rs += good.count();
    }

    cout<<rs;
    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 3 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 508 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 424 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Runtime error 2 ms 504 KB Execution killed with signal 11 (could be triggered by violating memory limits)
2 Halted 0 ms 0 KB -