akhauriyash/Code-Regression huggingface dataset:
N, M, Q = [int(_) for _ in input().split()]
Query = []
for _ in range(M):
    Query += [[int(_) for _ in input().split()] + [0, _]]
for _ in range(Q):
    p, q = [int(_) for _ in input().split()]
    Query += [[p, q + 1, 1, _]]
Query.sort(key=lambda xs: 2 * xs[1] - xs[2])
ans = [0] * Q


class SegmentTree():
    def __init__(self, array, m, e, size):
        """
        Parameters
        ----------
        array : list
            to construct segment tree from
        m : func
            binary operation of the monoid
        e : 
            identity element of the monoid
        size : int
            limit for array size
        """
        self.m = m
        self.e = e
        self.size = size
        self.n = n = len(array)
        self.dat = dat = [e] * n + array + [e] * (2 * size - 2 * n)
        self.build()

    def build(self):
        dat, n, m = self.dat, self.n, self.m
        for i in range(n - 1, 0, -1):
            dat[i] = m(dat[i << 1], dat[i << 1 | 1])

    def modify(self, p, v):
        """
        set value at position p (0-indexed)
        """
        m, n, dat = self.m, self.n, self.dat
        p += n
        dat[p] = v
        while p > 1:
            dat[p >> 1] = m(dat[p], dat[p ^ 1])
            p >>= 1

    def query(self, l, r):
        """
        result on interval [l, r) (0-indexed)
        """
        m, e, n, dat = self.m, self.e, self.n, self.dat
        res = e
        l += n
        r += n
        while l < r:
            if l & 1:
                res = m(res, dat[l])
                l += 1
            if r & 1:
                r -= 1
                res = m(res, dat[r])
            l >>= 1
            r >>= 1
        return res


e = 0
size = N + 2
ST = SegmentTree([0] * (N + 2), m=lambda x, y: x + y, e=e, size=size)
for l, r, t, i in Query:
    if t:
        ans[i] = ST.query(l, r)
    else:
        ST.modify(l, ST.query(l, l + 1) + 1)
print(*ans, sep='\n')


Measured memory_bytes: 120536
//----------BHAVIK DIWANI(PICT_COMP)---------------
#include<bits/stdc++.h>
#include<stdlib.h>
#include<stdio.h>
#define test ll t; cin>>t; while(t--)
#define FOR(p,n) for(ll i=p;i<(ll)n;i++)
#define fastio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define mod 1000000007
#define ll long long
#define int long long
#define ull unsigned long long
#define MAX 1000005
#define pb push_back
#define mkp make_pair
#define vi vector<int>
#define pii pair<int,int>
#define endl '\n'
#define vs vector<string>
#define mii map<int,int>
#define msi map<string,int>
#define vpii vector< pair<int, int > >
#define vpsi vector< pair< string ,int > >
#define forci(p,q) for(int i=p;i<q;i++)
ll gcd(ll a,ll b){ if(b==0) return a;    return gcd(b,a%b);}
ll lcm(ll a,ll b) { return (a/gcd(a,b)*b);}
ull power(ull a, ull b) {a %= mod;  ull res = 1;  while (b > 0) { if (b & 1) res = res * a % mod;  a = a * a % mod;  b >>= 1; }  return res%mod; }
ll modmul(ll x, ll y){return (x*y)%mod;}
ll modadd(ll x, ll y){return (x+y)%mod;}
ll modsub(ll x, ll y){return (x-y+mod)%mod;}
ll fact[1000007]={0};
void facto() {fact[0]=1;fact[1]=1;for(int i=2;i<100007;i++)fact[i]=(fact[i-1]*i)%mod;}
ll ncr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[r],mod-2)))%mod; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
ll npr(ll n,ll r) {ll res=1; res=fact[n]; res=(res*(power(fact[n-r],mod-2)))%mod; return res;}
inline long long toint(const std::string &s) {std::stringstream ss; ss << s; long long x; ss >> x; return x;}
inline std::string tostring(long long number) {std::stringstream ss; ss << number; return ss.str();}
inline std::string tobin(long long x) {return std::bitset<63>(x).to_string();}
/*bool prime[MAX];
ull sieve(){memset(prime,true,sizeof(prime));for(ull p=2;p*p<MAX;p++){if(prime[p]==true){for(ull i=2*p;i<MAX;i+=p){prime[i]=false;}}}prime[0]=0;prime[1]=0;
}*/
/*int inv[1000001]={0};
void findinverse(){inv[1] = 1;for(int i = 2; i <=1e6 ; ++i)	inv[i] = (mod - (mod/i) * inv[mod%i] % mod) % mod;}
*/
using namespace std;
int solve()
{
	int n;
	cin>>n;
	string s;
	cin>>s;
	int cnt=0;
	for(int i=1;i<n;i++){
		if(s[i]!=s[i-1])
			cnt++;
	}
	cout<<cnt+1<<endl;
	return 0;
}
signed main()
{
	fastio;
//	test
		solve();
}






Measured memory_bytes: 3708
w, h, n = map(int, input().split())

vec = []

l = []
b = []
r = []
t = []
for i in range(n):
    x, y, x1, y1 = map(int, input().split())
    c = [x, y, x1, y1]
    if( ((c[0] == 0 or c[0] == w) or (c[1] == 0 or c[1] == h)) and ((c[2] == 0 or c[2] == w) or (c[3] == 0 or c[3] == h)) ):
        if x == 0:
            l.append([x, y, i])
        elif y == 0:
            t.append([x, y, i])
        elif x == w:
            r.append([x, y, i])
        elif y == h:
            b.append([x, y, i])
        if x1 == 0:
            l.append([x1, y1, i])
        elif y1 == 0:
            t.append([x1, y1, i])
        elif x1 == w:
            r.append([x1, y1, i])
        elif y1 == h:
            b.append([x1, y1, i])

sorted_node = (
          sorted(l, key=lambda x: x[1])
        + sorted(b, key=lambda x: x[0])
        + sorted(r, key=lambda x: x[1], reverse=True)
        + sorted(t, key=lambda x: x[0], reverse=True)
        )


stack = []

for node in sorted_node:
    if not stack or stack[-1] != node[2]:
        stack.append(node[2])
    else:
        stack.pop()

