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 <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
const int MAX = 1000005; | |
ll mini, maxi; | |
bool visited[MAX]; | |
int main() {ios_base::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL); |
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> | |
#include <vector> | |
using namespace std; | |
const int MAX_V = 52; // 알파벳 대,소문자 총 52 개 | |
const int INF = 1000000000; | |
// 알파벳 -> 숫자 변환 | |
int CtoI(char c) { | |
// index: 대문자 = 0~25 , 소문자 = 26~51 |
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 <bits/stdc++.h> | |
using namespace std; | |
int N, M; | |
// company[x][k] : x 회사에 k원 투자할 때 얻는 가치 | |
int company[22][333]; | |
// dp[x][k] : x 까지 회사에서 k원으로 얻을 수 있는 최대 가치 | |
int dp[22][333]; | |
// 각 기업 투자 액수 추적할 배열 | |
// path[x][k] : dp[x][k]를 최대로 만드는 x에서 투자한 금액 |
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 <bits/stdc++.h> | |
using namespace std; | |
const int MAX = 200; | |
int N; | |
// triangle[k] : 사이즈 k 인 사면체 만들 때 필요한 대포알 수 | |
// MAX=200 : 200개 정도 잡아놓으면 3*10^5 보다 한참 크다 | |
int triangle[MAX]; | |
// dp[x] : x 개의 대포알로 만드는 최소 사면체 개수 | |
int dp[300005]; |
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 <bits/stdc++.h> | |
using namespace std; | |
// 오름차순 으로 더해져야 한다고 생각 | |
// 즉 1+2+4 = 1+4+2 | |
typedef long long ll; | |
const ll MOD = 1000000000; | |
const int MAX = 1000005; | |
int N; | |
// dp[x][k] : x 수, 2^k 로 끝나는 멱수의 합 개수 |
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 <bits/stdc++.h> | |
using namespace std; | |
int a, b, c; | |
// dp[x][y][z] : a=x, b=y, c=z 인 상태에서의 함수 값 | |
int dp[55][55][55]; | |
int DP(int x, int y, int z) { | |
if (x <= 0 || y <= 0 || z <= 0) return 1; |
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 <bits/stdc++.h> | |
using namespace std; | |
const int MAX = 5005; | |
int N; | |
int arr[MAX]; | |
// dp[i][j] : i,j 를 양 끝으로 하는 펠린드롬 만드는 데 필요한 최소 개수 | |
int dp[MAX][MAX]; | |
int palin(int s, int e) { |
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 <bits/stdc++.h> | |
using namespace std; | |
string S; | |
int N; | |
vector<string> arr[26]; // S[t] : 글자 t 로 끝나는 단어들 | |
bool dp[111]; // dp[x] : x ~ 끝까지 채울 수 있는지 여부 | |
int main() {ios_base::sync_with_stdio(false); cout.tie(NULL); cin.tie(NULL); |
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 <bits/stdc++.h> | |
using namespace std; | |
typedef long long ll; | |
const int MAX = 100005; | |
int N; | |
int arr[MAX]; | |
ll R; // 정답 | |
void Rev() { // 투 포인터 |
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 <bits/stdc++.h> | |
using namespace std; | |
typedef pair<int, int> pii; | |
// tp< 거리, 노드 번호, 노드 번호 > | |
typedef tuple<double, int, int> tp; | |
int N, S, P; | |
pii arr[555]; | |
double dist(pii a, pii b) { |
NewerOlder