답안 #42718

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
42718 2018-03-03T05:25:01 Z theknife2001 Karte (COCI15_karte) C++14
50 / 50
2 ms 704 KB
#include <bits/stdc++.h>


using namespace std;
string s;
set<pair<char  , string> > st;
map <char , int >mp;

int main()
{
    cin>>s;
    int n=s.size();
    char c;
    string t;
    for(int i=0;i<n;i+=3)
    {
        c=s[i];
        t="";
        t.push_back(s[i+1]);
        t.push_back(s[i+2]);
        if(st.find({c,t})!=st.end())
        {
            cout<<"GRESKA"<<endl;
            return 0;
        }
        st.insert({c,t});
        mp[c]++;
    }
    cout<<13-mp['P']<<' '<<13-mp['K']<<' '<<13-mp['H']<<' '<<13-mp['T']<<endl;

    return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 248 KB Output is correct
2 Correct 1 ms 356 KB Output is correct
3 Correct 2 ms 464 KB Output is correct
4 Correct 1 ms 572 KB Output is correct
5 Correct 1 ms 680 KB Output is correct
6 Correct 1 ms 680 KB Output is correct
7 Correct 1 ms 704 KB Output is correct
8 Correct 1 ms 704 KB Output is correct
9 Correct 1 ms 704 KB Output is correct
10 Correct 1 ms 704 KB Output is correct