avast/retdec をcloneしてきてビルドした後、retdec::deps::eigen が見つからないといってretdecを用いたプログラムのコンパイルに失敗した時の対処
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
| use rayon::prelude::*; | |
| use serde::{Deserialize, Serialize}; | |
| use serde_json::Result; | |
| fn _mul(x: u16, y: u16) -> u16 { | |
| let mut x: u64 = x as u64; | |
| let mut y: u64 = y as u64; | |
| if x == 0 { | |
| x = 2u64.pow(16); | |
| } |
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
| from functools import cache | |
| def division_polynomial(E, n, x=None): | |
| if x is None: | |
| PR = PolynomialRing(E.base()) | |
| x = PR.gen() | |
| a, b = E.a4(), E.a6() | |
| F = 4*(x**3 + a*x + 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
| from Crypto.Cipher import AES | |
| import secrets | |
| F = GF(2**128, name="a", modulus=x**128 + x**7 + x**2 + x + 1) | |
| def to_poly(x): | |
| bs = Integer(int.from_bytes(x, "big")).bits()[::-1] | |
| return F([0] * (128 - len(bs)) + bs) |
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
| def qtest(xs): | |
| m = len(xs) | |
| ts = [sum(x) for x in xs] | |
| tbar = sum(ts) / m | |
| ss = [] | |
| for i in range(len(xs[0])): | |
| s = 0 | |
| for j in range(len(xs)): | |
| s += xs[j][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
| import std.stdio, std.string, std.algorithm, std.array, std.range, std.conv, | |
| std.typecons, std.math, std.container, std.format, std.numeric; | |
| alias T = Tuple!(long, "value", long, "time"); | |
| class Segtree | |
| { | |
| private: | |
| long size; | |
| T[] xs; |
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 std.stdio, std.string, std.algorithm, std.array, std.range, std.conv, | |
| std.typecons, std.math, std.container, std.format, std.numeric; | |
| alias T = Tuple!(long, "time", long, "value"); | |
| class Segtree | |
| { | |
| private: | |
| T[] xs; | |
| long size; |
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 std.stdio, std.string, std.algorithm, std.array, std.range, std.conv, | |
| std.typecons, std.math, std.container, std.format, std.numeric; | |
| struct SplayNode | |
| { | |
| public: | |
| SplayNode* parent, left, right; | |
| long size; | |
| long value, minimum; |
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 std.stdio, std.string, std.algorithm, std.array, std.range, std.conv, | |
| std.typecons, std.math, std.container, std.format, std.numeric; | |
| struct SplayNode | |
| { | |
| public: | |
| long size; | |
| long x, minimum; | |
| SplayNode* parent, left, right; |
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 std.stdio, std.string, std.algorithm, std.array, std.range, std.conv, | |
| std.typecons, std.math, std.container, std.format, std.numeric; | |
| class SegmentTree | |
| { | |
| private: | |
| long[] xs; | |
| long size; | |
| public: | |
| this(long size) |
NewerOlder