Accounts | Mainnet | Ropsten |
---|---|---|
Near on Eth Client | 0x0151568af92125fb289f1dd81d9d8f7484efc362 | 0xb289c6e6c98644dc9f6a03c044564bc8558b6087 |
Prover on Eth | 0x051ad3f020274910065dcb421629cd2e6e5b46c4 | [0xb3df48b0ea3e91b43226fb3c5eb335b7e3d76faa](https://rop |
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
""" | |
Exploring bloom filters using counters instead of bit masks. | |
""" | |
from random import sample, seed, randint | |
from hashlib import md5 | |
from functools import partial | |
# TODO: Use more random & faster hash functions | |
def hash_md5(A, seed, mod): | |
l = list(md5(str(A + (seed << 10)).encode()).digest()) |
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
tot_val = 10000 | |
tot_per_shard = 200 | |
bad_ratio = .20 | |
rounds = 5000 | |
compromised_ratio = 1. / 3 | |
assert tot_val % tot_per_shard == 0 | |
bad = int(bad_ratio * tot_val) | |
good = tot_val - bad |
We can't make this file beautiful and searchable because it's too large.
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
,id,date,user,problem,judgement,time,memory,size,lang,contest | |
0,375916,63,2017CNC045,A,Accepted,207.0,1000.0,0,C++11,1560 | |
1,375917,91,2017CNC022,A,Accepted,144.0,1000.0,0,C++11,1560 | |
2,375919,109,2017cnc2033,A,Accepted,138.0,1000.0,0,C++,1560 | |
3,375920,111,2017CNC024,A,Accepted,194.0,1000.0,0,C++11,1560 | |
4,375922,120,2017cnc2015,A,Accepted,134.0,1000.0,0,C++,1560 | |
5,375923,126,2017CNC047,A,Accepted,142.0,1000.0,0,C++11,1560 | |
6,375924,129,2017CNC100,A,Accepted,140.0,1000.0,0,C++11,1560 | |
7,375925,132,2017CNC069,A,Accepted,144.0,1000.0,0,C++11,1560 | |
8,375926,134,2017CNC021,A,Accepted,187.0,1000.0,0,C++,1560 |
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
#include <vector> | |
#include <iostream> | |
#include <map> | |
#include <random> | |
#include <numeric> | |
using namespace std; | |
mt19937 rng(0); |
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
def tPoS(tokens, seats): | |
lo, hi = 0, 1 | |
def get_seats(value): | |
total = 0 | |
for tok in tokens: | |
total += tok // value | |
return total | |
while get_seats(hi) >= seats: |
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 borsh::{BorshDeserialize, BorshSerialize}; | |
use near_bindgen::{env, ext_contract, near_bindgen}; | |
use serde::{Deserialize, Serialize}; | |
#[global_allocator] | |
static ALLOC: wee_alloc::WeeAlloc = wee_alloc::WeeAlloc::INIT; | |
#[ext_contract(ext)] | |
pub trait ExtCrossContract { | |
fn fork(&mut self); |
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
# %%% | |
import PIL.Image | |
import numpy as np | |
import matplotlib.pyplot as plt | |
# %% | |
im = PIL.Image.open("panda.jpeg") | |
arr = np.array(im).mean(2) |
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
""" | |
https://twitter.com/bitshiftmask/status/1323809212875608066?s=20 | |
Let P(i, j) be the probability that if there are `i` devices, then after one | |
round `j` devices selected a unique number, so they are out. The expected | |
value of the number of rounds required so that each device selected a unique number is: | |
E(n) = p(n, n) * E(0) + p(n, n - 1) * E(1) + ... + p(n, 0) * E(n) | |
E(n) * (1 - p(n, 0)) = p(n, n) * E(0) + p(n, n - 1) * E(1) + ... |
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
{ | |
"version": "0.2.0", | |
"configurations": [{ | |
"name": "Launch with lldb", | |
"type": "lldb", | |
"request": "launch", | |
"program": "${fileDirname}/attic/sol", | |
"args": ["${fileDirname}"], | |
"cwd": "${workspaceFolder}", | |
"stdio": ["${fileDirname}/testcases/0.in"], |
OlderNewer