SWEA
-
[SWEA - 9850] 의자 제공하기SWexpertAcademy 2020. 4. 28. 03:04
https://swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AXGBRbxaP7sDFAXR&categoryId=AXGBRbxaP7sDFAXR&categoryType=CODE SW Expert Academy SW 프로그래밍 역량 강화에 도움이 되는 다양한 학습 컨텐츠를 확인하세요! swexpertacademy.com 진짜.. 많이 틀린 문제인데.. 일단 아이디어부터 얘기해보도록 하자.. 1. 일단 데이터의 수가 많은 점을 착안하자 2. 의자는 어찌되었든 주어진 숫자에 따라 앉는것이 룰이다. 3. 그렇다면, 제일 좁은 구역에 앉을 놈들을 먼저 앉히는게 좋지않을까? 이제 착안할 점은 앉히는 기준을 생각해내는 것이다. 1~ a, b ~..
-
-
[모의 SW 역량테스트] 탈주범 검거SWexpertAcademy 2019. 9. 29. 21:49
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 #include #include #include #include using namespace std; int tc,n,m,R,C,L; int map[51][51]; int d[51][51]; bool dist[51][51]; int dx[8][4] = {{0,0,0,0}, {0,0,1,-1},..
-
1949. [모의 SW 역량테스트] 등산로 조성SWexpertAcademy 2019. 9. 5. 21:08
정말 많이틀렸다.. 틀린이유는 딱한가지였는데... BFS할땐 기똥차게잘하면서 왜 맨날 DFS나 백트래킹할때는 시작포인트를 체킹안하는질모르겠다.. #include #include #include using namespace std; int tc,n,m; int map[10][10]; bool d[10][10]; int ans = 0; int dx[] = { 0,0,1,-1 }; int dy[] = { 1,-1,0,0 }; bool check(int x, int y, int cnt) { for (int i = 0; i = 0 && nx = 0 && ny < n) { if (d[nx]..
-
6731. 홍익이의 오델로 게임SWexpertAcademy 2019. 8. 13. 22:14
#include #include #include using namespace std; int tc; int n; char map[1000][1000]; int ans; int main(){ ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL); cin>>tc; for(int t = 1; t>n; for(int i = 0; i >map[i][j]; if(map[i][j] == 'B'){ r[i]++; c[j]++; } } } for(int i = 0; i < n; i++){ for(int j = 0; j < n; j++){ int x = r[i] + c[j]; if(ma..
-
1226. [S/W 문제해결 기본] 7일차 - 미로1SWexpertAcademy 2019. 8. 13. 01:51
#include #include #include #include #include #include using namespace std; struct se{ int x,y; se(int x, int y){ this->x = x; this->y = y; } }; int map[17][17]; bool d[17][17]; se start = se(0,0); se endi = se(0,0); int dx[] = {0,0,1,-1}; int dy[] = {1,-1,0,0}; void bfs(int x, int y){ queue q; q.push({x,y}); d[x][y] = true; while(!q.empty()){ x = q.front().first; y = q.front().second; q.pop(); f..
-
6109. 추억의 2048게임SWexpertAcademy 2019. 8. 10. 00:13
#include #include #include #include #include #include #include using namespace std; int n; int map[21][21]; int temp[21][21]; bool f[21]; int ans = 0; int sum; void move(int dir) { if (dir == 1) {//down for (int i = 0; i = 0; k--) { if (map[k][i] != 0) { if (map[k][i]..