문제링크 : https://www.acmicpc.net/problem/12849#include using namespace std;const int MOD = 1000000007;long long dp[8], arr[8];//정보, 전산, 신양, 진리, 학생, 형남, 환경, 미래int main() { int D; cin >> D; dp[0] = 1; // 정보과학관에서 시작 while (D--) { arr[0] = dp[1] + dp[7]; // 정보 - 전산, 미래 arr[1] = dp[0] + dp[2] + dp[7]; // 전산 - 정보, 신양, 미래 arr[2] = dp[1] + dp[3] + dp[6] + dp[7]..
문제링크 : https://www.acmicpc.net/problem/10422#include using namespace std;typedef long long ll;#define MOD 1000000007long long arr[5001];int main() { ios::sync_with_stdio(false); cin.tie(NULL); int T, N; cin >> T; arr[0]=1; //빈 문자열 for(int i=2; i> N; cout 우선 올바른 괄호 문자열은 특성상 짝수만 가능하다.그리고 구역을 2개 나눠서 생각할 필요가 있다.일단 간단하게 초기값을 알아보면 다음과 같다.N = 2()N = 4()(), (()) N = 4인 케이스를 보면,..
#include #include #include #include using namespace std;int getTime(string time){ return stoi(time.substr(0, 2)) * 60 + stoi(time.substr(3, 2));}bool cmp(vectora, vectorb){ return a[1] solution(vector> plans) { vector answer; stack>pause; sort(plans.begin(), plans.end(), cmp); for(int i=0; i=playtime) { answer.push_back(name); //과제 수행 rema..