Submission #168487

#TimeUsernameProblemLanguageResultExecution timeMemory
168487RiscadoAParametriziran (COCI19_parametriziran)C++14
11 / 110
3055 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 + 1]; for (int i = 0; i < N; ++i) { // Read input O(NM) scanf("%s", words[i]); } // 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; }

Compilation message (stderr)

parametriziran.cpp: In function 'int main()':
parametriziran.cpp:17:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", words[i]);
   ~~~~~^~~~~~~~~~~~~~~~
#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...