print("NO" if stack else "YES")


Measured memory_bytes: 40576
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
 
int main(){
	string s,t;
	cin >> s >> t;
	int i,j,count,min=1000;

	for(j=0; j<s.size()-t.size()+1; j++){
		count = 0;

		for(i=0;i<t.size();i++){
			if(t[i]!=s[j+i]){
				count++;
				//cout << t[i] <<"  "<< s[j+i] <<endl;
			}
		}
 
		if(min > count)min=count;
		//cout << "count" <<count <<endl;
	}
 
	cout << min <<endl;
	
 
	return 0;
}

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

signed main(){
	int k,n;
	string s;
	cin >> n >> s >> k;
	for(int i = 0;i < n;i++){
		if(s[i] == s[k - 1]) cout << s[i];
		else cout << "*";
	}
	cout << endl;
}

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

int main(){
    long long n,k;
    std::cin>>n>>k;
    n-=2;
    /*
    左上が(i,j)のときを考える、このとき正方形の枠内の数字の和は
    7i+j-7+7i+j+7i+j+7+...=21i+3j+...
    =63i+9j+9
    ≡8i+9j+9≡k
    カレンダーは7列しかないって意味かよ！
    jを固定すると
    8i≡k-9(j+1)より
    周期により数え上げが可能で、周期は
    8,5,10,9,7,3,6,1,2,4
    */
   int cycle[11]={8,5,2,10,7,4,1,9,6,3,0};
   long long ans=0;
   for(int j=1;j<=5;++j){
        int rem=k-9*(j+1)+11*11;
        rem%=11;
        int pos=-1;
        for(int i=0;i<11;++i) if(rem==cycle[i]) pos=i;
        if(pos==-1) continue;
        ans+=(n-pos+10)/11;
    }
    std::cout<<ans<<std::endl;
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#define INF 0x3f3f3f3f
#include <cstdio>
#include <iostream>
#include <sstream>
#include <cmath>
#include <cstdlib>
#include <algorithm>
#include <queue>
#include <stack>
#include <limits>
#include <map>
#include <string>
#include <cstring>
#include <set>
#include <deque>
#include <bitset>
#include <list>
#include <cctype>
#include <utility>
 
using namespace std;
 
typedef long long ll;
typedef pair <int,int> P;
typedef pair <int,P > PP;
 
const static int tx[] = {0,1,1,1,0,-1,-1,-1};
const static int ty[] = {-1,-1,0,1,1,1,0,-1};
 
static const double EPS = 1e-12;

class Point{
public:
  int x;
  int y;
  Point(int _x,int _y) : x(_x),y(_y){}
  bool operator<(const Point& p) const{
    if(x==p.x) return y < p.y;
    else return x < p.x;
  }
  bool operator>(const Point& p) const{
    if(x==p.x) return y > p.y;
    else return x > p.x;
  }
  bool operator==(const Point& p) const{
    return (x == p.x && y == p.y);
  }
};

int dfs(int x,int y,
	map<int,vector<int> >& x2y,
	map<int,vector<int> >& y2x,
	map<Point,bool>& visited){
  
  map<Point,bool>::iterator it;
  if((it = visited.find(Point(x,y))) != visited.end()){
    return 0;
  }

  visited[Point(x,y)] = true;
  int res = 1;

  for(int i=0;i<x2y[x].size();i++){
    int next_y = x2y[x][i];
    res += dfs(x,next_y,x2y,y2x,visited);
  }
  
  for(int i=0;i<y2x[y].size();i++){
    int next_x = y2x[y][i];
    res += dfs(next_x,y,x2y,y2x,visited);
  }
  return res;
}

int main(){
  int total_slimes;
  int W,H;
  while(~scanf("%d %d %d",&total_slimes,&W,&H)){
    vector<Point> points;
    map<int,vector<int> >x2y;
    map<int,vector<int> >y2x;
    map<Point,bool> visited;
    bool has_corner = false;
    
    for(int slime_idx=0; slime_idx < total_slimes; slime_idx++){
      int x,y;
      scanf("%d %d",&x,&y);
      x--;
      y--;
      x2y[x].push_back(y);
      y2x[y].push_back(x);
      if(x == 0 || y == 0 || x == W-1 || y == H-1){
	has_corner = true;
      }
    }

    int group_count = 0;
    for(map<int,vector<int> >::iterator it = x2y.begin();
	it != x2y.end();
	it++){
      int x = it->first;
      for(int i=0; i < it->second.size(); i++){
	int y = it->second[i];
	map<Point,bool>::iterator it;
	if((it = visited.find(Point(x,y))) != visited.end()) continue;
	dfs(x,y,x2y,y2x,visited);
	group_count++;
      }
    }

    //(cost for initial grouping)
    //+ (cost for moving to the corner) + (cost for grouping remainings)

    int init_grouping_cost = total_slimes - group_count;
    printf("%d\n",init_grouping_cost
	   + (group_count > 1 ?
	      (group_count + (has_corner ? -1 : 0)) + (group_count - 1)
	      : 0));
  }
}

Measured memory_bytes: 10936
import java.io.File;
import java.io.FileNotFoundException;
import java.math.BigInteger;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws FileNotFoundException {
        Scanner s = new Scanner(System.in);

        int n = s.nextInt();
        int m = s.nextInt();

        int[] arr = new int[m];
        int prev1 = -1;
        for (int i = 0; i < m; i++) {
            int broken = s.nextInt();
            if (broken == prev1 + 1) {
                System.out.println(0);
                return;
            }
            arr[i] = prev1 = broken;
        }
        if (arr.length == 0) {
            ArrayList<BigInteger> fiboArr = new ArrayList<>(n * 2);
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(1));
            fiboArr.add(BigInteger.valueOf(2));
            fiboArr.add(BigInteger.valueOf(3));
            fiboArr.add(BigInteger.valueOf(5));
            fiboArr.add(BigInteger.valueOf(8));
            fiboArr.add(BigInteger.valueOf(13));
            fiboArr.add(BigInteger.valueOf(21));
            fiboArr.add(BigInteger.valueOf(34));

            BigInteger aaa = BigInteger.valueOf(1000000007);
            BigInteger answer = fibo(fiboArr, n + 1);
            answer = answer.mod(aaa);

            System.out.println(answer.longValue());
            return;
        }

        int prev2;
        int[] renzoku = new int[m + 1];
        renzoku[0] = arr[0];
        int maxRen = arr[0];
        prev2 = arr[0];
        for (int i = 1; i < m; i++) {
            int next = arr[i];
            renzoku[i] = next - prev2 - 1;
            maxRen = Math.max(maxRen, renzoku[i]);
            prev2 = next;
        }
        renzoku[m] = n - prev2;
        maxRen = Math.max(maxRen, renzoku[m]);

        // 1: 1
        // 2: 1
        // 3: 2
        // 4: 3
        // 5: 5
        // 6: 8

        ArrayList<BigInteger> fiboArr = new ArrayList<>(maxRen * 2);
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(1));
        fiboArr.add(BigInteger.valueOf(2));
        fiboArr.add(BigInteger.valueOf(3));
        fiboArr.add(BigInteger.valueOf(5));
        fiboArr.add(BigInteger.valueOf(8));
        fiboArr.add(BigInteger.valueOf(13));
        fiboArr.add(BigInteger.valueOf(21));
        fiboArr.add(BigInteger.valueOf(34));

        BigInteger answer = BigInteger.valueOf(1);
        BigInteger aaa = BigInteger.valueOf(1000000007);
        for (int i = 0; i < m + 1; i++) {
            answer = answer.multiply(fibo(fiboArr, renzoku[i]));
            answer = answer.mod(aaa);
        }

        System.out.println(answer.longValue());
    }

    private static BigInteger fibo(ArrayList<BigInteger> temp, int _i) {
        int i = _i - 1;
        if (temp.size() > i) {
            return temp.get(i);
        }
        int last = temp.size();

        for (int i1 = last; i1 <= i; i1++) {
            temp.add(temp.get(i1 - 2).add(temp.get(i1 - 1)));
        }
        return temp.get(i);
    }
}


