Skip to content

Instantly share code, notes, and snippets.

🐢
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 / boj14503.cpp
Created Apr 30, 2020
[PS][기출문제][삼성]/[BOJ][14503][로봇청소기]
View boj14503.cpp
#include <iostream>
using namespace std;
int n, m, dir;
int map[50][50];
bool visited[50][50];
int dx[4] = { -1, 0, 1 , 0 };
int dy[4] = { 0,1,0,-1 };
int nextDir[4] = { 3,0,1,2 };
pair<int, int> curr;
@niklasjang
niklasjang / boj14890.cpp
Created Apr 27, 2020
[PS][기출문제][삼성]/[BOJ][14890][경사로]
View boj14890.cpp
#include <iostream>
using namespace std;
int n, l, ans = 0, i, j, cnt;
int map[200][100];
int main(void) {
cin >> n >> l;
for (i = 0; i < n; i++)
for (j = 0; j < n; j++)
cin >> map[i][j];
@niklasjang
niklasjang / boj16234.cpp
Created Apr 26, 2020
[PS][기출문제][삼성]/[BOJ][16234][인구이동]
View boj16234.cpp
#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 Apr 26, 2020
[PS][기출문제][삼성]/[BOJ][14889][스타트와 링크]
View boj14889.cpp
#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 Apr 26, 2020
[PS][기출문제][삼성]/[BOJ][16236][아기 상어]
View boj16236.cpp
#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 Apr 26, 2020
[PS][기출문제][삼성]/[BOJ][16235][나무 재테크]
View boj16235.cpp
#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 Apr 26, 2020
[PS][시뮬레이션][이동시키기]/[BOJ][17143][낚시왕]
View boj17143.cpp
//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 Apr 24, 2020
[PS][기출문제][삼성]/[BOJ][17140][이차원 배열과 연산]
View boj17140.cpp
#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 Apr 23, 2020
[PS][기출문제][삼성]/[BOJ][17825][주사위 윷놀이]
View boj17825.cpp
#include <iostream>
#include <vector>
#include <queue>
using namespace std;
class HORSE {
public:
int pos;
HORSE() {
pos = 0;
@niklasjang
niklasjang / boj10816.cpp
Created Apr 19, 2020
[PS][이분탐색]/[BOJ][10816][숫자 카드2]
View boj10816.cpp
#include <iostream>
#include <algorithm>
using namespace std;
int n,m,t;
int card[500000];
int s, e, mid;
int maxRight, minLeft;
int main(void) {
You can’t perform that action at this time.