답안 #206225

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
206225 2020-03-02T18:21:01 Z Haunted_Cpp Karte (COCI15_karte) C++17
50 / 50
5 ms 380 KB
#include <iostream>
#include <vector>
#include <map>
#include <cassert> 
#include <set> 

#define FOR(i, a, b) for(int i = a; i < (int) b; i++)
#define F0R(i, a) FOR (i, 0, a)
#define ROF(i, a, b) for(int i = a; i >= (int) b; i--)
#define R0F(i, a) ROF(i, a, 0)
#define GO(i, a) for (auto i : a)
 
#define eb emplace_back
#define sz(x) (int) x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define f first
#define s second
 
using namespace std;
 
typedef long long i64;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<pii> vpii;
typedef vector<vi> vvi;
typedef vector<vpii> vvpii;
typedef vector<i64> vi64;
 
const int dr[] = {+1, -1, +0, +0, +1, -1, -1, +1};
const int dc[] = {+0, +0, +1, -1, +1, -1, +1, -1};

/*
const int dc[] = {+2, +2, -2, -2, +1, -1, +1, -1};
const int dr[] = {+1, -1, +1, -1, +2, +2, -2, -2};
*/
 
//const int m[] = {+31, +29, +31, +30, +31, +30, +31, +31, +30, +31, +30, +31};

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string w;
  cin >> w;
  map< char, set<int> > cartas;
  F0R (i, sz(w)) {
    char suit = w[i];
    int number = stoi(w.substr (i + 1, 2));
    i += 2;
    if (cartas[suit].find(number)!= cartas[suit].end()) {
      cout << "GRESKA" << '\n';
      return 0;
    }
    cartas[suit].insert(number);
  }
  cout << 13 - sz(cartas['P']) << ' ';
  cout << 13 - sz(cartas['K']) << ' ';
  cout << 13 - sz(cartas['H']) << ' ';
  cout << 13 - sz(cartas['T']) << '\n';
  return 0;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 5 ms 376 KB Output is correct
6 Correct 5 ms 380 KB Output is correct
7 Correct 5 ms 376 KB Output is correct
8 Correct 5 ms 376 KB Output is correct
9 Correct 5 ms 376 KB Output is correct
10 Correct 5 ms 376 KB Output is correct