Measured memory_bytes: 595520
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using static System.Console;

class Program
{
    static void Main(string[] args)
    {
        var (N, K) = ReadLine().Split(' ').Select(int.Parse).ToArray();
        var x = ReadLine().Split(' ').Select(int.Parse).ToArray();

        var nX = new[] { 0 }.Concat(x.Where(y => y < 0).Select(y => -y).Reverse()).ToArray();
        var pX = new[] { 0 }.Concat(x.Where(y => y >= 0)).ToArray();

        var ans = long.MaxValue;
        for (int i = K; i >= 0; i--)
        {
            if (nX.Length <= i || pX.Length <= K - i)
                continue;

            var a = nX[i];
            var b = pX[K - i];

            var n = a + b + Math.Min(a, b);

            ans = Math.Min(ans, n);
        }

        WriteLine(ans);
    }
}

static class ArrayDeconstructExtensions
{
    public static void Deconstruct<T>(this T[] a, out T i1, out T i2) => (i1, i2) = (a[0], a[1]);
    public static void Deconstruct<T>(this T[] a, out T i1, out T i2, out T i3) => (i1, i2, i3) = (a[0], a[1], a[2]);
    public static void Deconstruct<T>(this T[] a, out T i1, out T i2, out T i3, out T i4) => (i1, i2, i3, i4) = (a[0], a[1], a[2], a[3]);
    public static void Deconstruct<T>(this T[] a, out T i1, out T i2, out T i3, out T i4, out T i5) => (i1, i2, i3, i4, i5) = (a[0], a[1], a[2], a[3], a[4]);
}


Measured memory_bytes: 38592
#include <bits/stdc++.h>
#define REP(i, n) for(long long i = 0; i < n; i++)
#define REPR(i, n) for(long long i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(long long i = m; i <= n; i++)
#define FORR(i, m, n) for(long long i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define VSORTR(v) sort(v.rbegin(), v.rend());
#define ALL(v) (v).begin(),(v).end()
#define FIN ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
using namespace std;
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;
const ll mod = 1e9+7;


int main(){FIN

    ll n,k;cin>>n>>k;
    k--;
    string s;cin>>s;
    s[k] = tolower(s[k]);
    cout<<s<<endl;
    return 0;
}

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

double dp[10000][20][20];

int main(int argc, char const *argv[])
{
	int n;
	double r,t;
	cin>>n>>r>>t;
	t=t*M_PI/180.0;
	int x[n],y[n];
	for (int i = 0; i < n; ++i) cin>>x[i]>>y[i];
	
	bool moveok[n][n][n];
	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			for (int k = 0; k < n; ++k)
			{
				if(i==j||j==k||k==i) moveok[i][j][k]=0;
				else
				{
					double rad1=(double)(y[i]-y[j])/(x[i]-x[j]),rad2=(double)(y[j]-y[k])/(x[j]-x[k]);
					if(x[i]==x[j]) rad1=(y[i]>y[j])?-M_PI/2:M_PI/2;
					else if(x[i]-x[j]>0) rad1=atan(rad1)+M_PI;
					else rad1=atan(rad1);
					if(x[j]==x[k]) rad2=(y[j]>y[k])?-M_PI/2:M_PI/2;
					else if(x[j]-x[k]>0) rad2=atan(rad2)+M_PI;
					else rad2=atan(rad2);
					double rad=fabs(rad1-rad2);
					while(rad>M_PI) rad-=2*M_PI;
					if(fabs(rad)<t+0.0001) moveok[i][j][k]=1;
					else moveok[i][j][k]=0;
				}
			}
		}
	}
	
	double distance[n][n];
	for (int i = 0; i < n; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			distance[i][j]=sqrt((x[i]-x[j])*(x[i]-x[j])+(y[i]-y[j])*(y[i]-y[j]));
		}
	}

	for (int i = 0; i < 10000; ++i)
	{
		for (int j = 0; j < 20; ++j)
		{
			for (int k = 0; k < 20; ++k)
			{
				dp[i][j][k]=1e6;
			}
		}
	}
	int ans=0;
	for (int i = 1; i < n; ++i)
	{
		if(distance[0][i]<=r+0.0001) dp[1][0][i]=distance[0][i],ans=1;
	}

	for (int i = 1; i < 10000; ++i)
	{
		for (int j = 0; j < n; ++j)
		{
			for (int k = 0; k < n; ++k)
			{
				if(dp[i][j][k]!=1e6)
				{
					ans = max(ans,i);
					for (int l = 0; l < n; ++l)
					{
						if(moveok[j][k][l])
						{
							dp[i+1][k][l]=min(dp[i+1][k][l],dp[i][j][k]+distance[k][l]);
							if(dp[i+1][k][l]>r+0.0001) dp[i+1][k][l]=1e6;
							//if(dp[i+1][k][l]>0) ans=max(ans,i+1);
						}
					}
				}
			}
		}
	}
	cout<<ans<<endl;
	return 0;
}



