akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
# define MOD 1000000007

/*
	Provide two numbers and it'll return it's gcd
*/
long long int gcd(long long int a,long long int b){
	if(b==0) return a;
	return gcd(b,a%b);
}

long long int lcm(long long int a, long long int b){
	return (a*b)/gcd(a,b);
}

long long int power1(long long int base,long long int po){
	long long int ret = 1;

	while(po){
		if(po%2){
			ret = (ret*base)%MOD;
		}

		base = (base*base)%MOD;
		po/=2;
	}
	return ret;
}

int main(){
	// freopen("input.txt","r",stdin);

	int t,n,i,j;

	int k,a,b;

	cin>>k;

	cin>>a>>b;

	for(int i=a;i<=b;i++){
		if(i%k==0){
			cout<<"OK"<<endl;
			return 0;
		}
	}

	cout<<"NG"<<endl;

	return 0;
}

Measured memory_bytes: 3596
#include <iostream>
#include <string>
#include <vector>

using namespace std;

int main()	{
  int h, w;
  cin >> h >> w;
  char input[h][w];
  for (int i = 0; i < h; i++)	{
    for (int j = 0; j < w; j++)	{
      cin >> input[i][j];
    }
  }
  for (int i = 0; i < h; i++)	{
    for (int j = 0; j < w; j++)	{
      cout << input[i][j]; 
    }
    cout << endl;
    for (int j = 0; j < w; j++)	{
      cout << input[i][j]; 
    }
    cout << endl;
  }
  cout << endl;
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;

#define pb push_back
#define mp make_pair
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef complex<double> point;
#define xx real()
#define yy imag()

#define REP(i, a, b) for(int i = (a); i < (int)(b); i++)
#define REPN(i, a, b) for(int i = (a); i <= (int)(b); i++)
#define FA(it, x) for(__typeof((x).begin()) it = (x).begin(); it != (x).end(); it++)
#define SZ(x) (int)(x).size()
#define BE(x) (x).begin(), (x).end()
#define SORT(x) sort(BE(x))
#define _1 first
#define _2 second

#define x1 gray_cat_x1
#define y1 gray_cat_y1

template<class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }

#define file "I1"

const double EPS = 1e-9;
const double PI = acos(-1.);
const int INF = 1e9;
const ll MOD = 1e9 + 7;

const int MAXN = 1e5 + 5;

int a[MAXN];

void solve(){
	int n;
	scanf("%d", &n);
	REP(i, 0, n){
		scanf("%d", &a[i]);
	}
	int ans = 0;
	for(int i = 0; i < n; ){
		//printf("%d\n", i);
		ans++;
		int j, k;
		for(j = i; j < n && a[j] == a[i]; j++);
		for(k = j + 1; k < n && (a[i] >= a[j] && a[k - 1] >= a[k] || a[i] <= a[j] && a[k - 1] <= a[k]); k++);
		i = k;
	}
	printf("%d\n", ans);
}   

int main(){

    //freopen(file".in", "r", stdin); freopen(file".out", "w", stdout);
    int t = 1;
    //cin >> t;
    while(t--){
        solve();    
    }
}


Measured memory_bytes: 640
#include <bits/stdc++.h>

using namespace std;

#define REP(i,m) for(int i=0; i<m; i++)
#define FOR(i,n,m) for(long long i=n; i<m; i++)
#define INF 1000000001
#define INFL (1LL << 60)
#define MOD 1000000007
#define ALL(v) v.begin(),v.end()
#define pb push_back
#define ll long long int
#define P pair<int, int>

ll max(ll a, ll b){
  return (a>b?a:b);
}

int main() {
  int n;
  cin >> n;
  ll c, x[n], v[n];
  cin >> c;
  REP(i, n) cin >> x[i] >> v[i];
  ll p[n+1];
  p[0] = 0;
  REP(i, n) p[i+1] = p[i] + v[i];
  REP(i, n) p[i+1] -= 2*x[i];
  REP(i, n) p[i+1] = (p[i+1] > p[i]?p[i+1]:p[i]);
  ll q[n+1];
  q[n] = 0;
  REP(i, n) q[n-i-1] = q[n-i] + v[n-i-1];
  REP(i, n) q[i] -= 2*(c-x[i]);
  REP(i, n) q[n-i-1] = (q[n-1-i]>q[n-i]?q[n-1-i]:q[n-i]);
  ll r[n+1], s[n+1];
  r[0] = 0;
  s[n] = 0;
  REP(i, n) r[i+1] = r[i]+v[i];
  REP(i, n) r[i+1] -= x[i];
  REP(i, n) s[n-i-1] = s[n-i]+v[n-1-i];
  REP(i, n) s[i] -= (c-x[i]);
  REP(i, n+1) p[i] += s[i];
  REP(i, n+1) q[i] += r[i];
  ll ans = 0;
  REP(i, n+1){
    ans = max(ans, p[i]);
    ans = max(ans, q[i]);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 4992
import java.util.*;
import java.lang.Math;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
      	int n = sc.nextInt();
      	int l = sc.nextInt();
      	int ans = (2*l+n-1)*n/2;
      	int e;
      
      	if(l*(l+n-1) <= 0) e = 0;
      	else if(Math.abs(l) < Math.abs(l+n-1)) e = l;
      	else e = l+n-1;
      
      	ans -= e;
      	System.out.println(ans);
	}
}

Measured memory_bytes: 35720
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import bisect
import random
from itertools import permutations, accumulate, combinations, product
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor, gcd, sqrt
from operator import mul
from functools import reduce
from operator import mul
from pprint import pprint



sys.setrecursionlimit(2147483647)
INF = 10 ** 20
def LI(): return list(map(int, sys.stdin.buffer.readline().split()))
def I(): return int(sys.stdin.buffer.readline())
def LS(): return sys.stdin.buffer.readline().rstrip().decode('utf-8').split()
def S(): return sys.stdin.buffer.readline().rstrip().decode('utf-8')
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
def MSRL(n): return [[int(j) for j in list(S())] for i in range(n)]
mod = 1000000007


n = int(input())
a = list(map(int, input().split()))

t = 0
flg = 0

for ai in a[2:]:
    t = t ^ ai

x = a[0] + a[1] - t
if x < 0 or x % 2:
    flg = 1

x //= 2
a1 = x

if a1 > a[0]:
    flg = 1

for i in reversed(range((a[0] + a[1]).bit_length())):
    if t & (1 << i):
        if x & (1 << i):
            flg = 1
        if a1 + 2 ** i <= a[0]:
            a1 += 2 ** i

if a1 == 0:
    flg = 1

print(a[0] - a1 if flg == 0 else -1)











Measured memory_bytes: 76656
#include <iostream>
#include <string>
#include <vector>
#include <numeric>
#include <queue>
#include <unordered_map>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <sstream>
#include <stack>
#include <map>
#include <set>
#include <ios>
#include <cctype>
#include <cstdio>
#include <functional>

#define REP(i,a) for(int i = 0;i < (a);++i)
#define FOR(i,a,b) for(int i = (a);i < (b); ++i)
#define FORR(i,a,b) for(int i = (a) - 1;i >=(b);--i)
#define ALL(obj) (obj).begin(),(obj).end()
#define SIZE(obj) (int)(obj).size()
#define YESNO(cond,yes,no){cout <<((cond)?(yes):(no))<<endl; }
#define SORT(list) sort(ALL((list)));
#define RSORT(list) sort((list).rbegin(),(list).rend())

using namespace std;

template<typename T>
T round_up(const T& a, const T& b) {
    return (a + (b - 1)) / b;
}

template <typename T1, typename T2>
istream& operator>>(istream& is, pair<T1, T2>& p) {
    is >> p.first >> p.second;
    return is;
}

template <typename T1, typename T2>
ostream& operator<<(ostream& os, pair<T1, T2>& p) {
    os << p.first << p.second;
    return os;
}

template <typename T>
istream& operator>>(istream& is, vector<T>& v) {
    REP(i, (int)v.size())is >> v[i];
    return is;
}

template <typename T>
ostream& operator<<(ostream& os, vector<T>& v) {
    REP(i, (int)v.size())os << v[i] << endl;
    return os;
}

using ll = long long;
constexpr int mod = 1'000'000'007;
constexpr int INF = 1'050'000'000;

template <typename T>
T clamp(T& n, T a, T b) {
    if (n < a)n = a;
    if (n > b)n = b;
    return n;
}

template <typename T>
static T GCD(T u, T v) {
    T r;
    while (v != 0) {
        r = u % v;
        u = v;
        v = r;
    }
    return u;
}

template <typename T>
static T LCM(T u, T v) {
    return u * v / gcd(u, v);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    std::cout << fixed << setprecision(20);

    int N;
    cin >> N;
    vector<pair<int, int>> ab(N);
    cin >> ab;
    vector<pair<int, int>> cd(N);
    cin >> cd;
    SORT(cd);

    vector<bool> isPair(N, false);
    int cnt = 0;
    REP(i, N) {
        int y = -1;
        int index = -1;
        REP(j, N) {
            if (isPair[j])continue;
            if (ab[j].first < cd[i].first && ab[j].second < cd[i].second) {
                if (y < ab[j].second) {
                    y = ab[j].second;
                    index = j;
                }
            }
        }
        if (index == -1)continue;
        isPair[index] = true;
        cnt++;
    }

    cout << cnt << endl;
    return 0;

}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <cmath>

using namespace std;
typedef long long ll;
//typedef unsigned long long ll;

#define rep(i, n) for (ll i = 0; i < (n); ++i)
//#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define sz(x) ll(x.size())
//typedef pair<ll, int> P;
//typedef pair<ll, ll> P;
//const double INF = 1e10;
const ll INF = LONG_LONG_MAX / 100;
//const ll INF = 1e15;
const ll MINF = LONG_LONG_MIN;
//const int INF = INT_MAX / 10;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)

bool contain(set<char> &s, int a) { return s.find(a) != s.end(); }


//ifstream myfile("C:\\Users\\riku\\Downloads\\0_00.txt");
//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);

typedef priority_queue<ll, vector<ll>, greater<ll>> PQ_ASK;
const int mod = 1000000007;

struct MP {
    int n;
    vector<int> a;
    vector<int> t;

    MP() {}

    MP(const vector<int> &t) : t(t) {
        n = t.size();
        a = vector<int>(n + 1);
        a[0] = -1;
        int j = -1;
        for (int i = 0; i < n; i++) {
            while (j != -1 && t[j] != t[i]) j = a[j];
            j++;
            a[i + 1] = j;
        }
    }

    int operator[](int i) {
        return a[i];
    }

    vector<int> findAll(const vector<int> &s) {
        vector<int> res;
        int j = 0;
        for (int i = 0; i < s.size(); i++) {
            while (j != -1 && t[j] != s[i]) j = a[j];
            j++;
            if (j == n) {
                res.push_back(i - j + 1);
                j = a[j];
            }
        }
        return res;
    }
};

vector<int> f(vector<int> &a) {
    int n = a.size();
    vector<int> res(n);
    rep(i, n) res[i] = a[i] ^ a[(i + 1) % n];
    return res;
}

int main() {
    int n;
    cin >> n;

    vector<int> a(n), b(n);
    rep(i, n) cin >> a[i];
    rep(i, n) cin >> b[i];
    vector<int> xa = f(a);
    vector<int> xb = f(b);
    xb.insert(xb.end(), xb.begin(), xb.end());
    MP mp(xa);
    vector<int> res = mp.findAll(xb);
    vector<int> ks;
    for (int p : res) ks.push_back(n - p);
    sort(ks.begin(), ks.end());
    for (int k : ks) {
        if (k >= n)continue;
        int x = a[k] ^b[0];
        printf("%d %d\n", k, x);
    }


}


Measured memory_bytes: 11504
#include "bits/stdc++.h"
using namespace std;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)   FOR(i,0,n)
#define LL long long

const int MAXSSTN = 100010;
class StarrySkyTree{
public:
  int size=0;
  int depth=0; // the depth of the tree
  int best=0;  // the index of maximum element
  int start=0; // the initial index of inputs
  long long dat_add[4 * MAXSSTN];
  long long dat[4 * MAXSSTN];
  
  StarrySkyTree(int n,long long* v){
    size=n;
    while((1<<depth)<n)depth++;
    start=(1<<depth)-1;
    for(int i=start;i<(1<<(depth+1));i++){
      if(i<start+n)
	dat[i]=v[i-start];
      else
	dat[i]=1e15;
    }
    for(int i=start;i<start+n;i++){
      int tmp=i;
      while(par(tmp)!=-1){
	dat[par(tmp)]=min(dat[tmp],dat[(tmp+1)/2*4-1-tmp]);
	tmp=par(tmp);
      }
    }
    int i=0;
    while(i<start)i=(dat[i]==dat[2*i+1])?2*i+1:2*i+2;
    best=i-start;
  }
  long long max_element(int a, int b){ return max_element(a, b, 0, 0, (1<<depth)); }
  void add(int s, int t, int x){ add(s, t, 0, 0, (1<<depth), x); }
  void add(int i, int x){ add(i, i + 1, 0, 0, (1<<depth), x); }

  int par(int i){
    if(i==0)
      return -1;
    return (i-1)/2;
  }

