| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 | 
|---|---|---|---|---|---|---|---|
| 851850 | LBP139 | Karte (COCI15_karte) | C++17 | 1 ms | 428 KiB | 
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<iostream>
#include<algorithm>
#include<set>
using namespace std;
int main(){
    string S;
    cin>>S;
    set<int>P;
    set<int>K;
    set<int>H;
    set<int>T;
    int r=0;
    while(r<S.size()){
        if(S[r]=='P'){
            if(S[r+1]=='0'){
                string a;
                a.push_back(S[r+2]);
                int b=stoi(a);
                if(P.find(b)!=P.end()){
                    cout<<"GRESKA"<<endl;
                    r=0;
                    break;
                }
                else{
                P.insert(b);
                }
            }
            else{
                string a;
                a.push_back(S[r+1]);
                a.push_back(S[r+2]);
                int b=stoi(a);
                  if(P.find(b)!=P.end()){
                    cout<<"GRESKA"<<endl;
                    r=0;
                    break;
                }
                else{
                P.insert(b);
                }
            }
        }
        if(S[r]=='K'){
            if(S[r+1]=='0'){
                string g;
                g.push_back(S[r+2]);
                int h=stoi(g);
                if(K.find(h)!=K.end()){
                    cout<<"GRESKA"<<endl;
                    r=0;
                    break;
                }
                else{
                K.insert(h);
                }
            }
            else{
                string g;
                g.push_back(S[r+1]);
                g.push_back(S[r+2]);
                int h=stoi(g);
                if(K.find(h)!=K.end()){
                    cout<<"GRESKA"<<endl;
                    r=0;
                    break;
                }
                else{
                K.insert(h);
                }
            }
        }
        if(S[r]=='H'){
            if(S[r+1]=='0'){
                string e;
                e.push_back(S[r+2]);
                int f=stoi(e);
                if(H.find(f)!=H.end()){
                    cout<<"GRESKA"<<endl;
                    r=0;
                    break;
                }
                else{
                H.insert(f);
                }
            }
            else{
                string e;
                e.push_back(S[r+1]);
                e.push_back(S[r+2]);
                int f=stoi(e);
                     if(H.find(f)!=H.end()){
                    cout<<"GRESKA"<<endl;
                    r=0;
                    break;
                }
                else{
                H.insert(f);
                }
            }
        }
        if(S[r]=='T'){
            if(S[r+1]=='0'){
                string c;
                c.push_back(S[r+2]);
                int d=stoi(c);
                if(T.find(d)!=T.end()){
                    cout<<"GRESKA"<<endl;
                    r=0;
                    break;
                }
                else{
                T.insert(d);
                }
            }
            else{
                string c;
                c.push_back(S[r+1]);
                c.push_back(S[r+2]);
                int d=stoi(c);
                   if(T.find(d)!=T.end()){
                    cout<<"GRESKA"<<endl;
                    r=0;
                    break;
                }
                else{
                T.insert(d);
                }
            }
        }
        r=r+3;
    }
    if(r>=S.size()){
        cout<<13-P.size()<<" "<<13-K.size()<<" "<<13-H.size()<<" "<<13-T.size()<<endl;
    }
}
컴파일 시 표준 에러 (stderr) 메시지
| # | Verdict | Execution time | Memory | Grader output | 
|---|---|---|---|---|
| Fetching results... | ||||
