본문 바로가기

algorithm/SW Expert Academy11

[모의 SW 역량테스트] 보호 필름 - 2112 문제 : https://swexpertacademy.com/main/learn/course/lectureProblemViewer.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : 1차시도 : 더보기 #include #include using namespace std; int arr[13][20] = { 0 }; int D, W, K; int result = 100; bool calc() { bool check = false; for (int i = 0; i < W; i++) { int count = 1; int temp = arr[0][i]; for (int j = 1; j < D; j++) { i.. 2020. 2. 2.
단순 2진 암호코드 - 1240 문제 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV15FZuqAL4CFAYD SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : #include #include #include //#include #include using namespace std; int num[50][100] = { 0 }; int v0[7] = { 0,0,0,1,1,0,1 }; int v1[7] = { 0,0,1,1,0,0,1 }; int v2[7] = { 0,0,1,0,0,1,1 }; int v3[7] = { 0,1,1,1,1,0,1.. 2020. 1. 11.
[2차원 배열 연습 문제] 달팽이 숫자 - 1954 문제 : https://swexpertacademy.com/main/learn/course/lectureProblemViewer.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : #include using namespace std; int main() { int T; cin >> T; int c = 0; while (c > N; int num[10][10] = { 0 }; int move[4][2] = { {0,1}, {1,0}, {0,-1}, {-1,0} }; int total = N * N; int i = 0; int j = 0; int m = 0; for (i.. 2020. 1. 8.
[2차원 배열 연습 문제] 스도쿠 검증 - 1974 문제 : https://swexpertacademy.com/main/learn/course/lectureProblemViewer.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : #include using namespace std; int num[9][9] = { 0 }; bool solution() { //가로행 탐색 for (int i = 0; i < 9; i++) { bool check[10] = { false }; for (int j = 0; j < 9; j++) { if (check[num[i][j]]) { return false; } check[num[i][j]] = true; } } /.. 2020. 1. 8.
[1차원 배열 연습 문제] View - 1206 문제 : https://swexpertacademy.com/main/learn/course/lectureProblemViewer.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : #include using namespace std; int num[1000] = { 0 }; int solution(int size) { int total = 0; for (int i = 2; i < size - 2; i++) { int max = 0; for (int c = -2; c < 3; c++) { if (c == 0) continue; if (max < num[i + c]) { max = num[i + c]; .. 2020. 1. 8.
[1차원 배열 연습 문제] 최빈수 구하기 - 1204 문제 : https://swexpertacademy.com/main/learn/course/lectureProblemViewer.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : #include using namespace std; int num[1000] = { 0 }; int solution(int max, int* check) { int index = 0; for (int i = 100; i >= 0; i--) { if (check[i] == max) { index = i; break; } } return index; } int main() { int N; cin >> N; int i = 0;.. 2020. 1. 8.
[모의 SW 역량테스트] 디저트 카페 - 2105 문제 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5VwAr6APYDFAWu SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : #include #include using namespace std; int N; int num[20][20] = { 0 }; int maxValue = 0; bool Arround_arr(int i, int j) { if ((i = N) || (j = N)) return false; return true; } void solution(int i.. 2020. 1. 7.
[모의 SW 역량테스트] 점심 식사시간- 2383 문제 : https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AV5-BEE6AK0DFAVl SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : 더보기 #include #include #include #include #include #include using namespace std; class Person { public: int key; //배열 인덱스 int x, y; // 사람좌표 int aStairs, bStairs; // 각각의 계단입구까지 걸리는 시간 int enter; // 선택된 계단 입구 int lowCo.. 2019. 12. 28.
[모의 SW 역량테스트] 등산로 조성 - 1949 문제 : https://swexpertacademy.com/main/code/problem/problemDetail.do SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 코드 : #include #include using namespace std; int N, K = 0; int num[8][8] = { 0 }; vector temp; bool check[8][8] = { false }; int maxCount = 0; bool indexCheck = true; int arr[4][2] = { {-1,0}, {0, -1}, {0, 1}, {1,0} }; // count =방문길이 , i= 행 , j = 가로 ,.. 2019. 12. 23.