  void update(int d,long long x){
    int i=d+start;
    dat[i]=x;
    while(par(i)!=-1){
      dat[par(i)]=min(dat[i],dat[(i+1)/2*4-1-i]);
      i=par(i);
    }
    i=0;
    while(i<start){
      i=(dat[i]==dat[2*i+1])?2*i+1:2*i+2;
    }
    best=i-start;
  }
  void dump(){
    for(int i=0;i<(1<<(depth+1));i++){
      cerr<<dat[i]<<" ";
    }
    cerr<<endl;
  }
private:
  long long max_element(int a, int b, int k, int l, int r){
    if(b <= l || r <= a) return 1e15;
    if(a <= l && r <= b) return dat[k] + dat_add[k];

    long long vl = max_element(a, b, k * 2+1, l, (l + r) / 2);
    long long vr = max_element(a, b, k * 2+2, (l + r) / 2, r);
    return min(vl, vr) + dat_add[k];
  }
  void add(int a, int b, int k, int l, int r, long long x){
    if(b <= l || r <= a) return;
    if(a <= l && r <= b){
      dat_add[k] += x;
    }else{
      add(a, b, k * 2+1, l, (l + r) / 2, x);
      add(a, b, k * 2+2, (l + r) / 2, r, x);
      dat[k] = min(dat[k * 2+1] + dat_add[k * 2+1], dat[k * 2 + 2] + dat_add[k * 2 + 2]);
    }
  }
};

int n,q;
LL a[100000];

int main(){
  cin>>n>>q;
  REP(i,n)
    a[i]=(1LL<<31)-1;
  StarrySkyTree sst(n,a);
  int tmp;
  LL x,y;
  REP(i,q){
    cin>>tmp>>x>>y;
    if(tmp)cout<<sst.max_element((int)x,(int)y+1)<<endl;
    else sst.update((int)x,y);
  }
  return 0;
}



Measured memory_bytes: 5712
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < n; i++)
#define REP(i, a, b) for (int i = a; i < b; i++)
typedef long long ll;
using namespace std;

int main() {
  int n;
  cin >> n;
  vector<int> d(n);
  rep(i, n) cin >> d.at(i);
  sort(d.begin(), d.end());
  int ans = 0;
  ans = d.at(n / 2) - d.at(n / 2 - 1);
  cout << ans << endl;
}

Measured memory_bytes: 640
# import bisect
from collections import Counter, defaultdict, deque
# import copy
# from heapq import heappush, heappop, heapify
# from fractions import gcd
# import itertools
# from operator import attrgetter, itemgetter
# import math

import sys

# import numpy as np

ipti = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)

def main():
    n = int(input())
    initial_num = defaultdict(int)

    for i in range(n):
        s = sys.stdin.readline().rstrip("\n")
        initial = s[0]
        initial_num[initial] += 1

    ans = 0
    march = "MARCH"
    for i in range(3):
        num1 = initial_num[march[i]]
        for j in range(i+1, 4):
            num2 = initial_num[march[j]]
            for k in range(j+1, 5):
                num3 = initial_num[march[k]]
                ans += num1 * num2 * num3

    print(ans)

if __name__ == '__main__':
    main()

Measured memory_bytes: 40300
#include <bits/stdc++.h>
#include <vector>
#include <iostream>
#include<algorithm>
#include<string>
#include <map>
#include <queue>
#include <stack>

#define DIV 1000000007
using namespace std;

int main() {
    int K, S;
    cin >> K >> S;
   
    int ans = 0;
    for (int X = 0; X <= K; X++) {
        for (int Y = 0; Y <= K; Y++) {
            int Z = S - X - Y;
            if (Z <= K && Z >= 0)
                ans++;
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        string S = string.Empty;
        int cnt = 0;
        int ans = 0;
        S = Console.ReadLine();
        foreach (char c in S)
        {
            if (c.ToString() == "A" || c.ToString() == "C" || c.ToString() == "G" || c.ToString() == "T")
            {
                cnt++;
            }
            else
            {
                if (ans < cnt) ans = cnt;
                cnt = 0;
            }
        }
        if (ans > cnt)
        {
            Console.WriteLine(ans);
        }
        else
        {
            Console.WriteLine(cnt);

        }
    }
}



Measured memory_bytes: 13140
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

template <typename T, typename K> struct P {
	T a; K b;
};
typedef struct {
	vector <int> to;
	bool is_visited = false;
} node;
typedef struct {
	int to;
	int cost;
	P <int, int> change;
} edge;
int main( void ){
	int N, K; cin >> N >> K;
	vector <int> vec( N + 1 ), input( N );
	rep( i, 0, N ){
		cin >> input[ i ];
	}
	vec[ 0 ] = 0;
	rep( i, 0, N ){
		vec[ i + 1 ] = vec[ i ] + input[ i ];
	}
	int ans = k_mod;
	rep( i, 0, N - K + 1 ){
		ans = min( ans, input[ i + K-1 ] - input[ i ] + min( abs( input[ i ] ), abs( input[ i + K-1 ] )));
	}
	cout << ans << endl;

}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 1152
using System;
using System.ComponentModel.DataAnnotations;
using System.Globalization;
using System.IO.Pipes;
using System.Runtime.InteropServices;

namespace ConsoleApp2
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] n=Console.ReadLine().Split(' ');

            int a, b;
            a = int.Parse(n[0]);
            b = int.Parse(n[1]);
            int c, d, e;
            c = a + b;
            d = a - b;
            e = a * b;
            if (c >= d && c >= e) Console.WriteLine(c);
            else if (d >= c && d >= e) Console.WriteLine(d);
            else Console.WriteLine(e);

        }

    }
}


Measured memory_bytes: 27416
#include <iostream>
#include <string>
using namespace std;

