Submission #232486

# Submission time Handle Problem Language Result Execution time Memory
232486 2020-05-17T07:30:11 Z NONAME Parametriziran (COCI19_parametriziran) C++17
11 / 110
3000 ms 3840 KB
#include <bits/stdc++.h>
#define sz(x) int(x.size())
#define in(x) freopen(x, "r", stdin)
#define out(x) freopen(x, "w", stdout)
#define N 100500
#define oo ll(1e16)
#define ft first
#define sd second
#define mp make_pair
#define pb push_back
#define ppb pop_back
#define el '\n'
#define elf endl
#define base ll(1e9 + 7)
using namespace std;
typedef long long ll;
typedef long double ld;

int n, m, ans;
string s[N];

int main() {
    ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);

//    in("input.txt");

    cin >> n >> m;
    for (int i = 0; i < n; i++)
        cin >> s[i];

    for (int i = 0; i < n; i++)
    for (int j = i + 1; j < n; j++) {
        bool f = 1;

        for (int t = 0; t < m; t++)
            if (s[i][t] != '?' && s[j][t] != '?')
                f &= (s[i][t] == s[j][t]);

        ans += f;
    }

    cout << ans;
}
# Verdict Execution time Memory Grader output
1 Correct 2308 ms 3628 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2986 ms 3704 KB Output is correct
2 Execution timed out 3075 ms 3584 KB Time limit exceeded
# Verdict Execution time Memory Grader output
1 Execution timed out 3085 ms 3584 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3058 ms 3584 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3076 ms 3712 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3088 ms 3712 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3069 ms 3712 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3090 ms 3712 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3079 ms 3712 KB Time limit exceeded
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Execution timed out 3082 ms 3840 KB Time limit exceeded
2 Halted 0 ms 0 KB -