Measured memory_bytes: 34824
package main

import "fmt"

func main() {
	var s string
	fmt.Scan(&s)

	m := make(map[byte]bool)
	for i := 0; i < len(s); i++ {
		m[s[i]] = true
	}

	for i := len(s); i >= 0; i-- {
		l := byte('a')
		if i < len(s) {
			l = s[i]
		}
		for j := l; j <= 'z'; j++ {
			if !m[byte(j)] {
				fmt.Println(s[0:i] + string(j))
				return
			}
		}
		if i < len(s) {
			m[s[i]] = false
		}
	}

	fmt.Println(-1)
}


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

#define PI acos(-1)
#define int long long int
#define pb push_back
#define pi pair<int, int>
#define fir first
#define sec second
#define MAXN 201
#define mod 1000000007

signed main()
{
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<int> v(n);
  for (int i = 0; i < n; i++)
  {
    int a, b;
    cin >> a >> b;
    (a == b) ? v[i] = 1 : v[i] = 0;
  }
  int best = 0, curr = 0;
  for (int i = 0; i < n; i++)
  {
    if (!v[i])
      curr = 0;
    else
      curr += v[i];
    best = max(best, curr);
  }
  (best >= 3) ? cout << "Yes\n" : cout << "No\n";
}

Measured memory_bytes: 3612
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>

bool solve() {
    int m;
    std::cin >> m;
    if (m == 0) return false;

    std::vector<std::pair<int, int>> ps;
    while (m--) {
        int x, y;
        std::cin >> x >> y;
        ps.emplace_back(x, y);
    }

    int n;
    std::cin >> n;
    std::set<std::pair<int, int>> qs;
    while (n--) {
        int x, y;
        std::cin >> x >> y;
        qs.emplace(x, y);
    }

    auto sp = ps.front();
    for (auto sq : qs) {
        int dx = sq.first - sp.first,
            dy = sq.second - sp.second;

        if (std::all_of(ps.begin(), ps.end(),
                        [&](auto p) {
                            p.first += dx;
                            p.second += dy;
                            return qs.count(p);
                        })) {
            std::cout << dx << " " << dy << "\n";
        }
    }

    return true;
}

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

    while (solve()) {}

    return 0;
}



Measured memory_bytes: 3152
#include <iostream>

/* run this program using the console pauser or add your own getch, system("pause") or input loop */
using namespace std;


int maxRow(int dp[][3],bool calculated[][3],int M[][3],int selection,int row){
	if(calculated[row][selection])return dp[row][selection];
	if(row==0){
		calculated[row][selection]=true;
		return dp[row][selection]=M[row][selection];
		
		}
		int max=-1;
		int parent=-1;
		for(int i =0;i<3;i++){
			if(i!=selection){
				if(max<maxRow(dp,calculated,M,i,row-1)+M[row][selection]){
				max=maxRow(dp,calculated,M,i,row-1)+M[row][selection];	
				parent=i;
				}
				
				
			}
		}
		calculated[row][selection]=true;
	
		
		return	dp[row][selection]=max; 
				
	}

int main(int argc, char** argv) {
	int N;
	cin>>N;
   int M[N][3];	
   bool calculated[N][3];
   int dp[N][3];
   
   


	for(int i =0;i<N;i++){
		for(int j=0;j<3;j++){
			cin>>M[i][j];
		calculated[i][j]=false;

		}
	}
	
	//cout<<maxRow(dp,calculated,M,0,N-1)<<endl;	
		int max=-1;
		int head=-1;
		for(int i =0;i<3;i++){
		if(max<maxRow(dp,calculated,M,i,N-1))
		max=maxRow(dp,calculated,M,i,N-1);
		
		}
	
	cout<<max<<endl;
	
	return 0;
}

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

typedef long long int lli;
#define N_MAX 100000

lli n;
lli h[N_MAX];
lli min_cost[N_MAX];

int main(void){
    // Your code here!
    cin >> n;
    for(int i = 0; i < n; i ++) cin >> h[i];
    
    for(int i = 0; i < n; i ++){
        // 足場iに到達する時の最小コストを調べる
        if (i >= 2){
            lli c1 = min_cost[i-1] + abs(h[i] - h[i-1]);
            lli c2 = min_cost[i-2] + abs(h[i] - h[i-2]);
            min_cost[i] = (c1 < c2) ? c1 : c2;
        }else if(i == 0){
            min_cost[0] = 0;
        }else{
            min_cost[1] = abs(h[1] - h[0]);
        }
    }
    cout << min_cost[n-1];
}

Measured memory_bytes: 1792
import collections
s = int(input())
a = []
def prime_factorize(n):
    global a
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)

for i in range(2,s+1):
    prime_factorize(i)

c = collections.Counter(a)
ans = 1
for i in c.values():
    ans *= (i+1)
    ans %= 1000000007

print(ans)


Measured memory_bytes: 3316
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};

    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };

    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };

    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };

    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };

    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}
use std::collections::HashMap;
use std::cmp::{max,min};
fn main(){
    input!{
        n:i64,
        k:i64,
        hn:[i64;n],
    }
    let ans = hn.iter().filter(|&x| *x >= k).count();
    println!("{}",ans);
}


fn is_prime(x:i64) -> bool {
    if x == 2 {return true;}
    if x < 2 || x % 2 == 0 {return false;}
    let mut j = 3;
    while j <= (x as f64).sqrt() as i64 {
        if x % j == 0 {
            return false;
        }
        j += 2;
    }
    true
}


