제출 #1229367

#제출 시각아이디문제언어결과실행 시간메모리
1229367PlayVoltzKarte (COCI15_karte)C++20
컴파일 에러
0 ms0 KiB
#include <cstdio> #include <stdio.h> #include <stdbool.h> #include <iostream> #include <map> #include <vector> #include <climits> #include <stack> #include <string> #include <queue> #include <algorithm> #include <set> #include <unordered_set> #include <unordered_map> #include <cmath> #include <cctype> #include <bitset> #include <iomanip> #include <cstring> #include <numeric> #include <cassert> #include <random> #include <chrono> #include <fstream> using namespace std; #define int long long #define pii pair<int, int> #define mp make_pair #define pb push_back #define fi first #define se second int32_t main(){ ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0); string s; cin>>s; map<string, bool> got; map<char, int> c; c['P']=c['K']=c['H']=c['T']=13; for (int i=0; i<s.size(); i+=3){ string a = s[i]+s[i+1]+s[i+2]; if (got[a]){ cout<<"GRESKA"; return 0; } --c[s[i]]; } cout<<c['P']<<" "<<c['K']<<" "<<c['H']<<" "<<c['T']; }

컴파일 시 표준 에러 (stderr) 메시지

karte.cpp: In function 'int32_t main()':
karte.cpp:44:39: error: conversion from 'int' to non-scalar type 'std::string' {aka 'std::__cxx11::basic_string<char>'} requested
   44 |                 string a = s[i]+s[i+1]+s[i+2];