Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@peria
peria / chudnovsky.cc
Last active February 22, 2020 07:57
DRMを利用した円周率計算 (Zの計算フラグの導入)
#include "computer.h"
void Chudnovsky::setXYZ(int64_t k, mpz_class& x, mpz_class& y, mpz_class& z) {
static constexpr int64_t A = 13591409;
static constexpr int64_t B = 545140134;
static constexpr int64_t C = 640320;
if (k == 0) {
x = 1;
} else {
@peria
peria / largest_dpn_for_each.cc
Created December 11, 2016 15:28
枚数毎の最大素数大富豪素数を求めるプログラムです
#include <gmpxx.h>
#include <algorithm>
#include <cstdlib>
#include <functional>
#include <iostream>
#include <iterator>
#include <string>
#include <vector>
using namespace std;
@peria
peria / largest_dpn.cc
Last active February 22, 2016 09:33
Check if the largest prime number in Prime-Daifugo can have 71 digits?
#include <gmpxx.h>
#include <algorithm>
#include <functional>
#include <iostream>
#include <string>
#include <vector>
using namespace std;
const char* ranks[] = {"", "1", "2", "3", "4", "5", "6", "7", "8", "9", "10", "11", "12", "13"};