Measured memory_bytes: 4352
#include <bits/stdc++.h>
#define syosu(x) fixed<<setprecision(x)
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> P;
typedef pair<double,double> pdd;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<string> vs;
typedef vector<P> vp;
typedef vector<vp> vvp;
typedef vector<pll> vpll;
typedef pair<int,P> pip;
typedef vector<pip> vip;
const int inf=1<<30;
const ll INF=1ll<<60;
const double pi=acos(-1);
const double eps=1e-9;
const ll mod=1e9+7;
const int dx[4]={0,1,0,-1},dy[4]={1,0,-1,0};

int h,w;
vi b;

int main(){
	cin>>h>>w;
	b=vi(w+1);
	int res=0;
	for(int i=0;i<h;i++){
		stack<pip> st;
		st.push({-1,{-1,-1}});
		for(int j=0;j<=w;j++){
			if(j<w){
				int x;
				cin>>x;
				if(!x) b[j]++;
				else b[j]=0;
			}
			while(st.top().first>b[j]){
				pip p=st.top();st.pop();
//				cout<<p.second<<' '<<j<<' '<<p.first<<endl;
				res=max(res,(j-p.second.first)*p.first);
			}
//			cout<<j<<' '<<st.top().second.second+1<<endl;
			st.push({b[j],{st.top().second.second+1,j}});
		}
//		for(auto j:b) cout<<j<<' ';
//		cout<<endl;
//		cout<<res<<endl;
	}
	cout<<res<<endl;
}


Measured memory_bytes: 3168
#include<iostream>
#include<cstdint>
using namespace std;

int main() {
	int64_t X, Y;
	cin >> X >> Y;
	
	int N = 0;
	for (N = 0;X <= Y;X <<= 1) ++ N;
	cout << N;
	return 0;
}
/*
31536000のコメント解説欄
ここテンプレで用意してるから、A問題とかだとこの先空欄の危険あり
また、コンテスト後に https://31536000.hatenablog.com/ で解説していると思うので、良かったら読んでねー

どう考えても、常に2倍ずつにするのが操作最大
*/

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
	ll n;
	cin >> n;
	unordered_map<string, int>ans;
	while (n--) {
		string s;
		cin >> s;
		ans[s]++;
	}
	cout << "AC x " << ans["AC"] << endl;
	cout << "WA x " << ans["WA"] << endl;
	cout << "TLE x " << ans["TLE"] << endl;
	cout << "RE x " << ans["RE"] << endl;
}

Measured memory_bytes: 3612
N = int(input())
d = {'AC':0, 'WA':0, 'TLE':0, 'RE':0}
for _ in range(N):
    s = input()
    d[s] += 1

print("AC x " + str(d['AC']))
print("WA x " + str(d['WA']))
print("TLE x " + str(d['TLE']))
print("RE x " + str(d['RE']))

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

typedef long long ll;
typedef long double ld;
typedef unsigned long long ull;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cout<<setprecision(32);

	ll n, m;
	cin>>n>>m;
	ll t = 1900*m + 100*(n - m);
	while(m--)t <<= 1;
	cout<<t<<endl;

	return 0;
}

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

#define check(val) std::cout << "\033[31m" << #val << ": " << val << "\033[m" << std::endl
#define check_v(vec) \
  std::cout << "\033[31m" << #vec << ": [ ";\
  for(auto it=vec.begin(); it!=vec.end(); it++){cout << *it << " ";}\
  cout << "]"<< "\033[m" << endl;

int main() {
  int n;
  cin >> n;
  cout << (n+1) / 2 << endl;
  return 0;
}


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

int main()
{
  int N;
  cin >> N;
  vector<int> b(N);
  for (int i = 0; i < N; i++)
  {
    cin >> b[i];
  }
  bool can = true;
  vector<int> ans;
  while (b.size() > 0)
  {
    int tmpb = 0;
    int tmp = 100000;
    for (int i = 0; i < b.size(); i++)
    {
      if (i + 1 == b[i])
      {
        tmpb = b[i];
        tmp = i;
      }
    }
    if (tmp == 100000)
    {
      can = false;
      break;
    }
    ans.push_back(tmpb);
    b.erase(b.begin() + tmp);
  }
  if (can)
  {
    for (int i = N - 1; i >= 0; i--)
    {
      cout << ans[i] << endl;
    }
  }
  else
    cout << -1 << endl;
}

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

public class Main {

	public static void main(String[] args) throws IOException {
		//キーボード入力メソッド
		Scanner sc = new Scanner(System.in);

		//変数宣言
		int a = 0;
		String op = "";
		int b = 0;
		int ans = 0;

		while(true) {
			//値入力
			a = sc.nextInt();
			op = sc.next();
			b = sc.nextInt();

			//opが？の時に処理を終了する
			if(op.equals("?")) {
				break;
			}

			//opの値による条件分岐
			switch(op) {
			case "+":
				ans = a + b;
				break;
			case "-":
				ans = a - b;
				break;
			case "*":
				ans = a * b;
				break;
			case "/":
				if(b != 0) {
					ans = a/ b;
				}
				break;
			}

			//出力
			System.out.println(ans);
		}



	}

}



Measured memory_bytes: 26236
//Compete against Yourself.
#include <bits/stdc++.h>
#define _ ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define int long long
#define sz(i) (int)(i.size())
#define F first
#define S second
#define L long double
#define P pair<int, int>
const int inf = 0x3f3f3f3f3f3f3f3LL;
const int mod = (int)1e9 + 7;
using namespace std;
#if LOCAL
#include "../../tr.h"
#else
#define tr(...)
#define endl '\n'
#endif
template<class T> void smin(T& a, T val) {if (a > val) a = val;}template<class T> void smax(T& a, T val) {if (a < val) a = val;}
const int N = 5*(int)1e5 + 10;

void yes(){
   cout<<"YES"<<endl;
   //exit (0);
}
void no(){
   cout<<"NO"<<endl;
   //exit (0);   
}

int n, m;
string s, t;

int32_t main(){_
   
   cin >> n >> m;

   cout<<(n+m-1)/m;   



   return 0;
}

Measured memory_bytes: 256
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'


