Skip to content

Instantly share code, notes, and snippets.

View lychees's full-sized avatar
🌴
People, Fund, Strategy ...

minakokojima lychees

🌴
People, Fund, Strategy ...
View GitHub Profile
@lychees
lychees / PE912.cpp
Created December 12, 2024 21:28
数位dp失败。
#include <lastweapon/number>
#include <lastweapon/bitwise>
using namespace lastweapon;
const int N = 65;
LL F0[N][2][2][2]; Int F[3][N][2][2][2]; bool vis[N][2][2][2]; Int p2[N+1];
bool a[N]; int an;
LL f0(int k, bool b, bool x, bool y) {
@lychees
lychees / PE918.cpp
Created December 7, 2024 15:09
打表找规律 + 递归,高精度是多余的。。。
#include <lastweapon/number>
#include <lastweapon/bitwise>
#include <lastweapon/bignum>
using namespace lastweapon;
const int N = 112;
class bignum2 : bignum {
public:
@lychees
lychees / PE852.cpp
Created December 7, 2024 12:45
条件概率 + 二项分布
#include <lastweapon/number>
using namespace lastweapon;
const int N = 51, M = 101;
DB F[N][N][M][M];
DB f(int a, int b, int c = 0, int d = 0) {
if (c == M || d == M) return 0;
DB &z = F[a][b][c][d];
@lychees
lychees / PE854.cpp
Created December 2, 2024 11:23
用 853 打打表。。
#include <lastweapon/io>
#include <lastweapon/bignum>
using namespace lastweapon;
const int N = 500000+1;//1000001;
bignum f[N];
bignum gcd(bignum a, bignum b) {
@lychees
lychees / PE853.cpp
Created December 1, 2024 19:13
https://projecteuler.net/problem=853 有用的素数只有8个,随便搜。
#include <lastweapon/io>
#
using namespace lastweapon;
const int PMAX = 10000;
VI P; bitset<PMAX> isC;
#define ii (i*P[j])
void sieve(){
FOR(i, 2, PMAX){
if (!isC[i]) P.PB(i);
#include <lastweapon/io>
#include <assert.h>
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
using std::max;
using std::min;
using std::vector;
/** Micro Mezz Macro Flation -- Overheated Economy ., Last Update: Sep. 22th 2014 **/ //{
/** Header .. **/ //{
#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#define LOCAL
//#include "testlib.h"
#include <functional>
#include <algorithm>
#include <iostream>
@lychees
lychees / A.cpp
Created September 11, 2021 04:11
BZOJ 3533. [Sdoi2014]向量集
/*
This code has been written by MinakoKojima, feel free to ask me question. Blog: http://www.shuizilong.com/house
Template Date: 2015.10.12
Note: ...
*/
#pragma comment(linker, "/STACK:36777216")
//#pragma GCC optimize ("O2")
#define LOCAL
#include <functional>
/** ` Micro Mezzo Macro Flation -- Overheated Economy ., **/
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <sstream>
#include <cstring>
#include <cstdio>
#include <string>
#include <vector>
@lychees
lychees / weth.sol
Created January 13, 2021 14:16
weth
// Dependency file: contracts/interfaces/IERC20.sol
// pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Returns the name of the token.