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) { | |
new Main().solve(); | |
} | |
void solve(){ | |
Scanner sc = new Scanner(System.in); | |
int a = sc.nextInt(); | |
int b = 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
import java.util.*; | |
class P1000 { | |
public void solve(){ | |
Scanner sc = new Scanner(System.in); | |
int a = sc.nextInt(); | |
int 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 <iostream> | |
#include <string> | |
#include <vector> | |
using namespace std; | |
struct Node { | |
bool valid; | |
Node *children[10]; | |
Node() { | |
valid = false; | |
for (int i=0; i<10; i++) { |
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 <string> | |
#include <vector> | |
using namespace std; | |
struct Node { | |
bool valid; | |
int children[10]; | |
Node() { | |
valid = false; | |
for (int i=0; i<10; i++) { |
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 <string> | |
using namespace std; | |
int match(string s, string p) { | |
int n = s.size(); | |
int m = p.size(); | |
for (int i=0; i<=n-m; i++) { | |
bool ok = true; | |
for (int j=0; j<m; j++) { | |
if (s[i+j] != p[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 <cstdio> | |
#include <algorithm> | |
using namespace std; | |
int heap[100001]; | |
int hn; | |
int pop() { | |
int ans = heap[1]; | |
heap[1] = heap[hn]; | |
heap[hn--] = 0; | |
for (int i=1; i*2 <= hn;) { |
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 preorder(int[][] a, int x) { | |
if (x == -1) return; | |
System.out.print((char)(x+'A')); | |
preorder(a,a[x][0]); | |
preorder(a,a[x][1]); | |
} | |
public static void inorder(int[][] a, int x) { | |
if (x == -1) return; |
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 <numeric> | |
#include <vector> | |
#include <algorithm> | |
#include <cstring> | |
#include <string> | |
#include <map> | |
#include <queue> | |
using namespace std; | |
struct MCMF { |
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 <numeric> | |
#include <string> | |
#include <queue> | |
#include <vector> | |
using namespace std; | |
struct MCMF { | |
struct Edge { | |
int to; | |
int capacity; |
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; |
NewerOlder