void solve(){
  int a, b, c;
  cin >> a >> b >> c;
  int m = max(a, max(b, c));
  int x = m;
  if (3*m % 2 != (a+b+c) % 2) x++;
  cout << (3*x - (a+b+c))/2;
}

int main() {
  ios::sync_with_stdio(false);
  // cin.tie(0); cout.tie(0);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 

k (k-1) (k-1)

2 6 3
4 6 5
6 6 7
7 7 7

*/

Measured memory_bytes: 3636
import java.util.*;

public class Main {
	
	private void doit(){
		
		
		Scanner sc = new Scanner(System.in);
		while(sc.hasNext()){
			int n = sc.nextInt();
			int [] data = new int[n];
			for(int i = 0; i < n; i++){
				data[i] = sc.nextInt();
			}
			int count = 0;
			for(int i = 0; i < n; i++){
				if(data[i] % 2 == 1){
					count++;
				}
			}
			if(count % 2 == 0){
				System.out.println("YES");
			}
			else{
				System.out.println("NO");
			}
		}
		

	}

	private void debug(Object... o) {
		System.out.println("debug = " + Arrays.deepToString(o));
	}

	public static void main(String[] args) {
		new Main().doit();
	}

}


Measured memory_bytes: 34072
#include <bits/stdc++.h>
#include <algorithm>
using namespace std;
#define fio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define endl "\n"
#define ll long long
#define pii pair<int,int>
#define pll pair<ll,ll>
#define F first
#define S second
#define bitcnt(v) __builtin_popcount(v)
#define all(v) v.begin(), v.end()

int mod = 1e9 + 7;

void solution(){
	int n; cin >> n;
	string s; cin >> s;
	// dp[i][j] -- number of permutations upto i ending in j, only for numbers from 1 -- i
	ll dp[n+1][n+1];
	memset(dp,0,sizeof(dp));
	dp[1][1] = 1;
	vector<ll> pre(n+1,0);
	for(int i = 1; i <= n; i++) pre[i] = 1;
	for(int len = 2; len <= n; len++){
		vector<ll> new_pre(n+1,0);
		for(int num = 1; num <= len; num++){
			if(s[len-2] == '>'){
				dp[len][num] += (pre[len-1] - pre[num-1] + mod) % mod;
			}
			else{
				dp[len][num] += pre[num-1];
			}
			dp[len][num] %= mod;
			new_pre[num] = (new_pre[num-1] + dp[len][num]) % mod;
		}
		swap(pre,new_pre);
	}
	ll ans = 0;
	for(int i = 1; i <= n; i++){
		ans += dp[n][i];
		ans %= mod;
	}
	cout << ans << endl;

}   


int main(){ 

	fio;
	int t;
	t = 1;
	// cin >> t;
	for(int i = 1; i <= t; i++){
		// cout << "Case #" << i << ": ";
		solution();
	} 
	return 0;
}


Measured memory_bytes: 74016
#include<iostream>
#include<vector>
#include<algorithm>
#include<string>
#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);i >= (b); --i)
#define ALL(obj) (obj).begin,(obj).end()
#define SORT(list) sort(ALL((list)));
using namespace std;
using ll = long long;
int main(){
    int n;
    cin >> n;
    vector<int> h(100);
    REP(i,n)cin >> h[i];
    int answer = 0;
    vector <int> seed(100,0);

    while (true){
        if(*max_element(h.begin(),h.end()) == 0)break;
        int i=0;
        while(i < n){
            if(h[i]==0)i++;
            else{
                answer++;
                while(h[i]!=0){
                    h[i]--;
                    i++;
                }
            }
        }
    }
    
    cout << answer << endl;
    return 0;
}

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

using ll = long long;
using Pi = pair<int, int>;
using Pl = pair<ll, ll>;
using vint = vector<int>;
template<typename T> using uset = unordered_set<T>;
template<typename T1, typename T2> using umap = unordered_map<T1, T2>;

constexpr int INF = (1 << 30) - 1;
constexpr ll LLINF = 1LL << 60;
constexpr int dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
constexpr int dx[] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr char el = '\n';
constexpr int mod = 1000000007;

template<typename T> T gcd(T a, T b) { return (b ? gcd(b, a % b) : a); }
template<typename T> T lcm(T a, T b) { return (a / gcd(a, b) * b); }
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

int main() {
    int N;
    int A[100005];
    int cnt = 0;
    cin >> N;
    for (int i = 0; i < N; i++) {
        cin >> A[i];
        if (i > 0 && A[i] - A[i - 1] > 0) cnt++;
    }
    cout << cnt << endl;
    return (0);
}



Measured memory_bytes: 3488
package main

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

const MOD = 1e9 + 7

func xorSum4(n int, a []int) int {

	var ans int
	for d := 0; d < 61; d++ {
		var zero, one int
		x := 1 << uint(d)
		for i := range a {
			if 0 < (a[i] & x) {
				one++
			} else {
				zero++
			}
		}
		// Devide because it overflows.
		// SeeAlso: https://qiita.com/drken/items/3b4fdf0a78e7a138cd9a#オーバーフローに注意
		v := (zero * one % MOD) * (x % MOD) % MOD
		ans = (ans + v) % MOD
	}
	return ans
}

func main() {
	reader := bufio.NewReaderSize(os.Stdin, 10240*10240)

	n, err := strconv.Atoi(readLine(reader))
	checkError(err)
	a := make([]int, n)
	ss := strings.Split(readLine(reader), " ")
	for i := range ss {
		a[i], err = strconv.Atoi(ss[i])
		checkError(err)
	}
	fmt.Println(xorSum4(n, a))
}

func readLine(reader *bufio.Reader) string {
	str, _, err := reader.ReadLine()
	if err == io.EOF {
		return ""
	}

	return strings.TrimRight(string(str), "\r\n")
}

func checkError(err error) {
	if err != nil {
		panic(err)
	}
}


Measured memory_bytes: 24576
n, k = map(int, input().split())
x = list(map(int, input().split()))
mintime = 10**20
for i in range(n-k+1):
    left = x[i]
    right = x[i+k-1]
    abss = (abs(left), abs(right))
    if left * right >= 0:
        mintime = min(mintime, max(abss))
    else:
        mintime = min(mintime, min(abss) * 2 + max(abss))
print(mintime)


Measured memory_bytes: 14252
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <stdlib.h>
#include <limits.h>
#include <stdbool.h>

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

//qsort(str, n, sizeof(int), up_comp);
int up_comp(const void *a, const void *b){return *(int*)a - *(int*)b;}
int down_comp(const void *a, const void *b){return *(int*)b - *(int*)a;}
int int_sort( const void * a , const void * b ) {return strcmp(( char * )a , ( char * )b );}
int count_digit(int a){int i=0;while(a!=0){a=a/10;i++;}return i;}
int euclid( int a, int b ){int temp;if(a<b){temp=a;a=b;b=temp;}if(b<1)return -1;if(a%b==0) return b;return euclid(b,a%b);}

int main(void){
 
    int n, m;
    int ans;
    
    scanf("%d%d", &n, &m);
    
    if (n%m==0) {
        ans=n/m;
    } else {
        ans=1+n/m;
    }
    
    printf("%d", ans);

    return 0;
}



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

using namespace std;
 
int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	
	vector<string> pic;
	string tmp;
	int h, g;
	
	cin >> h >> g;
	h++;
	
	while(h--){
		getline(cin, tmp);
		pic.push_back(tmp);
		pic.push_back(tmp);
		#ifdef DEBUG
		cout << h << "\n";
		cout << tmp << "\n";
		#endif
	}
	
	for(int i = 2; i < pic.size() - 1; ++i){
		#ifdef DEBUG
		cout << "i: " << i << "\n";
		#endif
		cout << pic[i] << '\n';
	}
	cout << pic[pic.size() - 1];
	
	return 0;
}

