# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
942474 | 2024-03-10T17:22:00 Z | vjudge1 | Anagramistica (COCI21_anagramistica) | C++17 | 1000 ms | 604 KB |
#include "bits/stdc++.h" using namespace std; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); long long n, m; cin>>n>>m; vector<string> s(n); for(long long i = 0; i < n; i++){ cin>>s[i]; sort(s[i].begin(), s[i].end()); } long long Contador = 0; for(long long i = 0; i <= (1LL<<n); i++){ long long Flecha = 0; long long Pares = 0; bool Continuar = 1; for(long long aaa = 0; aaa <= n + 2; aaa++) if(i == (1LL<<aaa)){ Continuar = 0; break; } if(i != 0 and Continuar){ vector<string> Verificar; for(long long j = 0; j < n; j++){ if(i & (1LL<<Flecha)) Verificar.push_back(s[j]); Flecha++; } for(long long j = 0; j < Verificar.size() - 1; j++){ for(long long k = j + 1; k < Verificar.size(); k++){ if(Verificar[j] == Verificar[k]) Pares++; } } } if(Pares == m) Contador++; } cout<<Contador; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 604 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1045 ms | 348 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Incorrect | 1 ms | 604 KB | Output isn't correct |
2 | Halted | 0 ms | 0 KB | - |