Skip to content

Instantly share code, notes, and snippets.

View niklasjang's full-sized avatar
🐢
Where there is a will, there is a way

NiklasJang niklasjang

🐢
Where there is a will, there is a way
View GitHub Profile
@niklasjang
niklasjang / boj16234.cpp
Created April 26, 2020 23:58
[PS][기출문제][삼성]/[BOJ][16234][인구이동]
#include <iostream>
#include <string.h>
#include <algorithm>
using namespace std;
int n,l,p;
int map[50][50];
int region[50][50];
int comp[2501]; // comp[i] : i번째 dfs의 연결요소 갯수
int people[2501]; //people[i] : i번째 dfs의 총 사람 수
@niklasjang
niklasjang / boj14889.cpp
Created April 26, 2020 07:31
[PS][기출문제][삼성]/[BOJ][14889][스타트와 링크]
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <queue>
using namespace std;
int n = 0;
int map[20][20];
int pointSum = 0;
@niklasjang
niklasjang / boj16236.cpp
Created April 26, 2020 05:30
[PS][기출문제][삼성]/[BOJ][16236][아기 상어]
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
#include <queue>
using namespace std;
int map[20][20];
int dmap[20][20];
bool visited[20][20];
@niklasjang
niklasjang / boj16235.cpp
Created April 26, 2020 03:20
[PS][기출문제][삼성]/[BOJ][16235][나무 재테크]
#include <iostream>
#include <vector>
#include <algorithm>
#include <string.h>
using namespace std;
int n, m, k;
vector<int> map[10][10];
bool visited[10][10];
int poo[10][10];
@niklasjang
niklasjang / boj17143.cpp
Created April 26, 2020 02:45
[PS][시뮬레이션][이동시키기]/[BOJ][17143][낚시왕]
//12시 49분 시작
#include <iostream>
#include <vector>
using namespace std;
struct shark{
int r,c,s,d,z;
shark(){
r = c = s = d = z = 0;
@niklasjang
niklasjang / boj17140.cpp
Created April 24, 2020 03:56
[PS][기출문제][삼성]/[BOJ][17140][이차원 배열과 연산]
#include <iostream>
#include <string.h>
#include <algorithm>
#include <vector>
using namespace std;
int r = 0, c = 0, k = 0;
int map[201][201];
int cnt[101];
int w =3, h = 3;
@niklasjang
niklasjang / boj17825.cpp
Created April 23, 2020 12:05
[PS][기출문제][삼성]/[BOJ][17825][주사위 윷놀이]
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class HORSE {
public:
int pos;
HORSE() {
pos = 0;
@niklasjang
niklasjang / boj10816.cpp
Created April 19, 2020 08:47
[PS][이분탐색]/[BOJ][10816][숫자 카드2]
#include <iostream>
#include <algorithm>
using namespace std;
int n,m,t;
int card[500000];
int s, e, mid;
int maxRight, minLeft;
int main(void) {
@niklasjang
niklasjang / boj10815.cpp
Created April 19, 2020 07:55
[PS][이분탐색]/[BOJ][10815][숫자 카드]
#include <iostream>
#include <algorithm>
using namespace std;
int n,m,t;
int card[500000];
int s, e, mid;
bool search(int x) {
return false;
@niklasjang
niklasjang / boj17451.cpp
Created April 19, 2020 03:12
[PS][그리디]/[BOJ][17451][평행 우주]
#include <iostream>
using namespace std;
int n;
int spd[300000];
int main(void) {
cin >> n;
int i = 0;
for (i = 0; i < n; i++) {
cin >> spd[i];