This file contains 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
[package] | |
name = "so78124765" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
reqwest = { version = "0.11.24", features = ["json"] } | |
serde_json = "1.0.114" | |
tokio = { version = "1.36.0", features = ["net", "io-util", "rt-multi-thread", "macros"] } |
This file contains 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 criterion::{criterion_group, criterion_main, Criterion}; | |
use sqlx::{ | |
postgres::{PgConnectOptions, PgPoolOptions}, | |
ConnectOptions, | |
}; | |
use tokio::runtime::Runtime; | |
use tokio_postgres::NoTls; | |
pub fn rand_token() -> String { | |
use rand::{distributions::Alphanumeric, Rng}; |
This file contains 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
// Mivik 2021.6.18 | |
#include <chrono> | |
#include <iostream> | |
#include <queue> | |
#include <random> | |
#include <set> | |
#include <vector> | |
const int QUERY_NUM = 2000000; | |
const int INSERT_NUM = 2000000; |
This file contains 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
// Mivik 2021.3.1 | |
#include <mivik.h> | |
#include <algorithm> | |
#include <cassert> | |
#include <cctype> | |
#include <climits> | |
#include <random> | |
#include <vector> |
This file contains 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
// Mivik 2021.3.1 | |
#include <algorithm> | |
#include <cassert> | |
#include <cctype> | |
#include <random> | |
#include <vector> | |
typedef long long qe; | |
const int mod = 998244353; |
This file contains 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
// Requires: libgmp-dev | |
// Recommended compiler options: -std=c++11 -Ofast -lgmp -lgmpxx | |
// Mivik 2021.1.25 | |
#include <cassert> | |
#include <cstdint> | |
#include <iostream> | |
#include <vector> | |
const int N = 60; // maximum length of the string |
This file contains 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
// Mivik 2021.1.24 | |
// Inspired by the predicate given in "Periods in Strings" by Guibas and Odlyzko | |
// See Leo J. Guibas and Andrew M. Odlyzko. Periods in strings. J. of Combinatorial Theory series A, 30:19–42, 1981. | |
// Enumerated all autocorrelations for n = 400 in less than 30 seconds on my computer (without writing it to file) | |
// It DOES REQUIRE A LOT OF TIME AND DISK SPACE to save these autocorrelations, please notice | |
// For example, for n = 200, it could produce a file up to 200MB | |
#include <algorithm> | |
#include <cassert> | |
#include <cstdint> |
This file contains 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
// Requires: libgmp-dev | |
// Recommended compiler options: -Ofast -lgmp -lgmpxx | |
// Mivik 2021.1.25 | |
#include <cstdint> | |
#include <iostream> | |
#include <vector> | |
#include <gmpxx.h> |
This file contains 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
// Mivik 2021.1.24 | |
// Inspired by the predicate given in "Periods in Strings" by Guibas and Odlyzko | |
// See Leo J. Guibas and Andrew M. Odlyzko. Periods in strings. J. of Combinatorial Theory series A, 30:19–42, 1981. | |
// Enumerated all autocorrelations for n = 400 in less than 30 seconds on my computer (without writing it to file) | |
// It DOES REQUIRE A LOT OF TIME AND DISK SPACE to save these autocorrelations, please notice | |
// For example, for n = 200, it could produce a file up to 200MB | |
#include <algorithm> | |
#include <bitset> | |
#include <iostream> |