출처 : https://www.hackerrank.com/challenges/compare-the-triplets/problem #include using namespace std; string ltrim(const string &);string rtrim(const string &);vector split(const string &); vector compareTriplets(vector a, vector b) { vector v(2); for(int i=0; ib[i]) v[0]++; else if(a[i]
출처 : https://www.hackerrank.com/challenges/solve-me-first/problem #include #include #include #include #include using namespace std; int solveMeFirst(int a, int b) { return a+b;} int main() { int num1, num2; int sum; cin>>num1>>num2; sum = solveMeFirst(num1,num2); cout
SW Expert Academy :: SWEA :: 5658 :: 보물상자 비밀번호 출처 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRUN9KfZ8DFAUo&categoryId=AWXRUN9KfZ8DFAUo&categoryType=CODE #include #include #include #include #include using namespace std; int N, K;string s; int main() {int T; cin >> T;for (int tc = 1; tc > N >> K;vectorv; int ans = 0;cin >> s; int tmp; for (int i = 0; i < ..
SW Expert Academy :: SWEA :: 5644 :: 무선 충전 출처 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRDL1aeugDFAUo #include #include #include #include using namespace std; struct BC {int x, y, c, p, n;}; int M, N, ans;int user[2][101];int dir[5][2] = { {0,0},{0,-1},{1,0},{0,1},{-1,0} };vector map; inline bool check(int x, int y, BC bc) { return bc.c >= ((abs(bc.x-x..
SW Expert Academy :: SWEA :: 5648 :: 원자 소멸 시뮬레이션 출처 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRFInKex8DFAUo&categoryId=AWXRFInKex8DFAUo&categoryType=CODE #include #include #include using namespace std; struct atom { int n, i, j, d, e; float c;}; int N, ans;vector v;vector ev; inline void check(atom n1, atom n2) {if (n1.d == 0) {if (n2.d == 1 && n1.j ==..
SW Expert Academy :: SWEA :: 5650 :: 핀볼게임 출처 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWXRF8s6ezEDFAUo #include using namespace std; struct S { int y, x, d; };int T, N, tc, ans, A[102][102], dy[] = { -1,0,1,0 }, dx[] = { 0,1,0,-1 },C[6][4] = { {},{2,3,1,0},{1,3,0,2},{3,2,0,1},{2,0,3,1},{2,3,0,1} }, D[5][5]; void G() {for (int i = 1; i T;while (T--) {cin ..
백준 :: BOJ :: 2468 :: 안전 영역 출처 : https://www.acmicpc.net/problem/2468 #include #include #include #include using namespace std; int N, maxH, cnt, ans;int map[100][100];bool visited[100][100];int dir[4][2] = { {-1,0},{0,1},{1,0},{0,-1} };queue q; inline bool check(int i, int j, int h) { return ((i>=0 && j>=0 && i> N; maxH = 0; ans = 1;for (int i = 0; i >..
백준 :: BOJ :: 2589 :: 보물섬 출처 : https://www.acmicpc.net/problem/2589 #include #include #include #include using namespace std; int N, M, ans;int map[50][50];int depth[50][50];bool visited[50][50];int dir[4][2] = { {-1,0},{0,1},{1,0},{0,-1} };queue q; inline bool check(int i, int j) { return ((i>=0 && j>=0 && i N >> M; ans = 0;char c;for (int i = 0; i > c..
알고리즘 문제에서 시간제한이 있다. 시간제한에 대해 자신의 코드가 최악의 경우에 몇 초정도 나오는지 시간함수를 통해정확히 알아낼 수도 있지만 대략 짐작을 빠르게 할 수 있다. 시간 복잡도 표기법에는 3개가 있다.빅오 표기법 : 알고리즘 실행시간의 상한오메가 표기법 : 알고리즘 실행시간의 하한세타 표기법 : 알고리즘 실행시간의 평균시간 먼저, 자신의 코드의 시간복잡도 빅오를 계산한다. 대부분의 코드가 n제곱이거나 n로그n인 경우가 많다.그 후 문제의 제한 범위를 고려하여 입력이 몇개 들어가는지 고려한다. 대략, n삼승의 알고리즘은 2560의 입력까지 1초 안에 풀 수 있다.n제곱의 알고리즘은 40960의 입력까지 1초 안에 풀 수 있다.n로그n의 알고리즘은 20,000,000의 입력까지 1초 안에 풀 수 ..
SW Expert Academy :: SWEA :: 5521 :: 상원이의 생일파티 출처 : https://www.swexpertacademy.com/main/code/problem/problemDetail.do?contestProbId=AWWO3kT6F2oDFAV4&categoryId=AWWO3kT6F2oDFAV4&categoryType=CODE #include #include using namespace std; int main() {int T; scanf("%d", &T);for (int tc = 1; tc > v(501);bool c[501] = { 0, }; c[1] = 1;while (M--) {scanf("%d %d", &a, &b); v[a].push_..
- Total
- Today
- Yesterday
- 새로운 게임 2
- 2018 카카오 블라인드 채용
- 백준
- 이차원 배열과 연산
- 2018 KAKAO BLIND RECRUITMENT
- SW Expert Academy
- 삼성
- scanf
- DP
- 17140
- hackerrank
- 17142
- DFS
- string
- boj
- 입출력
- SWEA
- 17143
- STL
- 17779
- 시간 복잡도
- 17837
- 역량 테스트
- 연구소 3
- 미세먼지 안녕!
- 팁
- 알고리즘
- 게리맨더링 2
- 트렌드
- 17144
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |