# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
491921 | student | Karte (COCI15_karte) | C++17 | 1 ms | 296 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <string>
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int main()
{
string cartas;
cin >> cartas;
int P=0;
int K=0;
int H=0;
int T=0;
for(int i=0; i<cartas.size(); i++){
if(cartas[i]=='P'){
P++;
}
if(cartas[i]=='K'){
K++;
}
if(cartas[i]=='H'){
H++;
}
if(cartas[i]=='T'){
T++;
}
}
bool iguales=false;
for(int j=0; j<cartas.size() ;j+=3){
vector<char>carta;
carta.push_back(cartas[j]);
carta.push_back(cartas[j+1]);
carta.push_back(cartas[j+2]);
for(int h=j+3; h<cartas.size() ;h+=3){
vector<char>carta2;
carta2.push_back(cartas[h]);
carta2.push_back(cartas[h+1]);
carta2.push_back(cartas[h+2]);
if(carta==carta2){
iguales=true;
}
}
}
if(iguales==true){
cout << "GRESKA" << endl;
}else{
cout << 13-P << " " << 13-K << " " << 13-H << " " << 13-T << endl;
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |