# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
942476 | vjudge1 | Anagramistica (COCI21_anagramistica) | C++17 | 1060 ms | 460 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |