# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
942476 | 2024-03-10T17:22:50 Z | vjudge1 | Anagramistica (COCI21_anagramistica) | C++17 | 1000 ms | 460 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
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 348 KB | Output is correct |
3 | Correct | 3 ms | 456 KB | Output is correct |
4 | Correct | 6 ms | 348 KB | Output is correct |
5 | Correct | 12 ms | 460 KB | Output is correct |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Execution timed out | 1060 ms | 348 KB | Time limit exceeded |
2 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 1 ms | 348 KB | Output is correct |
2 | Correct | 2 ms | 348 KB | Output is correct |
3 | Correct | 3 ms | 456 KB | Output is correct |
4 | Correct | 6 ms | 348 KB | Output is correct |
5 | Correct | 12 ms | 460 KB | Output is correct |
6 | Execution timed out | 1060 ms | 348 KB | Time limit exceeded |
7 | Halted | 0 ms | 0 KB | - |