This file contains hidden or 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; | |
struct MCMF { | |
struct Edge { | |
int to; | |
int capacity; | |
int cost; | |
Edge *rev; |
This file contains hidden or 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
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(); | |
} |
This file contains hidden or 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; | |
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); | |
} |
This file contains hidden or 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; | |
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++) { |
This file contains hidden or 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> | |
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'; |
This file contains hidden or 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
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); | |
} |
This file contains hidden or 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 <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; | |
} |
This file contains hidden or 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; | |
int main() { | |
int t; | |
int a,b; | |
while (cin >> a >> b) { | |
cout << a+b << '\n'; | |
} | |
return 0; | |
} |
This file contains hidden or 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
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); |
This file contains hidden or 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 <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); | |
} |