제출 #1293912

#제출 시각아이디문제언어결과실행 시간메모리
1293912Aliyyiakbar괄호 문자열 (CEOI16_match)C++20
컴파일 에러
0 ms0 KiB
#ifndef ONLINE_JUDGE #include "AkbarKING.h" #else #define debug(...) #define debugArr(...) #define debugG(...) #endif #include <bits/stdc++.h> #include <ext/pb_ds/assoc_container.hpp> #include <ext/pb_ds/tree_policy.hpp> #include <ext/pb_ds/hash_policy.hpp> #define int long long #define $AzH_TxdmN$ ios_base::sync_with_stdio(0);cin.tie(nullptr);cout.tie(nullptr); #pragma GCC target("sse,sse2,sse3,ssse3,popcnt,abm,mmx,tune=native") #pragma GCC optimize("Ofast") #pragma GCC optimize("no-stack-protector") #pragma GCC optimize("unroll-loops") #pragma GCC optimize("fast-math") /* #define NaxcivanlilaraEkranKaydiAlmayaSonOnlardaInsanKimiKocureBilerlerVeSecmedeGCD100LeyeBilerler dp[1][1]; #define Aliyyakbar dp[i][j] #define MirrehimM dp[0][0] #define Xanlar dp[i-1][j] #define Elay dp[i][j-1] #define Rufo dp[i-1][j-1] #define Yusif dp[i+1][j] #define Sayad dp[i][j+1] #define Sumuraz dp[i+1][j+1] #define Cebrayil dp[i+1][j-1] #define Riyad dp[n][m] #define Huseyn dp[n-1][m] #define Zako dp[n][m-1] #define Abdulla dp[n-1][m-1] #define Subhan dp[n+1][m] #define Khadija dp[n+1][m] #define Sadiks dp[i+1][j-1] #define Others dp[i-1][j+1] */ #define ep emplace_back #define pb push_back #define pii pair<int,int> #define all(v) v.begin(),v.end() #define rall(v) v.rbegin(),v.rend() using namespace std; using namespace __gnu_pbds; template <typename T> using __indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>; template <typename T> using __indexed_multiset = tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>; mt19937_64 rng(chrono::steady_clock().now().time_since_epoch().count()); const int sz = 3e5 + 9; const int LOG = 63; const int MOD = 1e9 + 7; const int INF = 1e18; int n; string s, res; bool dfs(int l, int r) { if (l == r) { return 0; } if (l > r) { return 1; } if (s[l] == s[r]) { res[l] = '('; res[r] = ')'; return dfs(l + 1, r - 1); } stack<char> st; for (int i = r; i > l; --i) { if (st.empty() || st.top() != s[i]) { st.push(s[i]); } else { st.pop(); if (st.empty() && s[i - 1] == s[l]) { res[l] = '('; res[i - 1] = ')'; return dfs(l + 1, i - 2) && dfs(i, r); } } } return 0; } void solve() { cin >> s; n = s.size(); s = "#" + s; res = string(n + 1, '?'); cout << (dfs(1, n) ? res.substr(1) : "-1") << '\n'; } signed main() { $AzH_TxdmN$ int t = 1; // cin >> t; while (t--) { solve(); } }

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

match.cpp:2:10: fatal error: AkbarKING.h: No such file or directory
    2 | #include "AkbarKING.h"
      |          ^~~~~~~~~~~~~
compilation terminated.