Skip to content

Instantly share code, notes, and snippets.

View Baekjoon's full-sized avatar

Baekjoon Choi Baekjoon

View GitHub Profile
@Baekjoon
Baekjoon / 11409.cc
Created October 23, 2015 18:42
11409
#include <iostream>
#include <queue>
#include <vector>
using namespace std;
struct MCMF {
struct Edge {
int to;
int capacity;
int cost;
Edge *rev;
@Baekjoon
Baekjoon / Main.java
Created October 22, 2015 16:11
11403
import java.util.*;
public class Main {
public static void main(String args[]) {
Scanner sc = new Scanner(System.in);
int n = sc.nextInt();
int[][]d = new int[n][n];
for (int i=0; i<n; i++) {
for (int j=0; j<n; j++) {
d[i][j] = sc.nextInt();
}
@Baekjoon
Baekjoon / 8895.cc
Created September 27, 2015 17:13
8895
#include <iostream>
using namespace std;
long long d[21][21][21];
int main() {
d[1][1][1] = 1LL;
for (int i=2; i<=20; i++) {
for (int j=1; j<=20; j++) {
for (int k=1; k<=20; k++) {
d[i][j][k] = d[i-1][j-1][k] + d[i-1][j][k-1] + d[i-1][j][k] * (i-2);
}
@Baekjoon
Baekjoon / 1328.cc
Created September 27, 2015 17:12
1328
#include <iostream>
using namespace std;
long long d[101][101][101];
long long mod = 1000000007LL;
int main() {
int n, l, r;
cin >> n >> l >> r;
d[1][1][1] = 1LL;
for (int i=2; i<=n; i++) {
for (int j=1; j<=l; j++) {
@Baekjoon
Baekjoon / gcd.cc
Created September 27, 2015 14:55
GCD
#include <iostream>
int gcd(int x, int y) {
if (y == 0) {
return x;
} else {
return gcd(y, x%y);
}
}
int main() {
std::cout << gcd(24, 16) << '\n';
@Baekjoon
Baekjoon / 10951.java
Created September 5, 2015 17:29
10951
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int a, b;
while (sc.hasNextInt()) {
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a + b);
}
@Baekjoon
Baekjoon / 10951.cc
Created September 5, 2015 17:28
10951
#include <cstdio>
using namespace std;
int main() {
int t;
int a,b;
while (scanf("%d %d",&a,&b) == 2) {
printf("%d\n",a+b);
}
return 0;
}
@Baekjoon
Baekjoon / 10951.cc
Created September 5, 2015 17:26
10951
#include <iostream>
using namespace std;
int main() {
int t;
int a,b;
while (cin >> a >> b) {
cout << a+b << '\n';
}
return 0;
}
@Baekjoon
Baekjoon / 10950.java
Created September 5, 2015 17:25
10950
import java.util.*;
public class Main{
public static void main(String args[]){
Scanner sc = new Scanner(System.in);
int t = sc.nextInt();
while (t-- > 0) {
int a, b;
a = sc.nextInt();
b = sc.nextInt();
System.out.println(a + b);
@Baekjoon
Baekjoon / 10950.cc
Last active July 6, 2017 15:42
10950
#include <cstdio>
using namespace std;
int main() {
int t;
int a,b;
scanf("%d",&t);
while (t--) {
scanf("%d %d",&a,&b);
printf("%d\n",a+b);
}