중급 5

DAY4 중급 - 백준 10819번 (C++)

www.acmicpc.net/problem/10819 10819번: 차이를 최대로 첫째 줄에 N (3 ≤ N ≤ 8)이 주어진다. 둘째 줄에는 배열 A에 들어있는 정수가 주어진다. 배열에 들어있는 정수는 -100보다 크거나 같고, 100보다 작거나 같다. www.acmicpc.net #include #include using namespace std; int main() { int array[8] = {0}; int n; int sum = 0; int temp = 0; cin>>n; for(int i=0; i>array[i]; } sort(array,array+n); do { for(int i=0; i

DAY3 중급 - 백준 17287번 (C++)

www.acmicpc.net/problem/17287 17287번: The Deeper, The Better 대괄호, 중괄호, 소괄호와 0부터 9까지의 숫자로 이루어진 문자열 S가 주어진다. 문자열 S는 올바른 괄호 문자열에 숫자를 끼워 넣은 형태이고, 두 숫자가 서로 붙어있는 경우는 없다. 올바른 괄 www.acmicpc.net #include using namespace std; int main() { string s; int max = -1,sum = 0; cin>>s; for(int i=0; i= '0' && s[i] max) max = sum; } } cout

DAY2 중급 - 백준 13413번 (C++)

www.acmicpc.net/problem/13413 13413번: 오셀로 재배치 로봇을 좋아하는 세희는 로봇동아리에서 카메라와 센서, 라즈베리 파이, 집게발을 이용해 로봇을 완성하였다. 이 로봇을 통해서 오셀로 재배치라는 작업을 하려고 한다. 오셀로 말은 앞면이 검� www.acmicpc.net #include using namespace std; int main() { ios::sync_with_stdio(0); cin.tie(NULL); int t,n; string before; string after; int Wcount = 0; int Bcount = 0; cin>>t; while(t--) { cin>>n>>before>>after; for(int i=0; i Bcount) cout

DAY1 중급 - 백준 13699번 (C++)

www.acmicpc.net/problem/13699 13699번: 점화식 다음의 점화식에 의해 정의된 수열 t(n)을 생각하자: t(0)=1 t(n)=t(0)*t(n-1)+t(1)*t(n-2)+...+t(n-1)*t(0) 이 정의에 따르면, t(1)=t(0)*t(0)=1 t(2)=t(0)*t(1)+t(1)*t(0)=2 t(3)=t(0)*t(2)+t(1)*t(1)+t(2)*t(0)=5 ... 주어진 입력 0 ≤ n� www.acmicpc.net #include using namespace std; int main() { int n; long long array[36]; int left,right; long long temp = 0; array[0] = 1; array[1] = 1; cin>>n; for(..