Measured memory_bytes: 256
/*-****************************************-*/

#define USE_CPP11

#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>

#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <bitset>
#ifdef USE_CPP11
# include <unordered_set>
# include <unordered_map>
# include <array>
# include <valarray>
#endif // USE_CPP11

#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>

#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <cctype>
#include <cstring>
#include <ctime>
#include <climits>
#include <cassert>

using namespace std;

/*-****************************************-*/

typedef pair<int, int> pii;
typedef long long ll;

/*-****************************************-*/

#define mp make_pair

#define sz_array(a) (sizeof(a) / sizeof((a)[0]))

#define all(a) (a).begin(),(a).end()
#define r_all(a) (a).rbegin(), (a).rend()

#define exists(container, elem) ((container).find(elem) != (container).end())

/*-****************************************-*/

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

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

template<typename T, size_t size> void Fill(void *ptr, T value) {
    fill((T *)ptr, (T *)ptr + size / sizeof(T), value);
}

/*-****************************************-*/

static const double EPS = 1e-10;
static const double PI = acos(-1.0);
static const int INF = 1 << 28;

/*-****************************************-*/

#ifdef DEBUG
#define ANSWER_PREFIX() cout << "[[ Answer ]] "
#else
#define ANSWER_PREFIX()
#endif // DEBUG

/*-****************************************-*/

//////////////////////////////////////////////////
//////////////////////////////////////////////////
//////////////////////////////////////////////////

constexpr int MaxN = 8 + 10, MaxM = 8 * (8 - 1) / 2 + 10;
int n, m;
vector<int> E[MaxN];
bool done[MaxN];

int Solve(int no, int remain) {
    if (remain == 0) {
        return 1;
    }

    done[no] = true;

    int ans = 0;
    for (auto& next : E[no]) {
        if (!done[next]) {
            ans += Solve(next, remain - 1);
        }
    }

    done[no] = false;
    return ans;
}

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

    for (size_t i = 0; i < m; i++) {
        int a, b;
        cin >> a >> b;
        a--; b--;
        E[a].push_back(b);
        E[b].push_back(a);
    }

    int ans = Solve(0, n - 1);
    ANSWER_PREFIX();
    cout << ans << endl;
}


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

#define rep(i, n) for (int i = (int)(0); i < (int)(n); ++i)
#define reps(i, n) for (int i = (int)(1); i <= (int)(n); ++i)
#define rrep(i, n) for (int i = ((int)(n)-1); i >= 0; i--)
#define rreps(i, n) for (int i = ((int)(n)); i > 0; i--)
#define irep(i, m, n) for (int i = (int)(m); i < (int)(n); ++i)
#define ireps(i, m, n) for (int i = (int)(m); i <= (int)(n); ++i)
#define FOR(e, c) for (auto &e : c)
#define SORT(v, n) sort(v, v + n);
#define vsort(v) sort(v.begin(), v.end());
#define rvisort(v) sort(v.begin(), v.end(), greater<int>());
#define all(v) v.begin(), v.end()
#define mp(n, m) make_pair(n, m);
#define coutd(d) cout<<std::setprecision(10)<<d<<endl;
#define cinline(n) getline(cin,n);

using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using pii = pair<int, int>;
using vpii = vector<pii>;
using vs = vector<string>;
using vd = vector<double>;
using ul = unsigned long;

template<class T, class C> void chmax(T& a, C b){ a>b?:a=b; }
template<class T, class C> void chmin(T& a, C b){ a<b?:a=b; }

const int mod=1e9+7;

struct mint {
  ll x;
  mint(ll x=0):x(x%mod){}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= mod;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res+=a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res-=a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res*=a;
  }
};

mint c[4005][4005];
void init() {
  c[0][0] = 1;
  for (int i = 0; i <= 4000; i++) {
    for (int j = 0; j <= i; j++) {
      c[i+1][j] += c[i][j];
      c[i+1][j+1] += c[i][j];
    }
  }
}
mint comb(int n, int k) {
  return c[n][k];
}

bool IsPrime(int num)
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false;

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return false;
        }
    }

    return true;
}

map<ll, ll> primeFact(ll n) {
  map<ll, ll> res;
  for (ll i = 2; i * i <= n; i++) {
    while (n % i == 0) {
      res[i]++;
      n /= i;
    }
  }
  if (n != 1) res[n]++;
  return res;
}

