Skip to content

Instantly share code, notes, and snippets.

#include <cstdio>
using namespace std;
int Set[1000001]; // Set[i]= x, x表示i的father, 最上層root的father還是自己
void MakeSet(int n);
int FindSetRoot(int x);
void Union(int x, int y);
int main()
#include <cstdio>
#include <queue>
using namespace std;
typedef long long int llt;
int main()
{
llt N, L;
while (scanf("%lld", &N) != EOF) {
priority_queue<llt, vector<llt>, greater<llt> > PQ;
for (llt i = 0; i < N; ++i) {
#include <cstdio>
#include <algorithm>
#include <queue>
using namespace std;
struct fuel_stop{
int pos;
int amount;
}stop[10010];
bool cmp(fuel_stop a, fuel_stop b)
{
#include <cstdio>
using namespace std;
struct Tree{
int val = 0;
Tree *L = nullptr;
Tree *R = nullptr;
};
Tree *Insert(Tree *H, int node)
{
Tree *N = new Tree;
#include <cstdio>
#include <stack>
#include <queue>
using namespace std;
int main()
{
// freopen("input.txt","rt",stdin);
int N, Command, num;
while (scanf("%d", &N) != EOF) {
stack<int> S;
#include <cstdio>
#include <cmath>
using namespace std;
void BST(int Left, int Right, int H);
int main()
{
int Case = 1;
int N, H;
while (scanf("%d %d", &N, &H) && (N || H)) {
printf("Case %d:", Case++);
#include <cstdio>
#include <queue>
using namespace std;
int main()
{
int N, x;
while (scanf("%d", &N) && N) {
priority_queue<int, vector<int>, greater<int>> PQ;
for (int i = 0; i < N; ++i) {
scanf("%d", &x);
#include <iostream>
#include <cstdio>
#include <string>
#include <vector>
using namespace std;
int main()
{
// freopen("input.txt","rt",stdin);
ios::sync_with_stdio(false);
#include <cstdio>
#include <set>
using namespace std;
int Case, M, N;
int A[30010], U[30010];
int main()
{
freopen("input.txt","rt",stdin);
scanf("%d", &Case);
while (Case--) {
#include <cstdio>
#include <vector>
#include <algorithm>
using namespace std;
int A[30010];
int main()
{
// freopen("input.txt","rt",stdin);
int Case, M, N, tmp;
scanf("%d", &Case);