Skip to content

Instantly share code, notes, and snippets.

View StarOrpheus's full-sized avatar

Zahar Koval StarOrpheus

  • Limassol, Cyprus
View GitHub Profile
@StarOrpheus
StarOrpheus / template.py
Last active December 4, 2016 10:42
run with `python3.5 file.py LOCAL`
import math
from sys import exit, argv, stdin, stdout, stderr
__LOCAL__ = True if (len(argv) > 1 and argv[1] == 'LOCAL') else False
inp = 0
outp = 0
if __LOCAL__:
inp = open('input.txt', "r")
int main()
{
ios_base::sync_with_stdio(0);
int n, m;
cin >> n >> m;
bool sost[101][101];
sost[1][1] = true;
for(int i = 1; i <= n; i++)
for(int j = 1; j <= m; j++)
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
//using namespace __gnu_pbds;
#define INF (1<<30)
from sys import stdin, stdout, stderr, exit
import random
import time
random.seed()
A = 2
B = -2
C = 16
M = 16
@StarOrpheus
StarOrpheus / benis.pas
Last active November 2, 2016 21:24
Easy AC
var n: int64;
h: array[0..1000002] of int64;
comp: array[0..3000008] of array[0..1] of int64;
d, max_dp_found, max_dp_found_ind, mx : int64;
compsz: int64;
tr: array[0..6000100] of array[0..1] of int64;
trSz, i, j, mxp: longint;
pos: array[0..6000100] of int64;
dp: array[0..6001000] of int64;
ans: array[0..1010100] of int64;
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define INF (1<<30)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define INF (1<<30)
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
#define INF (1<<30)
pair<ll, ll> get(ll x, ll i)
{
pair<ll, ll> res = {0, 0};
x++;
ll max_bl_cnt = (x / (1ll << (i + 1)));
res.F = res.S = max_bl_cnt * (1ll << i);
ll left = x - max_bl_cnt * (1ll << (i + 1));
#include <bits/stdc++.h>
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//#include <Rescue.h>
using namespace std;
//using namespace __gnu_pbds;