Skip to content

Instantly share code, notes, and snippets.

@junodeveloper
junodeveloper / 2098.cpp
Last active January 17, 2018 17:02
boj_2098
#include <cstdio>
#include <iostream>
#include <cstring>
using namespace std;
const int INF = 0x3c3c3c3c;
int n, w[16][16], dp[1<<16][16];
int main() {
scanf("%d",&n);
for(int i=0; i<n; i++)
for(int j=0; j<n; j++)
@junodeveloper
junodeveloper / 10164.cpp
Created January 17, 2018 16:36
boj_10164
#include <cstdio>
#include <iostream>
using namespace std;
int n, m, k;
int c[31][31]; // Combination nCk
int main() {
for(int i=0; i<=30; i++) {
c[i][0] = 1;
for(int j=1; j<=i; j++)
c[i][j] = c[i-1][j] + c[i-1][j-1];
#include<cstdio>
#include<algorithm>
using namespace std;
int a[10],c[11][11],n; // c : 조합
int main() {
scanf("%d",&n);
for(int i=0;i<=10;i++) c[i][0]=c[i][i]=1;
for(int i=1;i<=10;i++) for(int j=1;j<i;j++) c[i][j]=c[i-1][j]+c[i-1][j-1];
if(n<1023) {
int k=1,s=0; // k : 자릿수, s : k자리 이하의 감소하는 수 개수
@junodeveloper
junodeveloper / koi_resort_edit1.cpp
Last active May 21, 2018 06:59
KOI 리조트 첨삭1
#include <iostream>
#include <cstdio>
#include <algorithm>
using namespace std;
int min( int a , int b)
{
return a>b ? b : a;
}
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#include <utility>
using namespace std;
queue< pair < int , int > > q;
int memo[100001][4] , A , B;
@junodeveloper
junodeveloper / commando.cpp
Last active September 18, 2018 04:20
APIO 2014 Commando with CHT
#include <bits/stdc++.h>
using namespace std;
struct line {
long long a, b;
};
vector<line> S;
double cross(line L1, line L2) {
if(L1.a == L2.a) return L1.b <= L2.b ? -1e18 : 1e18;
return (double)(L1.b - L2.b) / (L2.a - L1.a);
@junodeveloper
junodeveloper / agc028_c.cpp
Created October 14, 2018 04:46
AGC028. Problem C
#include <bits/stdc++.h>
#define sz(x) ((int)x.size())
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
typedef long double ld;
int n, A[100010], B[100010], P[100010][2];
ll s[200010];
vector<pair<int,int> > v;
int main() {
@junodeveloper
junodeveloper / opencv_load_folder.cpp
Created January 8, 2019 06:08
OpenCV load images from a folder
#include "opencv2/opencv.hpp"
#include <iostream>
#include <string>
using namespace cv;
using namespace std;
int main(int, char**)
{
cv::String path("*.png");
@junodeveloper
junodeveloper / fs.fs
Created March 21, 2019 08:42
InActivity 2
#version 330 core
out vec4 FragColor;
in vec3 ourColor;
void main()
{
FragColor = vec4(ourColor, 1.0f);
}
#version 330 core
out vec4 FragColor;
struct Material {
sampler2D diffuse;
sampler2D specular;
float shininess;
};
struct DirLight {