Skip to content

Instantly share code, notes, and snippets.

View key-moon's full-sized avatar

keymoon key-moon

  • Tokyo
  • 06:32 (UTC +09:00)
  • X @kymn_
View GitHub Profile
@key-moon
key-moon / check_aslr_entropy.py
Last active May 22, 2024 17:11
Check aslr entropy
import subprocess
open("/tmp/exp.c", "w").write('''
#include<stdio.h>
char buf[10000];
int main() {
void* val;
fread(buf, 1, 10000, fopen("/proc/self/maps", "r"));
puts(buf);
printf("%llx stackvar\\n", (unsigned long long)&val);
import sys
def _getflag():
orig_file = sys._getframe(1).f_code.co_filename
if orig_file != __file__:
print('who are you...?')
exit(1)
print("0nepts{fakeflag}")
def getflag():
@key-moon
key-moon / predictor.ipynb
Last active July 25, 2020 16:21
コンテスト中の順位を推定するに当たって試行錯誤をした際のnotebook | data: https://drive.google.com/drive/folders/1BnUtgcjfDNZDe9MkiBN-zBJ7vVt9Jvfc
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#include <bits/stdc++.h>
using ll = long long;
/*
* task: calculate sum_{i=1}^input inv(i)
*
* input = 20000000
*
* MOD_A := 2^29+11 (smallest prime after 2^29(few bits))
* MOD_B := 2^30-35 (largest prime before 2^30(many bits))
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Runtime.InteropServices;
using System.Text;
using System.Text.RegularExpressions;
@key-moon
key-moon / Preprocess is too hard.csx
Last active February 1, 2020 15:51
プリプロセスつらい
//複数行コメントアウトを置換しないと、本来入らないプリプロセッサが入ってしまう。
/*
#pragma hoge fuga~ //←本来入らないはず
*/
//リテラルを考慮せずに置換すると破滅する:ここでint nにはCS0168は出ない `/\*.*\*/|//.*$`とかで適当に置換をすると出るようになる
var a = ("/*") *//*
#if DEBUG
name: Fetch sources
on:
schedule:
- cron: '* 0 * * *'
jobs:
build:
runs-on: ubuntu-latest
steps:
積雪深差
視程の通報
風力観測
感雨時刻の整理
正直者
直訴
派閥
AtCoder社の給料
AtCoderトランプ

上に行くほど簡単/優先度高

実装したい

  • 可換セグ木(StarrySky木)
  • next_permutation
  • X-fast trie
  • Wavelet Matrix
  • 実時間O(1)永続Queue
  • 永続SegmentTree
  • 動的SegmentTree
public class AmortizedConstantTimeImmutableQueue<T> : IImmutableQueue<T>
{
public bool IsEmpty => throw new NotImplementedException();
bool IImmutableQueue<T>.IsEmpty => throw new NotImplementedException();
public static AmortizedConstantTimeImmutableQueue<T> Empty =>
new AmortizedConstantTimeImmutableQueue<T>(0, ImmutableStack<T>.Empty, 0, ImmutableStack<T>.Empty, ImmutableStack<Lazy<ImmutableStack<T>>>.Empty);
private ImmutableStack<T> Front;