void printv(vi& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
void printv(vll& v){
  rep(i,v.size()) cout << v[i] << " ";
  cout << endl;
}
int vtotal(vi& v){
  int total=0;
  rep(i,v.size()) total+=v[i];
  return total;
}

int main()
{
  //init(); // mint初期化
  cin.tie( 0 );
  ios::sync_with_stdio( false );

  int t,x;cin>>t>>x;
  double ans=(double)t/x;
  
  coutd(ans);

  return 0;
}

Measured memory_bytes: 125568
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for(int i = 0; i < n; i++)
#define rep2(i, x, n) for(int i = x; i <= n; i++)
#define rep3(i, x, n) for(int i = x; i >= n; i--)
#define elif else if
#define sp(x) fixed << setprecision(x)
#define pb(x) push_back(x)
#define all(x) x.begin(), x.end()
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pil = pair<int, ll>;
using pli = pair<ll, int>;
using pll = pair<ll, ll>;
const ll MOD = 1e9+7;
//const ll MOD = 998244353;
const int inf = 1e9;
const ll INF = 1e18;
const ld EPS = 1e-10;

template<ll mod> struct Mod_Int{
    ll x;
    Mod_Int() {}
    Mod_Int(ll y) : x(y >= 0 ? y % mod : (mod - (-y) % mod) % mod){}

    Mod_Int &operator += (const Mod_Int &p) {
        x = (x + p.x) % mod;
        return *this;
    }

    Mod_Int &operator -= (const Mod_Int &p) {
        x = (x + mod - p.x) % mod;
        return *this;
    }

    Mod_Int &operator *= (const Mod_Int &p) {
        x = (x * p.x) % mod;
        return *this;
    }

    Mod_Int &operator /= (const Mod_Int &p) {
        *this *= p.inverse();
        return *this;
    }

    Mod_Int operator -() const {return Mod_Int(-x);}

    Mod_Int operator + (const Mod_Int &p) const {return Mod_Int(*this) += p;}

    Mod_Int operator - (const Mod_Int &p) const {return Mod_Int(*this) -= p;}

    Mod_Int operator * (const Mod_Int &p) const {return Mod_Int(*this) *= p;}

    Mod_Int operator / (const Mod_Int &p) const {return Mod_Int(*this) /= p;}

    bool operator == (const Mod_Int &p) const {return x == p.x;}

    bool operator != (const Mod_Int &p) const {return x != p.x;}

    Mod_Int pow(ll n) const{
        Mod_Int now = *this, ret = 1;
        while(n > 0){
            if(n & 1) ret *= now;
            now *= now, n >>= 1;
        }
        return ret;
    }

    Mod_Int inverse() const{
        return pow(mod-2);
    }
};

using mint = Mod_Int<MOD>;
const int MAX_N = 1e5;
mint fac[MAX_N+1];

void init(){
    fac[0] = 1;
    rep2(i, 1, MAX_N){
        fac[i] = fac[i-1]*mint(i);
    }
}

mint comb(mint n, mint k){
    return fac[n.x]/(fac[n.x-k.x]*fac[k.x]);
}

mint perm(mint n, mint k){
    return fac[n.x]/fac[n.x-k.x];
}

int main(){
    int N, K;
    cin >> N >> K;
    int n = 0;
    for(int i = 1; i*i <= N; i++){
        if(i*i == N) n++;
        else n += 2;
    }
    mint num[n];
    for(int i = 1; i*i <= N; i++){
        num[n-i] = N/i - max(i, N/(i+1));
        num[i-1] = 1;
    }
    //rep(i, n) cout << num[i].x << ' ';
    cout << endl;
    mint dp[K+1][n], sum[K+1][n];
    fill(dp[0], dp[K+1], 0);
    fill(sum[0], sum[K+1], 0);
    dp[0][0] = 1;
    rep(i, n) sum[0][i] = 1;
    rep2(i, 1, K){
        rep(j, n){
            dp[i][j] = num[j] * sum[i-1][n-1-j];
        }
        sum[i][0] = dp[i][0];
        rep2(j, 1, n-1){
            sum[i][j] = sum[i][j-1]+dp[i][j];
        }
    }
    cout << sum[K][n-1].x << endl;
}

Measured memory_bytes: 100608
import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int h = sc.nextInt();
        int ans = (a+b)*h/2;
        System.out.println(ans);
    }
}

Measured memory_bytes: 9684
import sys

input = sys.stdin.readline


def main():
    D = int(input())

    if D == 25:
        ans = "Christmas"
    elif D == 24:
        ans = "Christmas Eve"
    elif D == 23:
        ans = "Christmas Eve Eve"
    else:
        ans = "Christmas Eve Eve Eve"

    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 2940
#include <iostream>

using namespace std;

int main() {
    unsigned long long a;
    string b;
    cin >> a >> b;
    cout << (a * (b[0]-'0') * 100 + a * (b[2]-'0') * 10 + a * (b[3]-'0')) / 100 << endl;
    return 0;
}

Measured memory_bytes: 3628
using System;
class Program
{
	static void Main(string[] args)
	{
		// スペース区切りの整数の入力
		string[] input = Console.ReadLine().Split(' ');
		int a = int.Parse(input[0]);
		int b = int.Parse(input[2]);

		if(input[1]=="+") Console.WriteLine(a+b);
		else if(input[1]=="-")  Console.WriteLine(a-b);

	}
}

Measured memory_bytes: 2648
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Math;

namespace B_ABC147
{
    class MainClass
    {

        //static int[] s;

        public static void Main(string[] args)
        {
            string s1 = ReadLine();
            string s2 = new string(s1.Reverse().ToArray()); // olleh
            int cnt = 0;
            for(int i= 0;i<s1.Length/2;i++){
                if(s1[i]!=s2[i]){
                    cnt++;

                }
            }
            WriteLine(cnt);
        }
    }
}


Measured memory_bytes: 13268
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
int main()
{
    ll a,b,i,j,k,l;
    ll flag=0;
     cin>>a>>b;
     for(i=1;i<=10000000;i++)
     {
        double x,y,z;
        x=0.08;
        y=0.1;
        z=i;
        x=x*z;
        y=y*z;
        j=x;
        k=y;
        if(j==a&&k==b)
        {
            cout<<i<<endl;
            return 0;
        }
     }
     cout<<"-1\n";
    return 0;
}

Measured memory_bytes: 256