akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define sync ios_base::sync_with_stdio(false), cin.tie(NULL)
#define F first
#define S second
#define eb emplace_back
#define pb emplace_back
#define mt make_tuple
#define gcd __gcd
#define PI 3.141592653589
// Input
#define in(a) scanf("%d",&a)
#define in2(a,b) scanf("%d%d",&a,&b)
#define in3(a,b,c) scanf("%d%d%d",&a,&b,&c)
#define llin(a) cin >> a
#define inl(a) scanf("%lld",&a)
#define read(v,i,n) for(i=0;i<n;i++)in(v[i])
#define twod(mat,i,j,n,m) rep(i,n){rep(j,m)in(mat[i][j]);}
#define sc(ch) scanf("%c",&ch)
#define sstr(str) scanf("%s",str)
// Output
#define pr(a) printf("%d ",a)
#define pr2(a,b) printf("%d %d\n",a,b)
#define pr3(a,b,c) printf("%d %d %d\n",a,b,c)
#define out(a) printf("%d\n",a)
#define outl(a) printf("%lld\n",a)
#define llpr(a) cout << a << " "
#define llout(a) cout << a << "\n"
#define yes printf("YES\n")
#define no printf("NO\n")
#define lin printf("\n")
// Iterator
#define lp(i,a,b) for(i=a;i<b;i++)
#define rep(i,n) for(i=0;i<n;i++)
#define all(vec) vec.begin(),vec.end()
#define lower(v,k) lower_bound(v.begin(),v.end(),k)-v.begin()
#define upper(v,k) upper_bound(v.begin(),v.end(),k)-v.begin()
#define tf(mytuple) get<0>(mytuple)
#define ts(mytuple) get<1>(mytuple)
#define tt(mytuple) get<2>(mytuple)
// Debug
#define dbg(v,i,n) for(i=0;i<n;i++)pr(v[i]); lin
#define what(x) cerr << #x << " : " << x << "\n"
#define ck printf("continue\n")
#define debug(args...) { string _s = #args; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); err(_it, args); }
void err(istream_iterator<string> it) {}
template<typename T, typename... Args>
void err(istream_iterator<string> it, T a, Args... args)
{
	cerr << *it << " = " << a << "\n";
	err(++it, args...);
}
// Data Type
#define ll long long int
#define ii pair<int,int>
#define pli pair<ll,int>
#define triple tuple<int,int,int>
#define vi vector<int>
#define vii vector<pair<int,int> >
#define vvi vector<vector<int> >
#define viii vector<pair<pair<int,int>,int> >
#define vvii vector<vector<pair<int,int> > >
#define M 1000000007
#define P 3000  //check the limits, man
#define N 55
const ll INF = 1e18;
int main()
{
    int i,n,a,j;
    in2(n,a);
    vi v(n);
    read(v,i,n);
    rep(i,n)
        v[i]-=a;
    map<ii,ll> dp;
    dp[{0,0}]=1;
    rep(i,n)
    {
        a=v[i];
        for(j=-P;j<P;j++)
            dp[{i+1,j}]=dp[{i,j}]+dp[{i,j-a}];
    }
    ll ans=dp[{n,0}];
    llout(ans-1);
}


Measured memory_bytes: 19584
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <vector>
#include <queue>
#include <cmath>
#include <stack>
#include <set>
#include <map>
typedef long long ll;
using namespace std;

int main(){
  double n,m,d;
  cin >> n >> m >> d;
  double ans;

  if(d == 0){
    ans = (m - 1) / n;
  } else {
    ans = (m - 1) * 2 * (n - d) / (n * n);
  }

  printf("%.10lf\n",ans);
  return 0;
}


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

#define int         long long
#define pb          push_back
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define x           first
#define y           second
#define sz(x)       (int)x.size()
#define endl        '\n'
#define hell        1000000007
#define rep(i,a,b)  for(int i=a;i<b;i++)
using namespace std;
int a,b,c,k;
void solve(){
    cin>>a>>b>>c>>k;
    if(k%2){
        cout<<b-a<<endl;
    }
    else{
        cout<<a-b<<endl;
    }
}

signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    int t=1;
    // cin>>t;
    while(t--){
        solve();
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <cmath>

using namespace std;

const double pi = 3.141592653589793238462;

int main() {
  int A, B, H, M;
  cin >> A >> B >> H >> M;
  double hrad = (2.0 * pi * (60.0 * H + M)) / (60.0 * 12.0);
  double mrad = (2.0 * pi * M) / 60.0;
  double hx = A * cos(hrad);
  double hy = A * sin(hrad);
  double mx = B * cos(mrad);
  double my = B * sin(mrad);
  double dx = hx - mx;
  double dy = hy - my;
  double result = sqrt(dx * dx + dy * dy);
  cout << setprecision(15) << result << endl;
  return 0;
}


Measured memory_bytes: 4128
# -*- coding: utf-8 -*-

import sys
from collections import Counter

def input(): return sys.stdin.readline().strip()
def list2d(a, b, c): return [[c] * b for i in range(a)]
def list3d(a, b, c, d): return [[[d] * c for j in range(b)] for i in range(a)]
def ceil(x, y=1): return int(-(-x // y))
def INT(): return int(input())
def MAP(): return map(int, input().split())
def LIST(): return list(map(int, input().split()))
def Yes(): print('Yes')
def No(): print('No')
def YES(): print('YES')
def NO(): print('NO')
sys.setrecursionlimit(10 ** 9)
INF = float('inf')
MOD = 10 ** 9 + 7

N = INT()
A = Counter()
for i in range(N):
    A[''.join(sorted(input()))] += 1

ans = 0
for k, v in A.items():
    ans += v*(v-1) // 2
print(ans)


Measured memory_bytes: 18232
//#pragma once
#include <stdio.h>
#include <string>
#include <iostream>
#include <queue>
#include <algorithm>
#include <sstream>
#include <vector>
#include <math.h>
#include <set>

using namespace std;

long long N, M, K,a,b;
long long A[200001];
bool f[601][601];
string S;
set <long long>sll;
vector <long long>vll;
typedef pair<long long, long long> pl;
pl buf;

int main() {
	cin >> K;
	M = 0;
	N = 0;
	for (int i = 0; i < K; i++) {
		cin >> A[i];
		A[i] -= i + 1;
		vll.push_back(A[i]);
	}
	if (K == 1) {
		cout << 0 << endl;
	}
	else if (K == 2) {
		cout << abs(A[0]-A[1]) << endl;
	}
	else {
		sort(vll.begin(), vll.end());
		a = vll[K / 2 - 1];
		b = vll[K / 2];
		for (int i = 0; i < K; i++) {
			M += abs(vll[i] - a);
			N += abs(vll[i] - b);
		}


		cout << min(N, M) << endl;
	}

	return 0;
}


Measured memory_bytes: 4596
#include <stdio.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);
    if(a<b){
        printf("a < b\n");
        }else if(a>b){
        printf("a > b\n");
        }else{
        printf("a == b\n");
        }
    return 0;
}

Measured memory_bytes: 580
#include<iostream>
#include<vector>
#include<algorithm>
#include<iomanip>
#include<utility>
#include<iomanip>
#include<map>
#include<queue>
#include<cmath>
#include<cstdio>

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

using namespace std;
using ll =long long;
using P = pair<int,int>;

int num;
bool large=false;

void dfs(int red, int green, int blue, int count){
    if(count > num) return;
    
    if(red < green && green < blue) large=true;
    
    dfs(red * 2, green, blue, count+1);
    dfs(red, green * 2, blue, count+1);
    dfs(red, green, blue * 2, count+1);
}

int main(int argc, const char * argv[]) {
    int red, green, blue;
    
    
    cin >> red >> green >> blue;
    cin >> num;
    
    dfs(red, green, blue, 0);
    
    if(large) cout << "Yes" << endl;
    else cout << "No" << endl;
    
    return 0;
}


Measured memory_bytes: 3076
package main

import (
	"fmt"
	"strings"
	"strconv"
)

func calcWa(n int) int {
	var sum, vv int
	narr := strings.Split(strconv.Itoa(n), "")
	for _, v := range narr {
		vv, _ = strconv.Atoi(v)
		sum += vv
	}
	return sum
}

func main() {
	var N, A, B int
	var sum int

	fmt.Scan(&N)
	fmt.Scan(&A)
	fmt.Scan(&B)

	for i := 1; i <= N; i++ {
		if wa := calcWa(i); A <= wa && wa <= B {
			sum += i
		}
	}

	fmt.Println(sum)
}

Measured memory_bytes: 1280
N = int(input())

def dfs(s, n):
    if len(s) == N:
        return [s]
    ret = []
    for i in range(n):
        ret += dfs(s + chr(i + ord('a')), n)
    ret += dfs(s + chr(n + ord('a')), n+1)
    return ret

for w in dfs('', 0):
    print(w)

Measured memory_bytes: 13316
n = int(input())
A = list(map(int,input().split()))
def gcd(x,y):
    a = max(x,y)
    b = min(x,y)
    while b!=0:
        a,b=b,a%b
    return a
ans = A[0]
for i in range(n-1):
    ans = gcd(ans,A[i+1])
print(ans)

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

int main(){
    int n,l;
    cin >> n >> l;
    vector<string> s(n);
    for(int i=0; i<n; i++){
        cin >> s[i];
    }
    sort(s.begin(), s.end());
    for(int i=0; i<n; i++){
        cout << s[i];
    }
    cout << endl;
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define r(i,asd) for(int i=0;i<asd;i++)
int main(){
  int n;
  cin>>n;
  while(n--){
    int a[6],b[6],l=0;
    r(i,6)cin>>a[i];
    for(int i=1;i<=13;i++){
      if(i==7)continue;
      else{
        int c=0;
        r(j,6)if(a[j]==i)c++;
        if(!c)b[l++]=i;}
    }
    pair<int,int>me[6],en[6];
    int a2=14,a3=0,b2=14,b3=0,amax,bmax;
    r(i,6){
      a2=min(a2,a[i]);
      a3=max(a3,a[i]);
      b2=min(b2,b[i]);
      b3=max(b3,b[i]);
    }
    if(abs(a2-7)>abs(a3-7))amax=0;
    else if(abs(a2-7)<abs(a3-7))amax=1;
    else amax=2;
    if(abs(b2-7)>abs(b3-7))bmax=0;
    else if(abs(b2-7)<abs(b3-7))bmax=1;
    else bmax=2;
    r(i,6){
      if(a[i]==1||a[i]==13)me[i]=make_pair(7,a[i]);
      if(a[i]==2||a[i]==12)me[i]=make_pair(8,a[i]);
      if(a[i]==3||a[i]==11)me[i]=make_pair(9,a[i]);
      if(a[i]==4||a[i]==10)me[i]=make_pair(10,a[i]);
      if(a[i]==5||a[i]==9)me[i]=make_pair(11,a[i]);
      if(a[i]==6||a[i]==8)me[i]=make_pair(12,a[i]);
      if(b[i]==1||b[i]==13)en[i]=make_pair(7,b[i]);
      if(b[i]==2||b[i]==12)en[i]=make_pair(8,b[i]);
      if(b[i]==3||b[i]==11)en[i]=make_pair(9,b[i]);
      if(b[i]==4||b[i]==10)en[i]=make_pair(10,b[i]);
      if(b[i]==5||b[i]==9)en[i]=make_pair(11,b[i]);
      if(b[i]==6||b[i]==8)en[i]=make_pair(12,b[i]);
    }
    r(i,6){
      if(amax==0&&me[i].second<7)me[i].first-=6;
      else if(amax==1&&me[i].second>7)me[i].first-=6;
      if(bmax==0&&en[i].second<7)en[i].first-=6;
      else if(bmax==1&&en[i].second>7)en[i].first-=6;
    }
    sort(me,me+6);
    sort(en,en+6);
    bool table[15]={0};table[7]=1;
    bool p1[6]={0},p2[6]={0};
    while(1){
      r(j,6)
      if(!p1[j]&&(table[me[j].second+1]||table[me[j].second-1])){
      p1[j]=1;
      table[me[j].second]=1;
      break;
    }
    r(j,6)
      if(!p2[j]&&(table[en[j].second+1]||table[en[j].second-1])){
        p2[j]=1;
        table[en[j].second]=1;
        break;
      }
      int c1=0,c2=0;
      r(i,6){if(!p1[i])c1++;if(!p2[i])c2++;}
      if(!c1){cout<<"yes"<<endl;break;}
      if(!c2){cout<<"no"<<endl;break;}
    }
  }
}

Measured memory_bytes: 3096
#include <algorithm>
#include <cmath>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <stack>
#include <string>
#include <vector>
typedef long long ll;
using namespace std;
const int MOD = (int)1e9 + 7;
const ll INF = (ll)1e18 + 7;
#define int long long
#define vint vector<int>
#define pint pair<int, int>
#define pb(a) push_back(a)
#define all(v) v.begin(), v.end()
#define dbg(x) cerr << #x << " = " << (x) << endl
#define yn(b) cout << ((b) ? "Yes" : "No") << endl
#define YN(b) cout << ((b) ? "YES" : "NO") << endl

int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

int N;

void foreach_permutation(int n, std::function<void(int *)> f) {
	int indexes[n];
	for (int i = 0; i < n; i++) indexes[i] = i;
	do {
		f(indexes);
	} while (std::next_permutation(indexes, indexes + n));
}

int P[10] = {0};
int Q[10] = {0};
int a, b;
int kai = 1;

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

	cin >> N;

	for (int i = 0; i < N; i++) {
		cin >> P[i];
	}
	for (int i = 0; i < N; i++) {
		cin >> Q[i];
	}

	foreach_permutation(N, [](int *indexes) {
		bool tmp = true;

		for (int i = 0; i < N; i++) {
			if (P[i] - 1 != indexes[i]) {
				tmp = false;
			}
		}
		if (tmp) {
			a = kai;
		}

		tmp = true;

		for (int i = 0; i < N; i++) {
			if (Q[i] - 1 != indexes[i]) {
				tmp = false;
			}
		}
		if (tmp) {
			b = kai;
		}

		kai++;
	});

	cout << abs(a - b) << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

int main()
{
    long a, b, k; cin >> a >> b >> k;

    if (a < k) {
        b -= (k - a);
        if (b <= 0) b = 0;
        a = 0;
    } else {
        a -= k;
    }

    cout << a << " " << b << endl;

    return 0;
}

Measured memory_bytes: 256
import java.io.IOException;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws IOException {

		Scanner scan = new Scanner(System.in);

		int n = scan.nextInt();
		BITree bit = new BITree(n, false);

		int q = scan.nextInt();
		for (int i = 0; i < q; i++)
			switch (scan.nextInt()) {
			case (0):
				bit.add(scan.nextInt(), scan.nextInt());
				break;
			case (1):
				System.out.println(bit.getSum(scan.nextInt(), scan.nextInt()));
				break;
			}

		scan.close();
		System.exit(0);
	}
}

class BITree {
	boolean debug;
	int[] bit;

	public BITree(int n, boolean d) {
		debug = d;
		bit = new int[n + 10];
	}

	public int getSum(int x1, int x2) {
		return nSum(x2) - nSum(x1 - 1);
	}

	private int nSum(int x) {
		int r = 0;
		for (int i = x; i > 0; i -= i & -i)
			r += bit[i];
		if (debug)
			System.out.println(x + " " + r);
		return r;
	}

	public void add(int x, int y) {
		for (int i = x; i < bit.length; i += i & -i)
			bit[i] += y;
		if (debug) {
			for (int i = 0; i < bit.length; i++)
				System.out.println(i + ":" + bit[i]);
		}
	}
}

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

#define dbg(a)  cerr << __LINE__ << ": " << #a << " = " << a << '\n'

template<class T> inline istream& operator>>(istream& str, vector<T> &a) { for (auto &i : a) str >> i; return str; }

typedef long long ll;

int main(){
  ios::sync_with_stdio(0), cin.tie(0);
  
  int x;  cin >> x;
  x /= 200;
  cout << 10-x << "\n";
  return 0;
}

Measured memory_bytes: 3644
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.StringTokenizer;

public class Main {

    static int N;
    static int[] T, X, Y;

    public static void main(String[] args) {
        FastScanner sc = new FastScanner(System.in);
        N = sc.nextInt();
        T = new int[N];
        X = new int[N];
        Y = new int[N];
        for (int i = 0; i < N; i++) {
            T[i] = sc.nextInt();
            X[i] = sc.nextInt();
            Y[i] = sc.nextInt();
        }

        System.out.println(solve() ? "Yes" : "No");
    }

    static boolean solve() {
        for (int i = 0; i < N; i++) {
            int pt = i == 0 ? 0 : T[i-1];
            int px = i == 0 ? 0 : X[i-1];
            int py = i == 0 ? 0 : Y[i-1];

            int dt = T[i] - pt;
            int dd = Math.abs(X[i] - px) + Math.abs(Y[i] - py);

            if( dd > dt ) return false;
            if( (dt - dd) % 2 == 1 ) return false;
        }
        return true;
    }

    @SuppressWarnings("unused")
    static class FastScanner {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        FastScanner(InputStream in) {
            reader = new BufferedReader(new InputStreamReader(in));
            tokenizer = null;
        }

        String next() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }

        String nextLine() {
            if (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    return reader.readLine();
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken("\n");
        }

        long nextLong() {
            return Long.parseLong(next());
        }

        int nextInt() {
            return Integer.parseInt(next());
        }

        int[] nextIntArray(int n) {
            int[] a = new int[n];
            for (int i = 0; i < n; i++)
                a[i] = nextInt();
            return a;
        }

        long[] nextLongArray(int n) {
            long[] a = new long[n];
            for (int i = 0; i < n; i++)
                a[i] = nextLong();
            return a;
        }
    }
}


Measured memory_bytes: 46108
from scipy.sparse.csgraph import shortest_path, floyd_warshall, dijkstra, bellman_ford, johnson, minimum_spanning_tree
from scipy.sparse import csr_matrix, coo_matrix, lil_matrix
import numpy as np
from functools import reduce

from collections import deque, Counter, defaultdict
from itertools import product, permutations,combinations
from operator import itemgetter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right, bisect
from fractions import gcd
from math import ceil,floor, sqrt, cos, sin, pi, factorial
import sys
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
sys.setrecursionlimit(10**8)
INF = float('inf')
MOD = 10**9+7

def main():
  d, g = map(int, readline().split())
  pc = list(list(map(int, readline().split()))for _ in range(d))
  
  ans = INF
  
  for i in range(2**d):
    score = 0
    amari_max=0
    cnt=0
    for j in range(d):
      if (i>>j)&1:
        score += 100*(j+1)*pc[j][0] + pc[j][1]
        cnt += pc[j][0]
      else:
        amari_max = j
    for j in range(pc[amari_max][0]):
      if score>=g:
        ans = min(ans, cnt)
      score+=(amari_max + 1)*100
      cnt += 1
  print(ans)
  
  
  
  
  
if __name__ == '__main__':
  main()

Measured memory_bytes: 14552
#include <bits/stdc++.h>
#define rep(i,l,r) for((i)=(l);(i)<(r);(i)++)
using namespace std;
int main(){
	long long n,i;
	cin>>n;
    long long a[n+1],b,ans=0,buf;
	rep(i,0,n+1)cin>>a[i];
    rep(i,0,n){
        cin>>b;
        buf=-1*(a[i]-b);
        if(buf>0){
            ans+=a[i];
            if(a[i+1]>=buf){
                a[i+1]-=buf;
                ans+=buf;
            }
            else {
                ans+=a[i+1];
                a[i+1]=0;
            }
        }
        else ans+=b;
    }
	cout<<ans<<endl;
}

Measured memory_bytes: 1024
import os
import sys

import numpy as np

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")
IINF = 10 ** 18
MOD = 998244353

N, M = list(map(int, sys.stdin.readline().split()))


def get_factorials(max, mod=None):
    """
    階乗 0!, 1!, 2!, ..., max!
    :param int max:
    :param int mod:
    :return:
    """
    ret = np.ones(max + 1, dtype=int)
    n = 1
    for i in range(1, max + 1):
        n *= i
        n %= mod
        ret[i] = n
    return ret


def mod_invs(max, mod):
    """
    逆元のリスト 0 から max まで
    :param max:
    :param mod:
    :return:
    """
    invs = [1] * (max + 1)
    for x in range(2, max + 1):
        invs[x] = (-(mod // x) * invs[mod % x]) % mod
    return invs


factorials = get_factorials(M * 3 // 2 + N, MOD)
finvs = np.ones(M * 3 // 2 + N + 1, dtype=int)
p = 1
for i, inv in enumerate(mod_invs(M * 3 // 2 + N, MOD)):
    p = p * inv % MOD
    finvs[i] = p


def ncr(n, r, mod=None):
    """
    scipy.misc.comb または scipy.special.comb と同じ
    組み合わせの数 nCr
    """
    ret = factorials[n] * finvs[r] % MOD * finvs[n - r] % mod
    ret[n < r] = 0
    return ret


# (1) 合計が M*3 で、奇数の数が M 以下である数列の数
odds = np.arange(M % 2, M + 1, 2)
halves1 = (M * 3 - odds) // 2
# 合計が halfs の数列を 2 倍して、odds 個選んで 1 を足す
c1 = ncr(halves1 + N - 1, N - 1, MOD) * ncr(N, odds, MOD) % MOD

# (2) max が M*2 より大きく、奇数の数が M 以下である数列の数
# => 合計が M で、1 要素目が 0 より大きい、奇数が M 以下である数列の数 * N
# 1 要素目に M*2 を足せば (2) になる
halves2 = (M - odds) // 2
# a. 合計が M で奇数が M 以下
c2a = ncr(halves2 + N - 1, N - 1, MOD) * ncr(N, odds, MOD) % MOD
# b. 1 要素目が 0 である数列の数
c2b = ncr(halves2 + N - 2, N - 2, MOD) * ncr(N - 1, odds, MOD) % MOD

c2 = (c2a - c2b) * N % MOD

print((c1 - c2).sum() % MOD)


Measured memory_bytes: 108588
using System;
using System.Collections.Generic;

class C {
    static IEnumerable<char> Go(int sx, int sy, int tx, int ty) {
        for (int i = sx; i < tx; ++i) yield return 'R';
        for (int i = sy; i < ty; ++i) yield return 'U';
        for (int i = tx; i > sx; --i) yield return 'L';
        for (int i = ty; i > sy; --i) yield return 'D';
        yield return 'D';
        for (int i = sx; i <= tx; ++i) yield return 'R';
        for (int i = sy; i <= ty; ++i) yield return 'U';
        yield return 'L';
        yield return 'U';
        for (int i = tx; i >= sx; --i) yield return 'L';
        for (int i = ty; i >= sy; --i) yield return 'D';
        yield return 'R';
    }

    public static void Main() {
        var line = Console.ReadLine().Split();
        var sx = int.Parse(line[0]);
        var sy = int.Parse(line[1]);
        var tx = int.Parse(line[2]);
        var ty = int.Parse(line[3]);
        Console.WriteLine(string.Concat(Go(sx, sy, tx, ty)));
    }
}


Measured memory_bytes: 11220
import sys
read = sys.stdin.read
readlines = sys.stdin.readlines
def main():
    x, y = map(int, input().split())
    inf = float('inf')
    r1 = y - x if y - x >= 0 else inf
    r2 = y - -x + 1 if y - -x >= 0 else inf
    r3 = -y - x + 1 if -y - x >= 0 else inf
    r4 = -y - -x + 2 if -y - -x >= 0 else inf
    r = min(r1, r2, r3, r4)
    print(r)

if __name__ == '__main__':
    main()


Measured memory_bytes: 9132
#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	int N,M,K;cin >> N >> M >> K;
	int C[N],A[N][M];
	for(int i=0;i<N;i++){
		cin >> C[i];
		for(int j=0;j<M;j++) cin >> A[i][j];
	}
	int ans = 2e9;
	for(int i=0;i<(1<<N);i++){
		int tot[M] = {0};
		int sum = 0;
		for(int j=0;j<N;j++){
			if((i>>j)&1){
				for(int k=0;k<M;k++) tot[k]+= A[j][k];
				sum += C[j];
			}
		}
		bool val = true;
		for(int j=0;j<M;j++){
			if(tot[j] < K) val = 0; 
		}
		if(val) ans = min(ans,sum);
	}
	if(ans == 2e9) cout << "-1\n";
	else cout << ans << '\n';
}


Measured memory_bytes: 3648
#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);
}

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

//サーバル「D問題は、操作を1回するごとに、「繰り上がりがあれば、桁数は変わらずdigitsumが9減る」
//「繰り上がりがなければ、digitsumは変わらず桁数が1減る」ことがわかって、「digitsumが9以下かつ桁数が1になったら終了」
//だから、答えは(digitsum-1)/9+桁数-1になるよ！」

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

    int M; cin >> M;
    vector<ll> d(M), c(M);
    rep(i, M) cin >> d[i] >> c[i];

    ll digit_sum = 0;
    ll digit = 0;
    rep(i, M){
        digit += c[i];
        digit_sum += c[i]*d[i];
    }

    cout << digit-1 + (digit_sum-1)/9 << endl;


    return 0;
}


Measured memory_bytes: 3456
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
typedef long long ll;
#define pb push_back
#define mii map <int, int>
#define mll map <ll, ll>
#define pii pair <int, int>
#define pll pair <ll, ll>
#define vi vector <int>
#define vd vector <double>
#define vll vector <ll>
#define fi first
#define se second
#define si set <int>
#define sll set <ll>
#define spii set <pii>
#define vs vector <string>
#define vpii vector <pair <int,int> >
#define vpll vector <pair <long long,long long> >
#define vvi vector <vector <int> >
#define vvpii vector <vector <pii > >
#define vvll vector <vll>
#define vsi vector <si>
#define forn(i, n) for (int i = 0; i < (n); i++)
#define rep(i, n) for (int i = 0; i < (n); i++)
#define for1(i, n) for (int i = 1; i < (n); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(),(x).rend()


using namespace std;
const ll INFLL = 1e18;
const int MAXN = 1e6+100;
const ll INF = 1e9;
const ll mod1=1e9+7;
const ll mod2=2e9+11;

int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    #ifdef LOCAL
    freopen("a.in","r",stdin);
    #endif
    ll n,k;
    cin>>n>>k;
    ll ans=0;
    for (ll i=k;i<=n+1;i++)
    {
        ll x=i*(i-1)/2;
        ll y=n*(n+1)/2-(n-i)*(n-i+1)/2;
        ans+=y-x+1;
        ans%=mod1;
      //  cout<<ans<<'\n';
    }
    cout<<ans;




}

Measured memory_bytes: 3640
#include<stdio.h>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <algorithm>
#include <sstream>
#include <iostream>
#include <string>

using namespace std;

int main() {

	vector<string> s;
	
	while (1) {
		string ss;
		getline(cin, ss);
		if (ss == ".") break;

		int a[2] = {};
		bool flag = true;

		stack<int> st;
	
		for (int j = 0; j < ss.length(); j++) {

			if (ss[j] == '(') st.push(0),a[0]++;
			if (ss[j] == ')') {
				if (st.empty() || st.top() != 0 ) {
					flag = false;
					break;
				}
				else st.pop(),a[0]--;
			}
			if (ss[j] == '[') st.push(1),a[1]++;
			if (ss[j] == ']') {
				if (st.empty() || st.top() != 1) {
					flag = false;
					break;
				}
				else st.pop(), a[1]--;
			}
		}
		if (a[0] != 0 || a[1] != 0) flag = false;

		if (flag) cout << "yes" << endl;
		else cout << "no" << endl;

	}

	return 0;
}

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

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

    //計算
    vector<int> sum(n);
    for (int i = n - 1; i >= 0; i--)
    {
        int k = 1;
        for (int j = i + 1; j <= n; j *= k)
        {
            sum[i] += a[j - 1];
            j = i + 1;
            k += 1;
        }
        if (a[i] % 2 == 1 && sum[i] % 2 == 0) a[i] -= 1;
        else if (a[i] % 2 == 0 && sum[i] % 2 == 1) a[i] += 1;
    }
    
    // debug用 
    // for (int i = 0; i < n; i++)
    // {
    //     cout << sum[i] << " ";
    // }
    // cout << endl;
    
    // debug用
    // for (int i = 0; i < n; i++)
    // {
    //     cout << a[i] << " ";
    // }
    // cout << endl;
    
    //計算
    int m = 0;
    vector<int> b(n+1);
    for (int i = 0; i < n; i++)
    {
        if (a[i] % 2 == 1) 
        {
            m += 1;
            b[i] = i+1;
        }
    }

    //出力
    cout << m << endl;
    for (int i = 0; i < n; i++)
    {
        if (b[i] != 0)
        {
            cout << b[i] << " ";
        }
        
    }
    cout << endl;
}

Measured memory_bytes: 3200
import java.io.BufferedReader;
import java.io.DataInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.Arrays;
import java.util.HashSet;
import java.util.LinkedList;
import java.util.List;
 
 
public class Main {
	
	public static void main(String[] args) throws IOException {
		Main m = new Main();
		//*
		m.input();
		m.solve();
		m.output();
		/*/
		m.debug();
		//*/
	}
	
	public void debug() {
	}
	
	//*
	BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
	/*/
	InputUtil in = new InputUtil();
	//*/
	PrintWriter out = new PrintWriter(System.out);
	long X = 0;
	long Y = 0;
	int ans = 0;

	public void input() throws IOException {
		//*
		String[] tmp = br.readLine().split(" ");
		X = Long.parseLong(tmp[0]);
		Y = Long.parseLong(tmp[1]);
		/*/
		X = in.nextInt();
		Y = in.nextInt(new int[N]);
		//*/
	}
	
	public void solve() throws IOException {
		ans = 0;
		long i = X;
		while (i <= Y){
			ans++;
			i *= 2;
		}
	}
	
	
	
	public void output() {
		out.println(ans);
		out.flush();
	}
}

//*
class InputUtil {
	//Static Fields
	private static final int BUFSIZ = 100000;
	
	//Fields
	protected InputStream in;
	private byte[] buf = null;
	private int ptr = 0;
	private int max = -1;
	private DataInputStream dis = null;
	//Constructors
	public InputUtil() {this(System.in,BUFSIZ);}
	public InputUtil(InputStream in, int bufsiz) {
		initBuf(bufsiz);
		initIn(in);
	}
	
	//Methods
	//Initializer
	protected void initIn(InputStream in) {dis = new DataInputStream(this.in = in);}
	protected void initBuf(int bufsiz) {buf = new byte[bufsiz];}
	
	//buffer operation
	private void next() throws IOException {ptr++; readBuf();}
	private void readBuf() throws IOException {
		if(ptr >= max && dis.available()>0) {
			if(max>0) Arrays.fill(buf,0,max,(byte)0);
			max = dis.read(buf);
			ptr = 0;
		}
	}
	
	//Number Input Reader/Parser
	private boolean isNum(byte b) {return '0' <= b && b <= '9'; }
	private boolean isMinus(byte b) {return b=='-'; }
 
	private int _nextInt() throws IOException {
		int sign = 1;
		int res = 0;
		byte c;
		while (!isNum(c=buf[ptr]) && !isMinus(c)) 
			next();
		if (isMinus(buf[ptr])) {
			sign = -1;
			next();
		}
		while (isNum(c=buf[ptr])) {
			res *= 10;
			res += c - '0' ;
			next();
		}
		next();
		return sign * res;
	}
	
	public int nextInt() throws IOException {
		readBuf();
		return _nextInt();
	}
 
	public int[] nextInt(int[] result) throws IOException {
		readBuf();
		for(int i=0; i<result.length; i++) {
			result[i] = _nextInt();
		}
		return result;
	}
	
	//Close 
	public void close() throws IOException {
		if(!this.in.equals(System.in)) 
			this.in.close();
	}
}
//*/

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

class Pair{
    public:
        int prime;
        int counts=0;
        Pair(int prime){
            this->prime = prime;
        }
};
vector<Pair*> primes;

int maybePrimes[1001]={0};
void filterPrimes(){
    maybePrimes[0]=maybePrimes[1]=1;
    for(int i=2; i<=1000; i++){
        for(int j=i+i; j<=1000; j+=i){
            maybePrimes[j]=1;
        }
    }
    for(int i=1; i<=1000; i++){
        if(maybePrimes[i]==0){
            primes.push_back(new Pair(i));
        }
    }
}

void handleDivisors(int n){
    for(int i=0; i<primes.size(); i++){
        while(n%(primes[i]->prime) == 0){
            n/=(primes[i]->prime);
            (primes[i]->counts)++;
        }
        if(n==1){
            break;
        }
    }
}

int main(){
    const int MOD = 1000000007;
    filterPrimes();

    int N;
    cin >> N;

    for(int i=2; i<=N; i++){
        handleDivisors(i);
    }

    long long totalNum = 1;
    for(int i=0; i<primes.size(); i++){
        if((primes[i]->counts)>0){
            totalNum = (totalNum * ((primes[i]->counts)+1))%MOD;
        }
    }

    cout << totalNum << '\n';
}


Measured memory_bytes: 3164
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		
      	int n = sc.nextInt();
		String s = sc.next();
      	int count = 1;
      
      	for(int i = 0;i < n-1;i++){
        	if(s.charAt(i) != s.charAt(i+1)) count++;
        }
      
      	System.out.println(count);
	}
}

Measured memory_bytes: 39584
def primes(n):
	is_prime = [True] * (n+1)
	is_prime[0] = False
	is_prime[1] = False
	for i in range(2, int(n**0.5)+1):
		if not is_prime[i]:
			continue
		for j in range(i*2, n+1, i):
			is_prime[j] = False
	return is_prime

is_Prime=primes(10**5)
count=[]
cnt=0
for i in range(10**5+1):
  if is_Prime[i] and is_Prime[(i+1)//2]:
    cnt+=1
  count.append(cnt)

Q=int(input())
for i in range(Q):
  l,r=map(int,input().split())
  print(count[r]-count[l-1])

Measured memory_bytes: 5144
#include <iostream>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <tuple>
#include <algorithm>
#include <functional>
#include <cstring>
#include <limits.h>
#define FOR(i,k,n)  for (int i=(k); i<(int)(n); ++i)
#define REP(i,n)    FOR(i,0,n)
#define FORIT(i,c)	for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define SZ(i) ((int)i.size())
#define pb          push_back
#define mp          make_pair
#define mt          make_tuple
#define get0(x)     (get<0>(x))
#define get1(x)     (get<1>(x))
#define get2(x)     (get<2>(x))
#define ALL(X)      (X).begin(),(X).end()
#define LLMAX       9223372036854775807LL
#define LLMIN       -9223372036854775808LL
#define IMAX        2147483647
#define IMIN        -2147483648
typedef long long LL;
using namespace std;

int H,W,N,A[10000],R[100][100];

int main(void){
    cin>>H>>W>>N;
    REP(i,N)cin>>A[i];
    int c=0;
    REP(i,H){REP(j,W){
        int jj=(i%2==0)?j:W-1-j;
        R[i][jj]=c+1;
        A[c]--;
        if(A[c]==0)c++;
    }
    }
    REP(i,H){
        REP(j,W){
            cout<<R[i][j]<<" ";
        }
        cout<<endl;
    }
     return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<cmath>
#include<cstdlib>
#include<string>
#include<cstring>
#include<algorithm>
#include<vector>
#include<map>

using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;

int main() {
   int N;
   string S;
   cin >> N >> S;

   map<char, int> log;

   for (int i = 0; i < N; i++) {
      log[S[i]]++;   
   }
   ll ans = 1;
   for (auto it = log.begin(); it!= log.end(); it++) {
      ans *= (it->second + 1);
      ans %= MOD;
   }
   cout << ans - 1 << endl;
   return 0;
}


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

#define MAX 200000

int students[MAX];

int main()
{
    list<int> l;
    int N, M, Q, tmp;
    std::scanf("%d %d %d", &N, &M, &Q);
    for (int i = 0; i < N; i++) {
        l.push_back(i);
        students[i] = 1;
    }

    list <int> :: iterator it = l.begin();
    int d;
    for (int i = 0; i < M; i++) {
        std::scanf("%d", &tmp);
        if (tmp % 2 == 0) {
            for (int j = 0; j < tmp; j++) {
                it++;
                if (it == l.end())
                    it = l.begin();
            }
        }
        else {
            for (int j = 0; j < tmp; j++) {
                if (it == l.begin()) {
                    it = l.end();
                }
                it--;
            }
            if(it == l.end())
                it = l.begin();

        }
        students[*it] = 0;
        it = l.erase(it);
        if(it == l.end()) it = l.begin();
    }


    for (int i = 0; i < Q; i++) {
        std::scanf("%d", &tmp);
        cout << students[tmp] << endl;
    }



    return 0;
}



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

#define int long long
#define endl "\n"
#define REP(i,a,n) for(int i=a;i<n;++i)
#define REPR(i,a,n) for(int i=a;i>n;--i)
#define RUP(a,b) ((a+b-1)/(b))
#define SORTG(v) sort(v.begin(),v.end(),greater<>())
#define SORT(v) sort(v.begin(),v.end())
#define ALL(v) (v).begin(),(v).end()
#define pb push_back
#define mp make_pair
#define mt make_tuple
#define MOD 1000000007
#define INF LLONG_MAX/3

typedef long long ll;
typedef pair<int,int> Pii;
typedef tuple<int,int,int> Tiii;
typedef vector<int> Vi;
typedef vector<Vi> VVi;
typedef vector<string> Vs;

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;}}
void YesNo(int a){cout<<((a)?"Yes":"No")<<endl;}
void YESNO(int a){cout<<((a)?"YES":"NO")<<endl;}
void AorB(int a,string b,string c){cout<<((a)?b:c)<<endl;}
int gcd(int a,int b){return b?gcd(b,a%b):a;}
void start(){cin.tie(0);cout.tie(0);ios::sync_with_stdio(false);}

signed main(){start();
    int n,m;
    cin>>n>>m;
    cout<<(m+n*3)/2<<endl;
    return 0;
}


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

int main()
{
  int N;
  cin >>N;
  int M;
  if(N<10)
  {
    M=N;
  }
  if((N>=10)&&(N<100))
  {
    M=N%10;
  }
  if((N>=100)&&(N<1000))
  {
    M=N%10;
  }
  if(M==3)
  {
    cout << "bon" << endl;
  }
  if(M==2||M==4||M==5||M==7||M==9)
  {
    cout << "hon" << endl;
  }
  if(M==0||M==1||M==6||M==8)
  {
    cout << "pon" <<endl;
  }
}

Measured memory_bytes: 3632
#include <stdio.h>

int main()
{
	int n,i;
	
	scanf("%d",&n);
	
	int a[n];
	
	for(i = 0;i < n;i++)
		scanf("%d",&a[i]);
		
	for(i = 0;i < n;i++)
	{
		if(a[i] % 2 != 0)
		continue;
		
		if(a[i] % 3 != 0 && a[i] % 5 != 0)
		break;
	}
	
	printf("%s\n",i == n?"APPROVED":"DENIED");
	
	return 0;
}

Measured memory_bytes: 128
#include <algorithm>
#include <bits/stdc++.h>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <list>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <vector>
using namespace std;

#define rep(X, Y) for (int(X) = 0; (X) < (Y); ++(X))
#define rrep(X, Y) for (int(X) = (Y)-1; (X) >= 0; --(X))
#define all(X) (X).begin(), (X).end()
#define pb push_back
#define mp make_pair
#define fi first
#define sc second
#define print(x) cout << x << endl

typedef long long ll;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

void solve(long long M, long long K) {
  if (K == 0) {
    rep(m, pow(2, M)) {
      cout << m << " " << m;
      if (m != pow(2, M) - 1) {
        cout << " ";
      } else {
        cout << endl;
      }
    }
    return;
  }

  if (pow(2, M) <= K) {
    print(-1);
    return;
  }

  vl ans;
  ll xorNum = 0;
  ll i = 0;
  rep(m, pow(2, M)) {
    if (m != K) {
      ans.push_back(m);
      xorNum ^= m;
    }
    i++;
  }

  if (xorNum == K) {
    for (auto iter = ans.begin(); iter != ans.end(); iter++) {
      cout << *iter << " ";
    }
    cout << K << " ";
    for (ll i = ans.size() - 1; i >= 0; i--) {
      cout << ans[i] << " ";
    }
    cout << K << endl;
  } else {
    cout << "-1" << endl;
  }
}

int main() {
  long long M;
  scanf("%lld", &M);
  long long K;
  scanf("%lld", &K);
  solve(M, K);
  return 0;
}


Measured memory_bytes: 2932
#include <iostream>
#include <vector>
//#include <string>
#include <algorithm>
//#include <math.h>
//#include <queue>
//#include <stack>
//#include <iomanip>

// sometimes used
//#include <set>
//#include <map>
//#include <numeric>
//#include <list>
//#include <deque>
//#include <unordered_map>

typedef long long LL;
//typedef long double LD;
using namespace std;
 
//#define MOD 1000000007
//#define MAX 100100
//#define NIL -1

int main(){
    LL n;
    vector<LL> a;
    vector<LL> b;
    vector<LL> c;
    LL tmp_a;
    LL tmp_b;
    LL tmp_c;
    cin >> n;
    for(int i=0; i<n; i++){
        cin >> tmp_a;
        a.push_back(tmp_a);
    }
    for(int i=0; i<n; i++){
        cin >> tmp_b;
        b.push_back(tmp_b);
    }
    for(int i=0; i<n; i++){
        cin >> tmp_c;
        c.push_back(tmp_c);
    }

    vector<LL> b_num(n, 0);
    vector<LL> c_num(n, 0);

    sort(a.begin(), a.end());
    sort(b.begin(), b.end());
    sort(c.begin(), c.end());

    int idx=0;
    for(int i=0; i<n; i++){
        if(a[i]<b[idx]){
            b_num[idx]++;
        }else{
            while(a[i]>=b[idx] && idx<n-1){
                idx++;
                b_num[idx]=b_num[idx-1];
            }
            if(a[i]<b[idx]){
                b_num[idx]++;
            }
        }
    }
    while(idx<n-1){
        idx++;
        b_num[idx]=b_num[idx-1];
    }

    idx=0;
    for(int i=0; i<n; i++){
        if(b[i]<c[idx]){
            c_num[idx]+=b_num[i];
        }else{
            while(b[i]>=c[idx] && idx<n-1){
                idx++;
                c_num[idx]=c_num[idx-1];
            }
            if(b[i]<c[idx]){
                c_num[idx]+=b_num[i];
            }
        }
    }
    while(idx<n-1){
        idx++;
        c_num[idx]=c_num[idx-1];
    }

    LL ans=0;

    //for(int i=0; i<n; i++){
    //    cout << b_num[i] << endl;
    //}

    //cout << "test" << endl;

    //for(int i=0; i<n; i++){
    //    cout << c_num[i] << endl;
    //}

    for(int i=0; i<n; i++){
        ans+=c_num[i];
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 4340
#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <set>
#include <map>
#include <cstring>
#include <string>
#include <cstdlib>
#include <cstdio>
#include <cmath>
#include <ctime>
using namespace std;
typedef long long int ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();++i)
#define RREP(i,x) for(int i=(x)-1;i>=0;i--)
#define RFOR(i,c) for(auto i=(c).rbegin();i!=(c).rend();++i)
#define ALL(container) container.begin(), container.end()
#define SZ(container) ((int)container.size())

const int INF = 1<<28;
const double EPS = 1e-8;
const int MOD = 1000000007;

int n;
int c[10][10];
int visit[1<<16];
main(){
	cin >> n;
	vector<pii> stamp(n);
	REP(i, n){
		cin >> stamp[i].first >> stamp[i].second;
	}
	REP(i, 4)REP(j, 4){
		char ch;
		cin >> ch;
		if(ch == 'R') c[i][j] = 1;
		if(ch == 'G') c[i][j] = 2;
		if(ch == 'B') c[i][j] = 3;
	}
	queue<int> q;
	q.push(0);
	REP(i, 1<<16) visit[i] = 30;
	visit[0] = 0;
	while(!q.empty()){
		int b = q.front();q.pop();
		if(b == (1<<16)-1) break;
		REP(i, n){
			int h = stamp[i].first;
			int w = stamp[i].second;
			for(int sy=-h+1;sy<4;sy++)for(int sx=-w+1;sx<4;sx++){
				int col = -1;
				int bt = b;
				for(int y=sy;y<sy+h;y++)for(int x=sx;x<sx+w;x++){
					if(bt==-1||x<0||y<0||4<=x||4<=y) continue;
					if(!((b >> (4*y+x))&1)){
						bt |= 1<<(4*y+x);
						if(col == -1) col = c[y][x];
						else if(col != c[y][x]) bt = -1;
					}
				}
				if(bt >= 0 && visit[bt] > visit[b]+1){
					visit[bt] = visit[b]+1;
					q.push(bt);
				}
			}
		}
	}
	cout << visit[(1<<16)-1] << endl;
	return 0;
}

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

typedef long long ll;

main()
{
    int n, m, c, cnt = 0, sum;
    cin >> n >> m >> c;
    int B[m], arr[m];
    for(int i = 0; i < m; i++){
        cin >> B[i];
    }
    for(int i = 1; i <= n; i++){
        sum = 0;
        for(int j = 0; j < m; j++){
            cin >> arr[j];
            sum = sum + arr[j] * B[j];
        }
        sum = sum + c;
        if(sum > 0){
            cnt ++;
        }
    }
    cout << cnt;



}





///promy_pompom
//hello world


Measured memory_bytes: 3568
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<n;i++)
#define repl(i,l,r) for(int i=l;i<r;i++)
using namespace std;
using ll = long long;
static const ll MOD=1e9+7;
static const int inf=1e9+10;
static const ll INF=4e18+10;
const int dx[9]={1, 0, -1, 0, 1, -1, -1, 1, 0};
const int dy[9]={0, 1, 0, -1, 1, 1, -1, -1, 0};

const int Max=2005;
int A[Max];

int solve(int n){
    if(A[n]!=-1)return A[n];
    if(n==0)return A[n]=1;
    if(n<3)return A[n]=0;
    if(n==3)return A[n]=1;
    A[n]=solve(n-3)+solve(n-1);
    A[n]%=MOD;
    return A[n];
}

int main(){
    rep(i,Max)A[i]=-1;
    int n;cin>>n;
    cout<<solve(n)<<endl;
    return 0;
}

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

// Type alias
using ll=long long;
using ld=double;

using pi=pair<int,int>;
using pll=pair<ll,ll>;
using pld=pair<ld,ld>;
using ti3=tuple<int, int, int>;

using vi=vector<int>;
using vll=vector<ll>;
using vld=vector<ld>;
using vpi=vector<pi>;
using vpll=vector<ll>;
using vpld=vector<ld>;
using vti3=vector<ti3>;

// Constants
const double EPS = 1e-9;
const int inf = numeric_limits<int>::max();

// Macro
#define rep(i,n) for(int i=0;i<int(n);++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;--i)
#define REP(i,a,b) for(int i=int(a);i<int(b);++i)
#define RREP(i,a,b) for(int i=int(b-1);i>=int(a);--i)
#define SHOW(a) cout << #a << " = " << a << endl
#define ARR(a,n) for(int i=0;i<int(n);++i) cout << #a << "[" << i << "]" << " = " << a[i] << endl

#define ALL(a) a.begin(),a.end()

// Funtcions
ll pow(ll base, ll i, ll mod){
  ll a = 1;
  while(i){
    if (i & 1) {
      a *= base;
      a %= mod;
    }
    base *= base;
    base %= mod;
    i >>= 1;
  }
  return a;
}
ll gcd(ll a, ll b){
  while(b){
    ll c = a % b;
    a = b;
    b = c;
  }
  return a;
}
ll lcm(ll a, ll b){
  return a / gcd(a, b) * b;
}
template<typename T> bool chmin(T& a, const T& b) {
  if (a > b) return a = b, true; else return false;
}

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


void solve(){
  const ll mod = 1000000000 + 7;
  ll N;
  cin >> N;
  ll A[3*100000 + 5];
  rep(i, N) cin >> A[i];

  ll zeros[61] = {};
  ll ones[61] = {};
  rep(i, N){
    rep(j, 61){
      if(A[i] & (1LL << j))
        ones[j]++;
      else
        zeros[j]++;
    }
  }

  ll ans = 0;
  rep(i, 61){
    ans += (((zeros[i] * ones[i]) % mod) * ((1ll << i) % mod)) % mod;
    ans %= mod;
  }

  cout << ans << endl;
}

int main(){
// FastIO
//ios_base::sync_with_stdio(false);
cin.tie(NULL);
  solve();
  return 0;
}

Measured memory_bytes: 2560
s=[]
while True:
    tmp=input()
    if tmp=="=":
        break
    else:
        s.append(tmp)

ans=0
num=0
op=""
for i in range(len(s)):
    tmp=s[i]
    if i==0:
        num=int(tmp)
        ans=num
    elif i%2==0:
        num=int(tmp)
        if op=="+":
            ans+=num
        elif op=="-":
            ans-=num
        elif op=="*":
            ans*=num
        elif op=="/":
            ans//=num
    else:
        op=tmp

print(ans)


Measured memory_bytes: 5600
package main

import (
  "bufio"
  "os"
  "strconv"
  "strings"
  "fmt"
  "sort"
)

var reader = bufio.NewReaderSize(os.Stdin, 1000000)
var writer = bufio.NewWriter(os.Stdout)
func NextLine() string {
  buffer := make([]byte, 0)
  for true {
    line, isPrefix, err := reader.ReadLine()
    if err != nil { panic(err) }
    buffer = append(buffer, line...)
    if !isPrefix { break }
  }
  return string(buffer)
}
func NextInt() int {
  n, _ := strconv.Atoi(NextLine())
  return n
}
func NextIntVec() []int {
  L := strings.Split(NextLine(), " ")
  N := make([]int, len(L))
  for i := range N {
    N[i], _ = strconv.Atoi(L[i])
  }
  return N
}
func Write(s interface{}) {
  fmt.Fprintln(writer, s)
}
func WriteIntVec(A []int) {
  S := make([]string, len(A))
  for i, a := range A {
    S[i] = strconv.Itoa(a)
  }
  Write(strings.Join(S, " "))
}
func Output() {
  _ = writer.Flush()
}

func Sum(A []int) int {
  sum := 0
  for _, a := range A {
    sum += a
  }
  return sum
}

func Factorial(N int) (F, Inv []int) {
  F = make([]int, N + 1)
  Inv = make([]int, N + 1)
  F[0] = 1
  F[1] = 1
  Inv[0] = 1
  Inv[1] = 1
  for i := 2; i < N + 1; i++ {
    F[i] = F[i - 1] * i % p
    Inv[i] = p - Inv[p % i] * (p / i) % p
  }
  return
}

const p = 1000000007

func main() {
  NX := NextIntVec()
  N, X := NX[0], NX[1]
  S := NextIntVec()
  sort.Sort(sort.Reverse(sort.IntSlice(S)))
  F, Inv := Factorial(N)
  DP := make([][]int, N + 1)
  for i := range DP {
    DP[i] = make([]int, X + 1)
  }
  DP[0][X] = 1
  for i, s := range S {
    for j, dp := range DP[i] {
      DP[i + 1][j % s] += dp * Inv[N - i] % p
      DP[i + 1][j % s] %= p
      DP[i + 1][j] += (dp * (N - i - 1) % p) * Inv[N - i] % p
      DP[i + 1][j] %= p
    }
  }
  E := 0
  for j, dp := range DP[N] {
    E += j * dp
    E %= p
  }
  Write(E * F[N] % p)
  Output()
}

Measured memory_bytes: 163456