Submission #168484

#TimeUsernameProblemLanguageResultExecution timeMemory
168484RiscadoAParametriziran (COCI19_parametriziran)C++14
11 / 110
3088 ms888 KiB
#include <bits/stdc++.h> using namespace std; const int MAX_N = 50000; const int MAX_M = 6; int N, M; int main() { cin >> N >> M; int c = 0; char words[MAX_N][MAX_M]; for (int i = 0; i < N; ++i) { // Read input O(NM) for (int j = 0; j < M; ++j) { cin >> words[i][j]; } } // For every pair (a, b) - O(N^2 * M) for (int i = 0; i < N; ++i) { for (int j = i + 1; j < N; ++j) { int valid = 1; for (int k = 0; k < M; ++k) { if (words[i][k] == '?' || words[j][k] == '?') continue; if (words[i][k] != words[j][k]) { valid = 0; break; } } c += valid; } } cout << c; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...