int main(int argc, char const *argv[]) {
  long long n;
  long long count=0;
  std::cin >> n;

  count=(n/11)*2;
  n%=11;

  if(n>6) count+=2;
  else if(6>=n && n>0)count++;

  std::cout << count << endl;


  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<cstdio>
#include<cmath>
using namespace std;

int main(){
    int n, i = 0; 
    double a[1000], l,  answer;

    while(1){
       cin >> n;
       if(n == 0){
           break;
       }

       /*while(cin>>l){
           a[i] = l;
           m = m + l;
           //printf("%lf ",m);
           if(i == n - 1){
            break;
        }       
           i++;
       }*/

       for(int i = 0; i < n; i++){
           cin >> a[i];
       }
       
       int m = 0;
       for(int i = 0; i < n; i++){
           m += a[i];
       }

       double ave =1.0 *  m / n ;
       //printf("%lf\n",m);
       double P = 0;
       for(int i = 0; i < n; i++){
           P = P + (a[i] - ave)*(a[i] - ave);
       }

       answer = sqrt(P/n);
       printf("%lf\n",answer);

    }

    return 0;
    
       /*for(int i = 0; i < n; i++){
        //m = m + a[i];

        
    }*/
   

}


Measured memory_bytes: 3140
#include <iostream>
#include<string>
#include<cmath>
#include<ciso646>
#include<cstring>
#include<iomanip>


using namespace std;
int main()
{/*二日目*/
	int a, b, c, d; cin >> a >> b >> c >> d;
	while (a > 0 and c > 0) {
		c -= b;
		if (c <= 0) {
			cout << "Yes";
			break;
		}
		a -= d;
		if (a <= 0)
			cout << "No";
	}
	
}

Measured memory_bytes: 3636
#include <cmath>
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <algorithm>
#include <utility>
#include <iomanip>

#define int long long int
#define rep(i, n) for(int i = 0; i < (n); ++i)

using namespace std;

typedef pair<int, int> P;

const int INF = 1e15;
const int MOD = 1e9+7;

signed main(){
    int n;
    cin >> n;

    vector<int> a(n*3);
    rep(i, n*3){
        cin >> a[i];
    }
    sort(a.begin(), a.end(), greater<int>());

    int ans = 0;
    rep(i, 2*n){
        if(i % 2 == 1){
            ans += a[i];
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using itn = int;
using ld = long double;
template<class T>
using vec = vector<T>;

#define FOR(i,a,b) for(int i=((int)(a));i<((int)(b));i++)
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define all(x) (x).begin(),(x).end()


int main(){
  int a,p;
  cin >>a >>p;

  cout <<(int)((a*3+p)/2) <<endl;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
vector<int>a[300001];
struct line{int i,cnt;inline bool operator <(const line &x)const{return cnt>x.cnt;}}b[300001];
int h,w,m,x_[300001],y_[300001],ans,cntx[300001],cnty[300001],vis[300001];
int main()
{
	scanf("%d%d%d",&h,&w,&m);
	for(int i=1;i<=m;i++)scanf("%d%d",&x_[i],&y_[i]),++cntx[y_[i]],++cnty[x_[i]],a[x_[i]].push_back(y_[i]);
	for(int i=1;i<=m;i++)ans=max(ans,cntx[y_[i]]+cnty[x_[i]]-1);
	for(int i=1;i<=w;i++)b[i].i=i,b[i].cnt=cntx[i];
	sort(b+1,b+w+1);
	for(int i=1;i<=h;i++)
	{
		int l1=a[i].size();vis[0]=i;
		for(int j=0;j<l1;j++)vis[a[i][j]]=i;
		for(int j=1;j<=w&&vis[b[j-1].i]==i;j++)if(vis[b[j].i]!=i)ans=max(ans,cnty[i]+b[j].cnt);
	}
	printf("%d",ans);
	return 0;
}


Measured memory_bytes: 28420
#include <bits/stdc++.h>

using namespace std;

#define MOD 1000000007
#define N 100005
#define M 30
#define ll long long 
#define ld long double
#define pb push_back
#define ff first
#define ss second

int main(){
	ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int n; cin>>n;
	int d = n%10;
	if(d == 3){
		cout<<"bon";
	}
	else if(d == 0 || d == 1 || d == 6 || d == 8){
		cout<<"pon";
	}
	else{
		cout<<"hon";
	}
	return 0;
}

Measured memory_bytes: 3620
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef long double ld;

int main(){
    ios_base::sync_with_stdio(false), cin.tie(0);
    cout.precision(10);
    cout << fixed;

    int n;
    cin >> n;
    ll res = 0;
    for(int len=1; len<=n; len++){
        ll br = n-len+1;
        res += br*len;
    }
    for(int i=1; i<=n-1; i++){
        ll a, b;
        cin >> a >> b;
        if(a > b) swap(a, b);
        res -= a*(n-b+1);
    }
    cout << res;
    return 0;
}


Measured memory_bytes: 3636
sx,sy,tx,ty=map(int,input().split())
x=tx-sx
y=ty-sy
print('R'*x+'U'*y+'L'*x+'D'*y+'D'*1+'R'*(x+1)+'U'*(y+1)+'L'*1+'U'*1+'L'*(x+1)+'D'*(y+1)+'R'*1)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
const long long inf = 1e15;
typedef long long ll;
typedef long double ld;
typedef pair <ll, ll> pii;

void faster()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
}

const ll MAXN = 1e6 + 10;
const ll N = 4000 + 10;
const ll MN = 200 + 10;
const ll mod = 1e6;

ll a[MAXN] , dp[MAXN];
pii p[MAXN];


int main()
{
	faster();
	int n , k;
	cin >> n >> k;
	for (int i = 0; i < n; i++)
		dp[i] = inf;
	for (int i = 0; i < n; i++)
		cin >> a[i];
	dp[0] = 0;
	for (int i = 1; i < n; i++)
	{
		for (int j = 1; j <= k; j++)
		{
			if(i - j >= 0)
			{
				dp[i] = min(dp[i], dp[i - j] + abs(a[i] - a[i - j]));
			}
			else
				break;
		}
	}
	cout << dp[n - 1] << endl; 
}

Measured memory_bytes: 6400
#include<bits/stdc++.h>
using namespace std;

#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPL(i,a,n) for(ll i=a;i<n;++i)
#define RUP(a,b) ((a+b-1)/(b))
#define ENT "\n"
#define SORTVG(v) sort(v.begin(),v.end(),greater<>())
#define SORTV(v) sort(v.begin(),v.end())
#define ALL(v) (v).begin(),(v).end()
//#define MOD 1000000007
#define MOD 998244353
#define INF LLONG_MAX/2
#define int long long

typedef long long ll;
typedef tuple<int,int,bool> Tb;
typedef pair<int,int> Pii;
typedef vector<int> Vi;

template<class T> void chmax(T& a, T b) {if(a < b){a=b;}}
template<class T> void chmin(T& a, T b) {if(a > b){a=b;}}
template<class T> void YesNo(T& a) {if(a){cout << "Yes" << ENT;}else{cout << "No" << ENT;}}
template<class T> void YESNO(T& a) {if(a){cout << "YES" << ENT;}else{cout << "NO" << ENT;}}
template<class T> void AorB(T& a, string A,string B) {if(a){cout << A << ENT;}else{cout << B << ENT;}}

int atcoder(){
	int a,b;
  	cin>>a>>a>>b;
  	if((a-b)%2 == 0) cout<<"Alice"<<ENT;
  	else cout<<"Borys"<<ENT;
}


signed main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    atcoder();
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define very_slow       ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define int             long long int
int32_t main()
{   
	very_slow
//	no_of_test(x)
	{
      int n;
	  cin>>n;
	  int cnt=0;
	 /* map<int,int>mp;
	  for(int i=1;i<=n-1;i++)
	  {
		  for(int j=1;j<=n-1;j++)
		  {
			  if(i*j<=n-1)
			  {
				  mp[i*j]++;
			  }
		  }
	  }
	  int cnt=0;
	  for(auto x:mp)
	  {
         cnt+=x.second;
	  }*/
	  int w=1;
      while(w<n)
	  {   int r;
	      if(n%w==0)
		  {
			  r=(n/w)-1;
		  }
		  else
		  {
			  r=(n/w);
		  }
		  
		  cnt+=(r);
		  w++;
	  }
	  int k=sqrt(n);
	  cout<<cnt<<'\n';
	}
	return 0;
}

Measured memory_bytes: 3604
#include <bits/stdc++.h>
 
#define ALL(l)  (l).begin(),(l).end()
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;
typedef long long ll;
//const ll mod =  1000000007;
//const ll maxn = 1000000000;

//---------------------------------------------------------------------------------------------------
using vi = vector<int>; // intの1次元の型に vi という別名をつける
using vll = vector<ll>; // intの1次元の型に vi という別名をつける
using vvll = vector<vll>; // intの2次元の型に vvi という別名をつける
using vs = vector<string>; // stringの1次元の型に vs という別名をつける
using pll = pair<ll, ll>; // これ以降 pii という型名はpair<ll, ll> と同じ意味で使える
//---------------------------------------------------------------------------------------------------

int main(){
   ll n,ans=0;
   cin>>n;
   vll a(n+1),b(n);
   rep(i,n+1){
       cin>>a.at(i);
   }
   rep(i,n)cin>>b.at(i);
   if(a.at(0)>b.at(0)){
       ans+=b.at(0);
       b.at(0)=0;
   }else{
       ans+=a.at(0);
       b.at(0)-=a.at(0);
   }
   rep(i,n-1){
         if(a.at(i+1)>b.at(i)){
           ans+=b.at(i);
           a.at(i+1)-=b.at(i);
           b.at(i)=0;
       }else{
           ans+=a.at(i+1);
           b.at(i)-=a.at(i+1);
           a.at(i+1)=0;
       }  
       if(a.at(i+1)>b.at(i+1)){
           ans+=b.at(i+1);
           a.at(i+1)-=b.at(i+1);
           b.at(i+1)=0;
       }else{
           ans+=a.at(i+1);
           b.at(i+1)-=a.at(i+1);
           a.at(i+1)=0;
   }  
   
   }
   if(a.at(n)>b.at(n-1)){
       ans+=b.at(n-1);
       b.at(n-1)=0;
   }else{
       ans+=a.at(n);
       b.at(n-1)-=a.at(n);
   }
   cout<<ans<<endl;
}
   



Measured memory_bytes: 1792
#include<cstdio>
#include<iostream>
#include<algorithm>
#define inf 200010
using namespace std;
#define ran 100010
#define i64 long long int
int n,L[ran],R[ran];
i64 sumL[ran],sumR[ran];
i64 calc_lef(int lef,int rig){
	if(lef > rig)
		lef = rig+1;
	else
	if(lef < rig)
		rig = lef;

	if(lef == rig+1){
		return sumL[rig] * 2 - sumR[lef] * 2;
	}
	if(lef == rig){
		if(lef == 0 && rig == 0)
			return 0;
		return sumL[rig] * 2 - L[n-rig+1] - sumR[lef] * 2 + labs(L[n-rig+1]);
	}
}
i64 calc_rig(int lef,int rig){
	if(lef > rig)
		lef = rig;
	else
	if(lef < rig)
		rig = lef + 1;
	if(rig == lef+1){
		return sumL[rig] * 2 - sumR[lef] * 2;
	}
	if(lef == rig){
		if(lef == 0 && rig == 0)
			return 0;
		return sumL[rig] * 2 - sumR[lef] * 2 + labs(R[lef]) + R[lef];
	}
}
int main(){
	scanf("%d",&n);
	for(int i=1; i<=n; i++){
		scanf("%d%d",&L[i],&R[i]);
		L[i] = L[i] * 2;
		R[i] = R[i] * 2;
	}
	sort(L+1,L+n+1);
	sort(R+1,R+n+1);
	for(int i=1; i<=n; i++)
		sumR[i] = sumR[i-1] + R[i];
	for(int i=n,t=0; i>=1; i--,t++)
		sumL[t+1] = sumL[t] + L[i];
	long long int res = 0;
	for(int mid=-inf; mid<=inf; mid++){
		int cnt_lef = lower_bound(R+1,R+n+1,mid)-R-1;
		int cnt_rig = n+1-(upper_bound(L+1,L+n+1,mid)-L);
		if(mid <= 0)
		res = max(res, calc_lef(cnt_lef, cnt_rig));
		if(mid >= 0)
		res = max(res, calc_rig(cnt_lef, cnt_rig));
	}
	cout << res / 2 << endl;
	return 0;
}


Measured memory_bytes: 2560
#include<bits/stdc++.h>
using namespace std;
typedef signed long long ll;
 
#define REP(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) REP(i,0,n)

int main(){
	int i,j,k,n,m,l,f,x,y,z; string s;
	cin >> n;
	int h[105] = {0};
	rep(i, n) cin >> h[i];

	f = h[0];
	rep(i, n){
		if(h[i] <= h[i+1]){
			f += h[i+1] - h[i];
		}
	}
	cout << f << endl;
}	

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main(){
  int a,b;
  cin>>a;
  b=0;
  vector<int> c(a);
    for(int i=0;i<a;i++)
      cin>>c.at(i);
  for(int i=1;i<a-1;i++){
if(c.at(i-1)<c.at(i)&&c.at(i)<c.at(i+1))
  b++;
   else if(c.at(i-1)>c.at(i)&&c.at(i)>c.at(i+1))
     b++;
  }
  cout<<b<<endl;
}

Measured memory_bytes: 256
require 'prime'
n = gets.chomp.to_i

def fact(n)
  return 1 if n <= 1
  n * fact(n-1)
end

def num_div(d, divs)
  num_divs = []
  begin
    divs.each_index { |i| num_divs.push(d.select { |e| e >= divs[i] - 1 }.size - i) }
    if divs == [5, 5, 3]
      num_divs.reduce(1) { |mul, e| mul * e } / 2
    else
      num_divs.reduce(1) { |mul, e| mul * e }
    end
  rescue NoMethodError
    0
  end
end

f = fact(n)
count = 0
d = f.prime_division.map { |e| e.last }
[[75], [25, 3], [15, 5], [5, 5, 3]].each do |divs|
  n = num_div(d, divs)
  count += n
end
puts count


Measured memory_bytes: 2044
import java.io.BufferedReader;
import java.io.*;
import java.util.*;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
import java.util.Collections;
import java.util.Arrays;

public class Main {
	public static void main(final String[] args){
    
    final Scanner sc = new Scanner(System.in);
    final List<Integer> list = new ArrayList<>();

    int n = sc.nextInt();
    int m = sc.nextInt();
    int c = sc.nextInt();
    int hairetu1[] = new int[m];
    int hairetu2[][] = new int[n][m];
    int count = 0;
    int sum = 0;

    for(int i = 0 ; i < m ; i++){
        hairetu1[i] = sc.nextInt();
    }

    for(int i = 0 ; i < n ; i++){
        for(int j = 0 ; j < m ; j++){
            hairetu2[i][j] = sc.nextInt();
        }
    }

    for(int i = 0; i < n ; i++){
        for(int j = 0 ; j < m ; j++){
            sum += hairetu1[j] * hairetu2[i][j];
            //System.out.println(sum);
        }
        if(sum > -c){
            count++;
        }
        sum = 0;
    }

    System.out.println(count);







}
}

Measured memory_bytes: 37296
import java.util.*;

public class Main {
    public static final int MAX_WEIGHT = 1_000_000_000;

    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        int n = scanner.nextInt();
        int m = scanner.nextInt();
        int[] d = new int[n];
        int[] toMin = new int[n];
        int[] curMin = new int[n];
        int[] edgeMin = new int[n];
        Arrays.fill(curMin, Integer.MAX_VALUE);

        for (int i = 0; i < n; i++) {
            d[i] = scanner.nextInt();
        }

        int u, v;
        for (int i = 0; i < m; i++) {
            u = scanner.nextInt()-1;
            v = scanner.nextInt()-1;
            if(curMin[u]>d[v]){
                toMin[u] = v;
                curMin[u] = d[v];
                edgeMin[u] = i;
            }
            if(curMin[v]>d[u]){
                toMin[v] = u;
                curMin[v] = d[u];
                edgeMin[v] = i;
            }
        }

        for (int i = 0; i < n; i++) {
            if(d[i]<curMin[i]){
                System.out.println(-1);
                return;
            }
        }


        int n1 = toMin.length;
        Boolean[] nodeColors = new Boolean[n1];
        Integer[] edgeWeights = new Integer[m];
        Stack<Integer> stack = new Stack<>();

        for (int i = 0; i < n1; i++) {
            if(nodeColors[i]!=null) continue;
            stack.push(i);
            while (!stack.isEmpty()){
                Integer peeked = stack.peek();
                if(nodeColors[toMin[peeked]]!=null){
                    nodeColors[peeked]=!nodeColors[toMin[peeked]];
                    edgeWeights[edgeMin[peeked]] = d[peeked];
                    stack.pop();
                }else{
                    if(d[toMin[peeked]]== d[peeked]){
                        toMin[toMin[peeked]] = peeked;
                        nodeColors[toMin[peeked]] = true;
                        nodeColors[peeked] = false;
                        edgeWeights[edgeMin[peeked]] = d[peeked];
                        stack.pop();
                    }else{
                        stack.push(toMin[peeked]);
                    }
                }
            }
        }

        for (int i = 0; i < edgeWeights.length; i++) {
            if (edgeWeights[i] == null) edgeWeights[i] = MAX_WEIGHT;
        }

        for (boolean color: nodeColors) {
            System.out.print(color ? "B" : "W");
        }
        System.out.println();
        for (int w : edgeWeights) {
            System.out.println(w);
        }
    }
}

Measured memory_bytes: 158372
#include <stdio.h>
#include <string.h>

int main(void)
{
    int i, j, k;
    int n, m, s;
    int dp[50][3001];
    
    while (1){
        scanf("%d%d%d", &n, &m, &s);
        
        if (n == 0){
            break;
        }
        
        memset(dp, 0, sizeof(dp));
        dp[0][0] = 1;
        
        for (i = 1; i <= m; i++){
            for (j = n * n; j >= 1; j--){
                for (k = i; k <= s; k++){
                    dp[j][k] += dp[j - 1][k - i];
                    if (dp[j][k] >= 100000){
                        dp[j][k] -= 100000;
                    }
                }
            }
        }
        
        printf("%d\n", dp[n * n][s]);
    }
    
    return (0);
}

Measured memory_bytes: 992
#include <bits/stdc++.h>
using namespace std;
#define repr(i,a,b) for(int i=a;i<b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define reprrev(i,a,b) for(int i=b-1;i>=a;i--) // [a, b)
#define reprev(i,n) reprrev(i,0,n)
typedef long long ll;
typedef unsigned long long ull;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

/* attention
    long longのシフト演算には気をつけよう
    タイポした時のデバッグが死ぬほどきつくなるので変数名は最低3字くらい使った方がいいかも
    sizeは(int)とキャストしよう
    cin.tie(0);
    ios::sync_with_stdio(false);<- これら、printfとかと併用しない方が良さそう

*/

const ll mod = 1e9+7;

void chmod(ll &M){
    if(M >= mod) M %= mod;
    else if(M < 0){
        M += (abs(M)/mod + 1)*mod;
        M %= mod;
    }
}

ll modpow(ll x, ll n){
    if(n==0) return 1;
    ll res=modpow(x, n/2);

    if(n%2==0) return res*res%mod;
    else return res*res%mod*x%mod;
}

int getl(int i, int N) { return i==0? N-1:i-1; };
int getr(int i, int N) { return i==N-1? 0:i+1; };


// 線分 ab の偏角 返り値は[-π, π]
double argument(const pair<double, double> &a, const pair<double, double> &b){
    double ax=a.first, ay=a.second, bx=b.first, by=b.second;
    return atan2(by-ay, bx-ax);
}

/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */
/* <-----------------------------------------------------------------------------------> */



int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);

    int N; cin >> N;
    vector<long double> x(N), y(N);
    rep(i, N) cin >> x[i] >> y[i];

    vector<int> p(N);
    rep(i, N) p[i] = i;

    int cnt = 0;
    long double ans = 0.0;

    do{
        ++cnt;
        repr(i, 1, N){
            ans += sqrt((x[p[i]]-x[p[i-1]])*(x[p[i]]-x[p[i-1]]) + (y[p[i]]-y[p[i-1]])*(y[p[i]]-y[p[i-1]]));
        }
    } while(next_permutation(p.begin(), p.end()));

    ans /= cnt;
    cout << setprecision(15) << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<stack>
#include<queue>
#include<map>
#include<vector>
#include<string>
#include<list>
using namespace std;
typedef long long llong;
llong gcd(llong a, llong b) {
	if (a < b) swap(a, b);
	if (a % b == 0) return b;
	else return gcd(b, a % b);
}
llong lcm(llong a, llong b) {
	llong g = gcd(a, b);
	return a * b / g;
}
//ここまで共通
llong N;
int a;
int b;
int c, d;
int KETASUU(llong n) {
	if (1 <= n && n <= 9) {

		return 1;
	}
	else {
		return 1 + KETASUU(n / 10);
	}
}

int MM(llong n) {
	if (1 <= n && n <= 9) {

		return n;
	}

	else return MM(n / 10);
}

int main() {
	cin >> N;
	if (1 <= N && N <= 9) cout << N;
	else {

		a = KETASUU(N);
		b = MM(N);

		c = KETASUU(N+1);
		d = MM(N+1);

		cout << max((a - 1) * 9 + b - 1,(c - 1) * 9 + d - 1);
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
 
#define _overload(_1,_2,_3,name,...) name
#define _rep(i,n) _range(i,0,n)
#define _range(i,a,b) for(int i=(int)(a);i<(int)(b);++i)
#define rep(...) _overload(__VA_ARGS__,_range,_rep,)(__VA_ARGS__)
 
#define _rrep(i,n) _rrange(i,n,0)
#define _rrange(i,a,b) for(int i=(int)(a)-1;i>=(int)(b);--i)
#define rrep(...) _overload(__VA_ARGS__,_rrange,_rrep,)(__VA_ARGS__)
 
#define _all(arg) begin(arg),end(arg)
#define uniq(arg) sort(_all(arg)),(arg).erase(unique(_all(arg)),end(arg))
#define getidx(ary,key) lower_bound(_all(ary),key)-begin(ary)
#define clr(a,b) memset((a),(b),sizeof(a))
#define bit(n) (1LL<<(n))
 
// #define DEBUG
 
#ifdef DEBUG
    #define dump(...) fprintf(stderr, __VA_ARGS__)
#else
    #define dump(...)
#endif
 
template<class T>bool chmax(T &a, const T &b) { return (a<b)?(a=b,1):0;}
template<class T>bool chmin(T &a, const T &b) { return (b<a)?(a=b,1):0;}
 
using namespace std;
using ll=long long;
using vi=vector<int>;
using vll=vector<ll>;
 
const double EPS = 1e-10;
const double PI = acos(-1.0);
const ll inf =1LL << 62;
const ll mod=1000000007LL;
const int dx[4]={1,0,-1,0};
const int dy[4]={0,1,0,-1};
 
 
ll extgcd(ll a,ll b,ll& x,ll& y){x=1,y=0;ll g=a;if(b!=0) g=extgcd(b,a%b,y,x),y-=a/b*x;return g;}
ll ADD(const ll &a, const ll &b,const ll &mod) { return (a+b)%mod;}
ll SUB(const ll &a, const ll &b,const ll &mod) { return (a-b+mod)%mod;}
ll MUL(const ll &a, const ll &b,const ll &mod) { return (1LL*a*b)%mod;}
ll DIV(const ll &a, const ll &b,const ll &mod) {ll x,y; extgcd(b,mod,x,y);return MUL(a,(x+mod)%mod,mod);}
 
random_device rd;
mt19937 mt(rd());
uniform_int_distribution<int> dice(1,6);
uniform_real_distribution<double> score(0.0,10.0);

int main(void){
    cin.tie(0);
    ios::sync_with_stdio(false);

    int n, A, B; cin >> n >> A >> B;
    vll a(n); for(auto& e : a) cin >> e;

    sort(_all(a), greater<ll>());
    using R = long double;
    R res = 0;
    ll last = -1; int num = -1, snum = -1, cnt = 0;
    rep(i, n){
        if(last != a[i]){
            if(cnt == A) break;
            last = a[i];
            num = 0;
            snum = 0;
        }
        num++;
        if(cnt < A){
            res += a[i];
            cnt++;
            snum++;
        }
    }

    ll occ= 0;
    int l = snum, u = snum + 1;
    if(snum == A){
        u = min(B + 1, num + 1);
    }
    rep(k, l, u){
        int a = 1, b = 1;
        ll cur = 1;

        rep(i, 1, num + 1){
            cur *= i;
            while(a <= k and cur % a == 0) cur /= a, a++;
            while(b <= num - k and cur % b == 0) cur /= b, b++;
        }
        occ += cur;
    }

    res /= A;
    cout.precision(20);
    cout << fixed << res << endl;
    cout << occ << endl;

    return 0;
}


Measured memory_bytes: 256
N,X = list(map(int,input().split()))

burgerLengthList = [[] for i in range(51)]
for i in range(51):
    burgerLengthList[i].append(2 ** (i + 2) - 3)
    burgerLengthList[i].append(2 ** (i + 1) - 1)

def pNumber(level, number):
    if level == 0:
        return 1
    if number == 1:
        return 0
    if number <= burgerLengthList[level][0] // 2:
        return pNumber(level - 1, number - 1)
    elif number == burgerLengthList[level][0] // 2 + 1:
        return pNumber(level - 1, number - 1) + 1
    else:
        return burgerLengthList[level - 1][1] + 1 + pNumber(level - 1, number - burgerLengthList[level - 1][0] - 2)

print(pNumber(N, X))

Measured memory_bytes: 9224
#include <algorithm>
#include <cassert>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

#include <limits.h>

using namespace std;

typedef long long ll;

template<class T>
inline bool chmax(T &a, T b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}

template<class T>
inline bool chmin(T &a, T b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}

bool cond(const int n) {
    vector<int> divs;
    for (int i = 1; i * i <= n; i++) {
        if (n % i == 0) {
            divs.push_back(i);
            if (i * i != n) {
                divs.push_back(n / i);
            }
        }
    }

    // printf("%d: ", n);
    // for (auto &d : divs) {
    //     cout << d << " ";
    // }
    // cout << endl;

    return ((int) divs.size()) == 8;
}

int main(void) {
    int N;
    cin >> N;

    int cnt = 0;
    for (int i = 1; i <= N; i += 2) {
        if (cond(i)) {
            cnt++;
        }
    }
    cout << cnt << endl;

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define Int long long
using namespace std;

const int MAXN=500005;
const long MOD=(long)(1e9+7);
vector<int> adj[MAXN];
vector<pair<int,int>> G[MAXN];

Int N,M,K;
Int B,C,H,W;
Int X,Y,Z;
vector<Int> A;

Int ceilS(Int x,Int y){
    return (x+y-1)/y;
}
using D=long double;

Int perform(Int x){
    return (x*(x+1))/2LL;
}

int main()
{
        cin>>N;
        Int ans=N*(N-1);
        cout<<ans/2<<"\n";
}


Measured memory_bytes: 27024
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <string>
#include <stdlib.h>
#include <numeric>
#include <cmath>
#define mod 1000007
typedef long long ll;
using namespace std;

int main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    ll a,p;
    cin>>a>>p;
    cout<<((3*a+p)/2)<<"\n";
    
   
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <cstdio>
#include <string>
#include <map>
#include <set>
#include <locale.h>
#include <vector>
#include <iomanip>
#include <cassert>
#include <cstring>

#define all(x) x.begin(), x.end()
#define sz(x) (int)(x.size())
#define pb push_back
#define mp make_pair
#define endl "\n"
#define rep(i,x,y) for(int i = x; i <= y; ++i)
#define repr(i,x,y) for(int i = x; i >= y; --i)
#define y1 wearsdfasdf
#define fi first
#define se second

typedef long long ll;

const int N = (int)(5e5) + 322;
const ll INF = (ll)(1e9) + 7;
const double eps = (1e-9);

using namespace std;


ll n, m, a[1111][1111], b[1111];

int main () {
  cin >> n >> m;
  rep(i, 1, n) {
    rep(j, 1, m) {
      cin >> a[i][j];
    }
  }
  rep(i, 1, m) {
    cin >> b[i];
  }
  rep(i, 1, n) {
    ll sum = 0;
    rep(j, 1, m) {
      sum += a[i][j] * b[j];
    }
    cout << sum << endl;
  }
  
  return 0;
}

Measured memory_bytes: 3544
#include "iostream"
#include "climits"
#include "list"
#include "queue"
#include "stack"
#include "set"
#include "functional"
#include "algorithm"
#include "string"
#include "map"
#include "unordered_map"
#include "unordered_set"
#include "iomanip"
#include "cmath"
#include "random"
#include "bitset"
#include "cstdio"
#include "numeric"
#include "cassert"
#include "ctime"


using namespace std;

constexpr long long int MOD = 1000000007;
//constexpr int MOD = 1000000007;
//constexpr int MOD = 998244353;
//constexpr long long int MOD = 998244353;
constexpr double EPS = 1e-12;

//int N, M, K, T, H, W, L, R;
long long int N, M, K, T, H, W, L, R;

long long int power(long long int x, long long int n, long long int M) {
	long long int ret = 1;
	long long int by = x;
	while (n) {
		if (n & 1) {
			ret *= by;
			ret %= M;
		}
		by *= by;
		by %= M;
		n >>= 1;
	}
	return ret;
}

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);

	cin >> N;
	long long int ans = 0;
	vector<long long int>by(100001, 1);
	vector<long long int>rev(100001, 1);
	for (int i = 1; i <= 100000; i++) {
		by[i] = by[i - 1] * i%MOD;
		rev[i] = power(by[i], MOD - 2, MOD);
	}
	for (int i = 1; i <= N / 3; i++) {
		ans += by[N - 2 * i - 1] * rev[N - 3 * i] % MOD*rev[i - 1] % MOD;
		ans %= MOD;
	}
	cout << ans << endl;
}

Measured memory_bytes: 4780
#include <iostream>
#include <vector>
using namespace std;

int main()
{
	int n, c, f;
	cin >> n;
	vector<int> v(n);
	for (int i = 0; i < n; i++)
		cin >> v[i];
	f = abs(v[1] - v[0]);
	c = 0;
	for (int i = 2; i < n; i++) {
		int x = f;
		if (f + abs(v[i] - v[i - 1]) > c + abs(v[i] - v[i - 2])){
			f = c + abs(v[i] - v[i - 2]);
		}
		else {
			f = f + abs(v[i] - v[i - 1]);
		}
		c = x;
	}
	cout << f;
}


Measured memory_bytes: 640
// Author: wlzhouzhuan
#pragma GCC optimize(2)
#pragma GCC optimize(3)
#include <bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
#define rint register int
#define rep(i, l, r) for (rint i = l; i <= r; i++)
#define per(i, l, r) for (rint i = l; i >= r; i--)
#define mset(s, _) memset(s, _, sizeof(s))
#define pb push_back
#define pii pair <int, int>
#define mp(a, b) make_pair(a, b)

inline int read() {
  int x = 0, neg = 1; char op = getchar();
  while (!isdigit(op)) { if (op == '-') neg = -1; op = getchar(); }
  while (isdigit(op)) { x = 10 * x + op - '0'; op = getchar(); }
  return neg * x;
}
inline void print(int x) {
  if (x < 0) { putchar('-'); x = -x; }
  if (x >= 10) print(x / 10);
  putchar(x % 10 + '0');
}

long long n, m;

int main() {
  cin >> n >> m;
  cout << n * (n - 1) / 2 + m * (m - 1) / 2 << '\n';  
}

Measured memory_bytes: 256
import sys
input = lambda: sys.stdin.readline().rstrip() 
sys.setrecursionlimit(10**7)
INF = 10**20
def I(): return int(input())
def F(): return float(input())
def S(): return input()
def LI(): return [int(x) for x in input().split()]
def LI_(): return [int(x)-1 for x in input().split()]
def LF(): return [float(x) for x in input().split()]
def LS(): return input().split()

def resolve():
    H1, M1, H2, M2, K = LI()

    print((60*H2+M2)-(60*H1+M1)-K)

if __name__ == '__main__':
    resolve()

Measured memory_bytes: 9208
import math
def plot(x,y):
    print(f'{x:.8f} {y:.8f}')
def Koch(n, x1,y1,x2,y2):
    if n == 0:
        plot(x1,y1)
        return
    sx=(2*x1+x2)/3
    sy=(2*y1+y2)/3
    tx=(x1+2*x2)/3
    ty=(y1+2*y2)/3
    ux=(tx-sx)*(1/2)-(ty-sy)*(math.sqrt(3)/2)+sx
    uy=(tx-sx)*(math.sqrt(3)/2)+(ty-sy)*(1/2)+sy
    Koch(n-1, x1,y1, sx,sy)
    Koch(n-1, sx,sy, ux,uy)
    Koch(n-1, ux,uy, tx,ty)
    Koch(n-1, tx,ty, x2,y2)
    
n=int(input())
Koch(n, 0,0, 100,0)
plot(100,0)


Measured memory_bytes: 5752
import java.io.*;
import java.util.*;

class Main
{
    public static void main(String args[])throws Exception
    {
        BufferedReader bu=new BufferedReader(new InputStreamReader(System.in));
        String s=bu.readLine();
        String ans="";
        if(s.equals("ABC")) ans="ARC";
        else ans="ABC";
        System.out.print(ans);
    }
}


Measured memory_bytes: 32548