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