Submission #915269

# Submission time Handle Problem Language Result Execution time Memory
915269 2024-01-23T15:19:37 Z jpfr12 Karte (COCI15_karte) C++14
50 / 50
1 ms 456 KB
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <string>
#include <map>
#include <math.h>
#include <cmath>
#include <climits>
#include <unordered_map>
#include <unordered_set>
#include <assert.h>
#include <fstream>
#include <bitset>
#include <iomanip>
 
typedef long long ll;
using namespace std;
int MOD = (int)1e9;
int MAXN = 1e6;
 
//classes

 
 
//global
map<char, set<string>> Map;

int main(){
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  //ifstream fin("input.txt");
  //ofstream fout("output.txt");
  //stop
  string s;
  cin >> s;
  bool rep = false;
  int n = s.length();
  for(int i = 0; i < n; i += 3){
    char c = s[i];
    string str = s.substr(i+1, 2);
    if(Map[c].count(str)){
      cout << "GRESKA\n";
      return 0;
    }
    Map[c].insert(str);
  }
  string str = "PKHT";
  for(char& i: str){
    cout << 13 - Map[i].size() << " ";
  }
  cout << '\n';
  return 0;
}

Compilation message

karte.cpp: In function 'int main()':
karte.cpp:40:8: warning: unused variable 'rep' [-Wunused-variable]
   40 |   bool rep = false;
      |        ^~~
# Verdict Execution time Memory Grader output
1 Correct 0 ms 344 KB Output is correct
2 Correct 1 ms 348 KB Output is correct
3 Correct 1 ms 348 KB Output is correct
4 Correct 0 ms 456 KB Output is correct
5 Correct 0 ms 348 KB Output is correct
6 Correct 0 ms 348 KB Output is correct
7 Correct 1 ms 344 KB Output is correct
8 Correct 0 ms 348 KB Output is correct
9 Correct 0 ms 348 KB Output is correct
10 Correct 1 ms 344 KB Output is correct