Skip to content

Instantly share code, notes, and snippets.

View nak3's full-sized avatar

Kenjiro Nakayama nak3

View GitHub Profile
#include <bits/stdc++.h>
using namespace std;
#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;
int main()
{
#include <bits/stdc++.h>
using namespace std;
#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;
int main() {
int num = 5;
#include <bits/stdc++.h>
using namespace std;
#define INF 2000000000
#define MOD 1000000007
typedef long long ll;
typedef pair<int, int> P;
int main() {
int num = 4;
int main()
{
int mx = 10;
bool isprime[mx];
for (int i = 0; i < mx; i++) {
isprime[i] = true;
}
for (int i = 2; i < mx; i++) {
for (int j = i*2; j < mx; j+=i) {
isprime[j] = false;
#include <iostream>
#include <iostream>
#include <algorithm>
#include <vector>
#include <stack>
#include <string.h>
#include <stdio.h>
#include <queue>
using namespace std;
#include <iostream>
#include <algorithm>
#include <vector>
using namespace std;
const int INF = 100000000;
#define MOD 1000000007
typedef long long ll;
subscription-manager register --username=rhn-support-knakayam --password=$PASSWORD
subscription-manager attach --pool=8a85f981576f2592015770330df347d9
subscription-manager repos --disable='*'
subscription-manager repos --enable=rhel-7-server-rpms
subscription-manager repos --enable=rh-gluster-3-for-rhel-7-server-rpms
subscription-manager repos --enable=rh-gluster-3-samba-for-rhel-7-server-rpms
subscription-manager repos --enable=rh-gluster-3-nfs-for-rhel-7-server-rpms
# subscription-manager repos --disable=rh-gluster-3-samba-for-rhel-7-server-rpms
# subscription-manager repos --disable=rh-gluster-3-nfs-for-rhel-7-server-rpms
public class segtree {
static int n;
static int data[];
static int MAX_N = 1 << 17;
segtree(int n_) {
n = 1;
while (n < n_) n *= 2;
data = new int[2*MAX_N -1];
import java.io.*;
import java.util.*;
public class UnionFind {
static public class UF{
int n;
int[] d;
UF(int n) {
import java.util.*;
public class nap {
public static void main(String[] args) {
int N = 3;
int W = 7;
int w[] = {3,4,2};
int v[] = {4,5,3};
int s[][] = new int[N+1][W+1];