This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<vector> | |
using namespace std; | |
//벡터 출력 | |
void print(vector<int> v) | |
{ | |
if (v.empty())//empty | |
{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<algorithm> | |
#define SIZE 1000 | |
using namespace std; | |
void Merge(int arr[], int l, int r) | |
{ | |
int temp[SIZE]; | |
int mid = (l + r) / 2; | |
int i = l; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//최대 힙(max heap) | |
#include<iostream> | |
#include<vector> | |
using namespace std; | |
void swap(int& a, int& b); | |
void insertnode(vector<int>& heap, int data); //추가 | |
int deletenode(vector<int>& heap); //삭제 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string> | |
#include<algorithm> | |
#define MAX 1001 | |
#define ADD 'a' | |
#define DEL 'd' | |
#define MOD 'm' | |
#define COPY 'c' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#define MAX 17000000 | |
#define CITY 16 | |
using namespace std; | |
int n; | |
int arr[CITY][CITY]; | |
int d[1 << CITY][CITY] = { 0 }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
using namespace std; | |
void SWAP(int arr[], int a, int b) | |
{ | |
int temp = arr[a]; | |
arr[a] = arr[b]; | |
arr[b] = temp; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<queue> | |
using namespace std; | |
int main() | |
{ | |
priority_queue<int> max_heap; | |
int n, temp; | |
cin >> n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int solve() | |
{ | |
int n; | |
cin >> n; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<iostream> | |
#include<string.h> | |
using namespace std; | |
int main() | |
{ | |
int T; | |
cin >> T; | |
for (int testcase = 1; testcase <= T; testcase++) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <iostream> | |
#include <vector> | |
#include <algorithm> | |
#include <queue> | |
using namespace std; | |
pair<unsigned long long int, unsigned long long int> ans;//최소, 최대 | |
int k; |