#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define interface struct #define zx3f 1061109567 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 m_height, m_width; int ..
#include #include #include #include #include #include #include #include #include #include #include using namespace std; #define interface struct #define zx3f 1061109567 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 mn, cp; int earn[25][30..
#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; #define interface struct #define zx3f 1061109567 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, p, c; int where[505]..
#include using namespace std; typedef long long ll; typedef pair pii; const int NOTHING = 0; const int ALLWHIT = 1; const int ALLBLUE = 2; const int WHITEPA = 0; const int BLUEPAI = 1; int n; // board[y][x] int board[1030][1030]; int ansWhite = 0; int ansBlue = 0; int allSomeThing(int stX , int stY , int edX , int edY){ bool allWhite = true; bool allBlue = true; for(int i = stY;i
#include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pii; typedef vector vi; int dx[] = {0, 0, 1, -1}; int dy[] = {1, -1, 0, 0}; // 2진수로 visited int visited = 0; int height, width; string board[22]; int calc(int x, int y) { int ret = 0; for (int i = 0; i < 4; i++) { int nx = x + dx[i]; int ny = y + dy[i]..
#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}; string chars; bool used[15] = { 0, }; string madedStr = " "; int ables = 0; void dfs(int step) { if (step == chars.size()) { ables++; return; } for (int i = 0; i < chars.size(); i++) { // 사용되었으면 ..
#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi_i; int main(){ cin.tie(0); cout.tie(0); int chuCount[6]; int n , cnt = 0; cin >> chuCount[0] >> chuCount[1] >> chuCount[2] >> chuCount[3] >> chuCount[4] >> n; int chuWei[] = {1,2,4,8,16}; for(int i = 4;i >= 0;i--){ while(n >= chuWei[i] && chuCount[i] > 0){ n -= chuWe..
#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi_i; struct Student{ string name; int like_percent; int idx; bool operator rhs.like_percent; } }; int n ..
#include #include #include #include #include #include #include #include using namespace std; typedef long long ll; typedef pair pi_i; int n; int arr[500005] , finalCopyArr[500005]; void mergeSort(int* arr , int st , int ed){ if(st >= ed) return; int mid = (st + ed) / 2; mergeSort(arr , st , mid); mergeSort(arr, mid + 1 , ed); int i = st, j = mid + 1, k = st; while (i