최근 글
[정올] 2641 / 택배

#include using namespace std; bool func(pair a, pair b) { if (a.first.second > N >> C >> M; for (int i = 0; i > arr[i].first.first >> arr[i].first.second >> arr[i].second;..

[정올] 2614 / [백준] 7577 / 탐사

/* s ~ e 까지 n개가 있다고 알려줌 못 만들면 NONE을 출력 or - 는 없음 # 은 있음으로 출력 */ #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long ull; typedef pair pii; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; int k, n; struct Path { int from; int to; int need; }; vector paths; ll dist[45]; int main() { ..

[정올] 2606 / [백준] 7576 / 토마토(초)

#include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long ull; typedef pair pii; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; int m, n, h; int board[105][105][105]; bool visited[105][105][105]; struct XYZ_MC { int x; int y; int h; }; XYZ_MC dxyz[] = { {1, 0, 0}, {0, 1, 0}, {0, 0, 1}, {-1, 0, 0}, {0, -1..

[정올] 2584 / [백준] 2515 / 전시장

#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long ull; typedef pair pii; typedef signed char i8; typedef short i16; typedef int i32; typedef long long i64; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; int dp[300010]; int picture_last[300010]; bool cmp(pair a, pair b) { if (a.f..

[정올] 2543 / 타일 채우기

#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pii; int dx[] = {0 , 0 , 1 , -1}; int dy[] = {1 , -1 , 0 , 0}; int board[515][515]; int n; /* 1 0 1 1 1 2 2 0 2 2 3 3 3 0 3 4 4 4 4 0 */ enum BS{ LT = 1, RT = 2, LB = 3, RB = 4, EMPTY = 0 }; struct x{ int first; int second; }; x set_[5][3] = { { {-1,-1..

[정올] 2500 / [백준] 2449 / 전구

#include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef unsigned long ull; typedef pair pii; typedef signed char i8; typedef short i16; typedef int i32; typedef long long i64; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; int n, k; int light_color[205]; // dp[p1][p2] = p1 ~ p2 까지 몇번 바꿔야 하는지. int d..

[정올] 2499 / [백준] 2437 / 저울

#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi_i; int n; int wei[1005]; int main(){ cin.tie(0); cout.tie(0); cin >> n; for(int i = 0;i > wei[i]; sort(wei,wei+n); if(wei[0] != 1) { cout = wei[i];i++){ ans += wei[i]; } cout

[정올] 2462 / [백준] 2458 / 키 순서

#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi_i; const int MAXN = 500, MAXM = 124750; int n , m; vector paths[MAXN + 5]; bool visited[MAXN + 5]; int startPT = 0; int howManyCanConnect[MAXN + 5]; void dfs(int now){ if(now != startPT) { // 한번이라도 움직임 howManyCanConnect[startPT]++; howManyCanConnect[now]++; } for(aut..

[정올] 2461 / [백준] 2457 / 공주님의 정원

#include #include #include #include #include #include using namespace std; bool debug = false; bool print_end_msg = false || debug; bool print_in_l74 = false || debug; bool print_flowers = false || debug; bool sort_func(pair a, pair b) { if (a.first == b.first) return a.second > n; for (int i = 0; i < n; i++) { int s1, s2..