#include #include #include #include using namespace std;long long cal(long long a, long long b, char op){ if(op == '+' ) return a+b; else if(op == '-') return a-b; else return a*b;}long long solution(string expression) { long long answer = 0; vectorv = {'*', '+', '-'}; vectornum; vectorop; string tmp = ""; for(int i=0; i= '0' && expression[i] num2 = num; ve..
문제링크 : https://www.acmicpc.net/problem/1063#include using namespace std;//R, L, B, T, RT, LT, RB, LBmap m = { {"R", 0}, {"L", 1}, {"B", 2}, {"T", 3}, {"RT", 4}, {"LT", 5}, {"RB", 6}, {"LB", 7}};int dy[] = {0, 0, -1, 1, 1, 1, -1, -1};int dx[] = {1, -1, 0, 0, 1, -1, 1, -1};int main(void){ ios_base::sync_with_stdio(false); cin.tie(0); string king, stone; int n; cin>> king >> st..
#include #include #include #include using namespace std;bool check(string tmp){ stackst; for(auto i : tmp) { if(i == '(') st.push(i); else { if(st.empty()) return false; //올바르지 않은 문자열 st.pop(); } } return st.empty();}string solution(string p) { string answer = ""; string u = "", v = ""; if(p.empty()) return p; // 조건 1 ..