akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef pair<int,int> P;
constexpr ll INF = (1LL << 60);

int main() {
  int n;
  cin >> n;
  vector<int> a(n);
  rep(i,n) cin >> a[i];
  int res = 0;
  rep(i,n) res += a[i];
  cout << res - n << endl;
  return 0; 
} 

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

namespace HelloWorld
{
	class MainClass
	{
		public static void Main (string[] args)
		{
			int n = int.Parse(Console.ReadLine());

			for (int i = 0; i < n; ++i) {
				string[] str = Console.ReadLine ().Split (' ');
				int y = int.Parse (str [0]);
				int m = int.Parse (str [1]);
				int d = int.Parse (str [2]);
				int thnum = (y-1) / 3;
				int sum = 0;
				sum += 200 * thnum;
				sum += 195 * (y - 1 - thnum);
				if (y % 3 != 0) {
					if (m % 2 == 0) {
						sum += (m / 2) * 20 + ((m - 2) / 2) * 19;
					} else {
						sum += ((m - 1) / 2) * 39;
					}
					sum += d;
				} else {
					sum += (m - 1) * 20;
					sum += d;
				}
				Console.WriteLine (196471-sum);
			}
		}
	}
}



Measured memory_bytes: 9248
N, K = map(int, input().split())
XY = [list(map(int, input().split())) for _ in range(N)]
X, Y = zip(*XY)
X_s = sorted(X)
Y_s = sorted(Y)

r = 10**20
for xi0 in range(N):
  for xi1 in range(xi0, N):
    for yi0 in range(N):
      for yi1 in range(yi0, N):
        x0 = X_s[xi0]
        x1 = X_s[xi1]
        y0 = Y_s[yi0]
        y1 = Y_s[yi1]
        c = 0
        for x, y in XY:
          if x0 <= x <=x1 and y0 <= y <= y1:
            c += 1
        if c >= K:
          r = min(r, (x1 - x0) * (y1 - y0))
print(r)

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

public class Main {

    public static void main(String[] args) {
        /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */
        Scanner in=new Scanner(System.in);
        int n=in.nextInt();
        int m=in.nextInt();
        long M=1000000007L;
        char A[][]=new char[n][m];
        long dp[][]=new long[n][m];
        for(int i=0;i<n;i++)
        {
            String s=in.next();
            for(int j=0;j<m;j++)
            {
                A[i][j]=s.charAt(j);
                dp[i][j]=0;
            }

        }

        dp[0][0]=1;
        for(int i=0;i<n;i++)
        {
            for(int j=0;j<m;j++)
            {
                if(A[i][j]!='#')
                {
                    if(i-1>=0)
                    {
                        dp[i][j]=(dp[i][j]+dp[i-1][j]+M)%M;
                    }
                    if(j-1>=0)
                    {
                        dp[i][j]=(dp[i][j]+dp[i][j-1]+M)%M;
                    }
                }

            }
        }
        long res=(dp[n-1][m-1]+M)%M;
        System.out.println(res);
    }
}

Measured memory_bytes: 40920
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef long double lld;
ll MOD = (1e9)+7;
const int dr[] = {+1, -1, +0, +0, +1, -1, +1, -1};
const int dc[] = {+0, +0, +1, -1, +1, -1, -1, +1};
const int kx[] = {+1, +2, -1, -2, +1, +2, -1, -2};
const int ky[] = {+2, +1, +2, +1, -2, -1, -2, -1};
//#pragma GCC target ("avx2")
//#pragma GCC optimization ("O3")
//#pragma GCC optimization ("unroll-loops")
inline void fastIO(){
  ios_base::sync_with_stdio(0);cin.tie(0);
}
template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

void debug_out() { cerr << endl; }
template<typename Head, typename... Tail> void debug_out(Head H, Tail... T) { cerr << ' ' << H; debug_out(T...); }

#ifdef LOCAL
#define debug(...) cerr << "(" << #__VA_ARGS__ << "):", debug_out(__VA_ARGS__)
#else
#define debug(...) 47
#endif

int main(){
  fastIO();
  int n,x,val,minn=1e9,ans;
  cin>>x>>n;
  vector<bool>exists(1010,false);
  for(int i=0;i<n;i++){
    cin>>val;
    exists[val]=true;
  }
  for(int i=0;i<1010;i++){
    if(!exists[i]&&abs(i-x)<minn){
      minn=abs(i-x);
      ans=i;
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 3656
#include <stdio.h>

 int main(void){

    int a;
    int b;
    int c;
   
    scanf("%d %d %d",&a,&b,&c);

         if(a <= b && b <= c){
     printf("%d %d %d\n",a,b,c);

   }else if(a <= c && c <= b){
     printf("%d %d %d\n",a,c,b);

   }else if(b <= a && a <= c){
     printf("%d %d %d\n",b,a,c);

   }else if(b <= c && c <= a){
     printf("%d %d %d\n",b,c,a);

   }else if(c <= a && a <= b){
     printf("%d %d %d\n",c,a,b); 

   }else{
     printf("%d %d %d\n",c,b,a);
   }
    return 0;
}
   
 

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

int main(){
    int x,y;

    cin>>x>>y;

    for(int i=0; i<=x; i++){
        if(2*i + 4*(x-i) == y){
            cout<<"Yes"<<endl;
            return 0;
        }
    }
    cout<<"No"<<endl;
}


Measured memory_bytes: 3632
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;
using System.Runtime.InteropServices.ComTypes;
using System.Xml.Schema;
using System.ComponentModel.DataAnnotations;
using System.Security.Cryptography;
using System.Drawing;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var a = Sarray()[0];
            if (3200 <= a)
                WriteLine(ReadLine());
            else
                WriteLine("red");
        }

        static long Mod = (long)1e9 + 7;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
        static public (T a, T b, T c, T d) Slice4<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)),
            (T)Convert.ChangeType(t[3], typeof(T)));
        }
    }
}

Measured memory_bytes: 28232
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>
#define vv(a, b, c, d) vector<vector<d> >(a, vector<d>(b, c))
#define vvi vector<vector<int> >
#define vvl vector<vector<ll> >
#define vll vector<ll>
#define rep(c, a, b) for(ll c=a;c<b;c++)
#define re(c, b) for(ll c=0;c<b;c++)
#define all(obj) (obj).begin(), (obj).end()
typedef long long int ll;
typedef long double ld;
using namespace std;

int main(int argc, char const *argv[]) {
  ll t, n, k;std::cin >> n >> k;
  vll num(300000, 0);
  re(i, n){
    std::cin >> t;
    num[t]++;
  }
  sort(all(num));
  reverse(all(num));
  ll o = 0;
  for(int i=0;i<k;i++){
    o += num[i];
  }
  std::cout << n - o << '\n';
  return 0;
}


Measured memory_bytes: 2560
import java.util.*;

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

class Solver {

    public void run() {
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int[] X = new int[N];

        int sum = 0;
        for (int i = 0; i < N; i++) {
            X[i] = sc.nextInt();
            sum += X[i];
        }

        int min = Integer.MAX_VALUE;
        for (int P = 1; P <= 100; P++) {
            int cnd = 0;
            for (int i = 0; i < N; i++) {
                cnd += (X[i] - P) * (X[i] - P);
            }
            min = Math.min(min, cnd);
        }

        System.out.println(min);
        return;
    }

}

Measured memory_bytes: 22740
/*


*/

#define _CRT_SECURE_NO_WARNINGS
#include <bits/stdc++.h>
using namespace std;

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

#define endl '\n'
#define ld long double
#define ll long long
#define PI acos(-1.0)
#define OO 1e13
#define EPS 1e-12
#define MLOG 20
#define MAX 1* 100 * 1000+5
const int mod = 1e9 + 7;
int dcmp(double x, double y) { return fabs(x - y) <= EPS ? 0 : x < y ? -1 : 1; }


void fast(){
#ifndef ONLINE_JUDGE
	freopen("E:\\Competitve\\solving\\input.txt", "r", stdin);
	freopen("E:\\Competitve\\solving\\output.txt", "w", stdout);
#endif
}
int n, k, s;
int w[101], v[101];

ll dp[101][MAX];
int main(){
	//fast();

	std::ios_base::sync_with_stdio(0);
	cin.tie(NULL); cout.tie(NULL);
	cin >> n >> k;
	for (int i = 0; i < n; i++)
		cin >> w[i] >> v[i] , s+=v[i];

	for (int i = 1; i <= s; i++)
		dp[0][i] = OO;

	dp[0][v[0]] = w[0];
	for (int i = 1; i< n ; i++){
		for (int j = 1; j <= s; j++){
			dp[i][j] = dp[i - 1][j];
			if (j >= v[i] && w[i] + dp[i-1][j-v[i]] <= k){
				dp[i][j] = min(dp[i][j], dp[i - 1][j - v[i]] + w[i]);
			}
		}
	}
	int ans = 0;
	for (int i = 0; i <= s; i++){
		if (dp[n - 1][i] != OO)
			ans = i;
	}

	cout << ans << endl;
	return 0;

}

Measured memory_bytes: 78336
#include <iostream>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <string>
#include <cstdio>
#include <cstdlib>
#include <string>
#include <cstring>
#include <cmath>
#include <climits>
#include <ctime>
#include <fstream>
#include <functional>
#include <unordered_map>
#include <unordered_set>
#define endl '\n'
//#define ll long long
#define mod 1000000007
#define NCONS 200001
//#define NCONS 100001
//#define NCONS 1001
//#define NCONS 101
#define MCONS 2001
#define LIMIT 1000000000
#define TRUE 1
#define FALSE 0
#define toRadian(degree) ((degree) * (M_PI / 180.))
#define toDegree(radian) ((radian) * (180. / M_PI))
using namespace std;
struct Point{int x; int y;};
struct PPoint{Point x; Point y;};
typedef long long ll;
ll gcd(ll a, ll b) { if(a < b) swap(a, b); if(b <= 0) return a; return gcd(b, a % b); }

ll N, K;
ll ret;
string s;
ll X, Y;
ll n, k;

ll dp[NCONS][13];

int main(void)
{
    cin.tie(NULL); ios_base::sync_with_stdio(false);
    cin >> s;
    
    dp[0][0] = 1;
    
    for(int i = 0; i < s.size(); i++)
    {
        int idx = i + 1;
        auto ch = s[i];
        if(ch == '?')
        {
            for(int number = 0; number <= 9; number++)
            {
                for(int k = 0; k < 13; k++)
                {
                    dp[idx][(k*10 + number) % 13] += dp[idx-1][k];
                    dp[idx][(k*10 + number) % 13] %= mod;
                }
            }
        }
        else
        {
            auto number = ch - '0';
            for(int k = 0; k < 13; k++)
            {
                dp[idx][(k*10 + number) % 13] += dp[idx-1][k];
                dp[idx][(k*10 + number) % 13] %= mod;
            }
        }
    }
    
    cout << dp[s.size()][5] << endl;
            
    
    return 0;
}


Measured memory_bytes: 10704
-- SegTree
-- Ref: http://tsutaj.hatenablog.com/entry/2017/03/29/204841
local function SegTree(func, ident, vec)
    -- func: binary function
    -- ident: identity element
    -- vec: table

    -- private variables
    -- func, ident are also private variables
    local a = {}
    -- n is smallest power of 2 that is greater than or equal to #vec
    local n = 1
    -- end of private variables
    -- constructor
    do -- just make a scope
        while n < #vec do
            n = n << 1
        end
        local size = 2*n - 1
        for i=1, size do
            a[i] = ident
        end
        for i=1, #vec do
            a[i+n-1] = vec[i]
        end
        for i=n-1,1,-1 do
            a[i] = func(a[2*i], a[2*i+1])
        end
    end
    vec = nil
    -- public member functions
    local self = {}
    self.update = function(idx, val)
        idx = idx + n - 1
        a[idx] = val
        while true do
            idx = idx // 2
            a[idx] = func(a[idx*2], a[idx*2 + 1])
            if idx == 1 then
                break
            end
        end
    end
    self.query = function(left, right)
        -- query to [left, right)
        -- **be careful about right half open interval**
        local function q(k, l, r)
            if r <= left or l >= right then
                return ident
            end
            if l >= left and r <= right then
                return a[k]
            end
            local vl = q(2*k  , l, (l+r)//2)
            local vr = q(2*k+1, (l+r)//2, r)
            return func(vl, vr)
        end
        return q(1, 1, n + 1)
    end
    return self
end

------
local function gcd(a,b)
    if b == 0 then
        return a
    else
        return gcd(b, a % b)
    end
end
----

local N = io.read("n")
local A = {}
for i=1,N do
    A[i] = io.read("n")
end
local st = SegTree(gcd, 0, A)
local maxval = 0
local mathmax = math.max
local query = st.query
for i=1, N do
    local left = query(1, i)
    local right = query(i+1, N+1)
    local g = gcd(left, right)
    maxval = mathmax(maxval, g)
end
print(maxval)


Measured memory_bytes: 44920
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
using namespace std;
typedef long long ll;
typedef vector<int> VI;
typedef vector<VI> VVI;

const int mod = 1000000007;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x = 0) : x((x % mod + mod) % mod) {}
  mint operator-() const { return mint(-x); }
  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 { return mint(*this) += a; }
  mint operator-(const mint a) const { return mint(*this) -= a; }
  mint operator*(const mint a) const { return mint(*this) *= a; }
  mint pow(ll t) const {
    if (!t)
      return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1)
      a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod - 2); }
  mint &operator/=(const mint a) { return *this *= a.inv(); }
  mint operator/(const mint a) const { return mint(*this) /= a; }
};
istream &operator>>(istream &is, const mint &a) { return is >> a.x; }
ostream &operator<<(ostream &os, const mint &a) { return os << a.x; }

int main() {
  ll n, k;
  cin >> n >> k;
  mint ans(0);
  for (ll i = k; i < n + 2; i++) {
    mint st(i * (i - 1) / 2);
    mint goal((2 * n + 1 - i) * i / 2 + 1);
    ans += goal;
    ans -= st;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
int getvalue(string &s){
    int n = std::stoi(s.substr(1));
    return n;
}
bool stable(vector<string> &a,vector<string> &b){
    string m = a[0];
    string n;
    int size = a.size();
    for(int i = 1;i<size;i++){
        n = a[i];
        if (getvalue(n)==getvalue(m)){
            auto it_m = find(b.begin(),b.end(),m);
            auto it_n = find(b.begin(),b.end(),n);
            if(it_m>it_n)
                return false;
        }
        m = n;
    }
    return true;
}
void bubble_sort(vector<string> &v){
    int size = v.size();
    string temp;
    for(int i = 0;i<size;i++){
        for (int j = size-1;j>i;j--){
            if(getvalue(v[j]) < getvalue(v[j - 1])){
                temp = v[j];
                v[j] = v[j - 1];
                v[j - 1] = temp;
            }
        }
    }
}

void selection_sort(vector<string> &v){
    int size = v.size();
    string temp;
    for(int i = 0;i<size;i++){
        int mini = i;
        for(int j = i;j<size;j++){
            if(getvalue(v[j])<getvalue(v[mini]))
                mini = j;
        }
        if(i!=mini){
            temp = v[i];
            v[i] = v[mini];
            v[mini] = temp;
        }
    }
}
int main(){
    int N;
    cin>>N;
    string temp;
    vector<string> v,b_v,s_v;
    for(int i = 0;i<N;i++){
        cin>>temp;
        v.push_back(temp);
        b_v.push_back(temp);
        s_v.push_back(temp);
    }
    bubble_sort(b_v);
    selection_sort(s_v);
    for(int i = 0;i<N-1;i++){
        cout<<b_v[i]<<" ";
    }
    cout<<b_v.back()<<endl;
    if(stable(b_v,v))
        cout<<"Stable"<<endl;
    else
        cout<<"Not stable"<<endl;

    for(int i = 0;i<N-1;i++){
        cout<<s_v[i]<<" ";
    }
    cout<<s_v.back()<<endl;
    if(stable(s_v,v))
        cout<<"Stable"<<endl;
    else
        cout<<"Not stable"<<endl;

}


Measured memory_bytes: 3160
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define pb push_back
#define all(a) a.begin(),a.end()
#define fi first
#define se second
#define deb(x) cout << #x << "=" << x << endl
#define clr(x) memset(x, 0, sizeof(x))
#define rep(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
int M=1e9+7,N=205001;

int mm(int x,int y){x%=M,y%=M;return (x*y)%M;}//Modular Multiply
int po(int x,int y){ if(!y)return 1;int a=po(x,y/2)%M;if(y%2)return mm(a,mm(a,x));return mm(a,a);}//(x**y)%M



void solve() {
	int n,i,k,s=0;
	cin>>n;
	string res;

    char tmp;

    while(n){

        n -= 1;

        tmp = 'a' + n % 26;

        res = tmp + res;

        n /= 26;

    }

    cout<<res;

	
}


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





Measured memory_bytes: 3652
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"strconv"
)

var (
	BufferSize = 10 ^ 5 + 10
)

func readLine(sc *bufio.Scanner) string {
	sc.Scan()
	return sc.Text()
}

func scanStr(sc *bufio.Scanner) string {
	if !sc.Scan() {
		panic(nil)
	}
	return sc.Text()
}

func scanInt(sc *bufio.Scanner) int {
	if !sc.Scan() {
		panic(nil)
	}
	i, err := strconv.Atoi(sc.Text())
	if err != nil {
		panic(err)
	}
	return i
}

func main() {
	sc := bufio.NewScanner(os.Stdin)
	buf := make([]byte, BufferSize)
	sc.Buffer(buf, BufferSize)
	sc.Split(bufio.ScanWords)

	n := scanInt(sc)
	a := make([]int, n)

	var min, ans, tmp int
	for i := 0; i < n; i++ {
		a[i] = scanInt(sc)
		if a[i] < 0 {
			tmp++
		}
	}

	for i := 0; i < n; i++ {
		ans += int(math.Abs(float64(a[i])))
	}

	if tmp%2 == 1 {
		min = int(math.Abs(float64(a[0])))
		// 絶対値の最小値を求める
		for i := 1; i < n; i++ {
			if min > int(math.Abs(float64(a[i]))) {
				min = int(math.Abs(float64(a[i])))
			}
		}
		ans -= min * 2
	}
	fmt.Println(ans)
}


Measured memory_bytes: 3072
#include<cstdio>
#include<vector>
using namespace std;

int N, P[200000], PD[200001];

int main() {
	scanf("%d", &N);

	for (int i = 0; i < N; i++) {
		scanf("%d", P + i);
	}

	PD[1] = P[0];
	int ans = 1;
	for (int i = 1; i < N; i++) {
		if (P[i] <= PD[i]) {
			PD[i + 1] = P[i];
			ans++;
		}
		else {
			PD[i + 1] = PD[i];
		}

	}

	printf("%d", ans);
}

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


ll gcd(ll a,ll b){
    if(a < b){
        ll t = a;
        a = b;
        b = t;
    }
    ll r = a % b;
    while(r != 0){
        a = b;
        b = r;
        r = a % b;
    }
    return b;
}


// ll gcd(ll a, ll b) { return b?gcd(b,a%b):a;}
ll lcm(ll a,ll b){
    return a / gcd(a,b) * b;
}
// ll lcm(ll a, ll b) { return a/gcd(a,b)*b;}

int f(int x){
    int res = 0;
    while(x % 2 == 0){
        x /= 2;
        res++;
    }
    return res;
}

int main(){
    int n,m;
    cin >> n >> m;
    vector<int> a(n);
    rep(i,n) cin >> a.at(i);
    rep(i,n) a.at(i) /= 2;
    
    int t = f(a.at(0));
    rep(i,n){
        int l = f(a.at(i)); 
        if(l != t){
            cout << 0 << endl;
            return 0;
        }
        a.at(i) >>= t;
    }
    m >>= t;
    ll l = 1;
    rep(i,n){
        l = lcm(l,a.at(i));
        if(l > m){
            cout << 0 << endl;
            return 0;
        }
    }
    m /= l;
    ll ans = (m + 1) / 2;
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3760
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#define For(i, a, b) for(int (i)=(a); (i)<(b); ++(i))
#define rFor(i, a, b) for(int (i)=(a)-1; (i)>=(b); --(i))
#define rep(i, n) For((i), 0, (n))
#define rrep(i, n) rFor((i), (n), 0)
#define fi first
#define se second
using namespace std;
typedef long long lint;
typedef unsigned long long ulint;
typedef pair<int, int> pii;
typedef pair<lint, int> pli;
typedef pair<lint, lint> pll;
typedef complex<double> xy_t;
template<class T>bool chmax(T &a, const T &b){if(a<b){a=b; return true;} return false;}
template<class T>bool chmin(T &a, const T &b){if(a>b){a=b; return true;} return false;}

constexpr lint mod = 1e9+7;
constexpr lint INF = mod*mod;
constexpr int MAX = 100010;

template<typename T> struct SegTree{
    using F=function<T(T, T)>;
    int sz=1;
    T et;
    F f, g;
    vector<T> node;

    SegTree(int sz_, T et_, F f_, F g_): et(et_), f(f_), g(g_){
        while(sz<sz_) sz<<=1;
        node.resize(sz<<1, et);
    }

    void update(int i, T x){
        i+=sz;
        node[i]=g(node[i], x);
        i>>=1;
        while(i){
            node[i]=f(node[i<<1], node[(i<<1)+1]);
            i>>=1;
        }
    }

    T query(int l, int r){
        T vl=et, vr=et;
        for(l+=sz, r+=sz; l<r; l>>=1, r>>=1){
            if(l&1) vl=f(vl, node[l++]);
            if(r&1) vr=f(node[--r], vr);
        }
        return f(vl, vr);
    }
};

vector<int> vs, idx, dep, G[MAX];

void lca_dfs(int v, int pv, int &i, int d){
    vs.push_back(v);
    dep.push_back(d);
    if(idx[v]<0) idx[v]=i++;
    for(int nv: G[v])if(nv!=pv){
        lca_dfs(nv, v, i, d+1);
        vs.push_back(v);
        dep.push_back(d);
        ++i;
    }
}

int getlca(int u, int v, SegTree<pii> &st){
    int x=min(idx[u], idx[v]);
    int y=max(idx[u], idx[v]);
    return vs[st.query(x, y+1).se];
}

int main(){
    int n, u, v;
    scanf("%d%d%d", &n, &u, &v);
    --u; --v;
    vector<int> cnt(n, 0);
    rep(i, n-1){
        int a, b;
        scanf("%d%d", &a, &b);
        --a; --b;
        G[a].push_back(b);
        G[b].push_back(a);
        ++cnt[a];
        ++cnt[b];
    }

    int id=0;
    idx.resize(n, -1);
    lca_dfs(v, -1, id, 0);
    auto f=[](pii a, pii b){return min(a, b);};
    SegTree<pii> st(vs.size(), {MAX, MAX}, f, f);
    rep(i, (int)dep.size()) st.update(i, {dep[i], i});

    int ans=0;
    rep(i, n)if(cnt[i]==1){
        int lca=getlca(u, i, st);
        if(abs(dep[idx[lca]]-dep[idx[u]]) < abs(dep[idx[v]]-dep[idx[lca]])){
            chmax(ans, dep[idx[i]]-1);
        }
    }
    printf("%d\n", ans);
}

Measured memory_bytes: 75804
#include <bits/stdc++.h>
using namespace std;
int main(){
    string S;
    cin >> S;
    int n = S.size();
    int g,p,ans;
    g = p = ans = 0;
    for(int i = 0;i < n;i++){
        if(S[i] == 'p')p++;
    }
    cout << n/2-p << endl;
    //cin >> n;
}

Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <algorithm>
#include <climits>
#include <cmath>
#include <string>
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep01(i, n) for(int i = 0; i < (n) + 1; i++)
#define rep10(i, n) for(int i = 1; i < (n); i++)
#define rep11(i, n) for(int i = 1; i < (n) + 1; i++)
#define all(a) (a).begin(), (a).end()
typedef long long int ll;
typedef struct { int x; int y; } Pos;
using namespace std;

int main()
{
    int N, X, T;
    cin >> N >> X >> T;
    cout << ((N + (X - 1))/ X) * T << endl;
    return 0;
}

Measured memory_bytes: 3628
import java.util.*;
class Main{
  public static void main(String[] arg){
    Scanner stdIn=new Scanner(System.in);
    int N=stdIn.nextInt();
    int K=stdIn.nextInt();
    int X=stdIn.nextInt();
    int Y=stdIn.nextInt();
    int o=N-K;
    if(o>0){
      System.out.println(X*K+o*Y);
    }else{
      System.out.println(N*X);
    }
  }
}
      
    
    

Measured memory_bytes: 21844
#include <iostream>
#include <algorithm>
#include <math.h>
#include <string.h>
#include <cstdio>
#include <vector>
#include <set>
#include <cassert>
#include <cstdlib>
#include <complex>
#include <cctype>
#include <cmath>
#include <ctime>
#include <deque>
#include <queue>
#include <stack>
#include <map>
#include <set>
#include <sstream>
#include <functional>
#include <iomanip>
//#include <windows.h>  //Should be deleted when using AtCoder&POJ
using namespace std;

#define ll long long
#define pii pair<int,int>
#define qi ios::sync_with_stdio(0)
/**==Info==
*Program:1
*Problem:Mancala
*Date:2019-7-3
*Algorithm:DP
*Stats:Unknown*/

bool debug=false;

int n,k;
const int mx=10000;
ll dp[105][mx];

const ll mod=1e9+7;
const ll inv2=5e8+4;

ll qp(ll a,ll b){
	if(b==0){
		return 1;
	}
	ll ans=qp(a,b/2);
	if(b%2){
		return ans*ans%mod*a%mod;
	}else{
		return ans*ans%mod;
	}
}

int main(int argc,char* argv[]){
	qi;
	cin>>n>>k;
	
	dp[n+1][0]=1;
	
//	cout<<"D"<<endl;
	
	for(int i=n;i>=1;i--){
		for(int j=0;j<mx;j++){
			for(int l=0;l<=k;l++){
//				cout<<i<<" "<<j<<" "<<l<<endl;
				
				/*
				Please, don't forget to module the answer				
				
				=====
				p71.cpp:72:23: runtime error: signed integer overflow: 6795705775047932304 + 3397852887523966152 cannot be represented in type 'long long'
				SUMMARY: UndefinedBehaviorSanitizer: undefined-behavior p71.cpp:72:23 in 
				
				Runtime error: exit code is 1
				=====
				Used: 124 ms, 10600 KB
*/
				if(l<=i){
					//ok
					if(j+(l+j)/i<mx){
						dp[i][j+(l+j)/i]+=dp[i+1][j];
						dp[i][j+(l+j)/i]%=mod;
					}
					
				}else{
					//already (bomb)ed
					dp[i][j]+=dp[i+1][j];
					dp[i][j]%=mod;
				}
			}
		}
	}
	
//	cout<<"BBB"<<endl;
	
	ll killed=0;
	for(int i=0;i<mx;i++){
		killed+=1ll*i*dp[1][i]%mod;
		killed%=mod;
	}
//	cout<<killed<<endl;
	
	//(k+1)^(n-1)*sm*n
	ll tot=qp(k+1,n-1)*k%mod*(k+1)%mod*inv2%mod*n%mod;
	
//	cout<<tot<<endl;
	
	cout<<(tot-killed+mod)%mod<<endl;
	return 0;
}



Measured memory_bytes: 8320
#include <algorithm>
#include <bitset>
#include <complex>
#include <cstdio>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int gcd(int a, int b) {
    if (b == 0) {
        return a;
    } else {
        return gcd(b, a % b);
    }
}

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

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, c, x;
    cin >> a >> b >> c >> x;
    int count = 0;
    rep(i, a + 1) {
      int money = x;
      money -= i * 500;
      rep(j, b + 1) {
        int rest;
        rest = money;
        rest -= j * 100;
        if (rest % 50 == 0 && rest / 50 <= c && rest / 50 >= 0) {
          count++;
        }
      }
    }

    cout << count << '\n';
    return 0;
}


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

# AtCoder Beginner Contest
# Problem C


def initialize():
    count = 1
    extracted_s = ''
    return count, extracted_s


if __name__ == '__main__':
    s = input()
    words = ['dream', 'dreamer', 'erase', 'eraser']
    count, extracted_s = initialize()

    while len(s) != len(extracted_s):
        extracted_s = s[len(s) - count:]
        count += 1

        if extracted_s in words:
            s = s[:-len(extracted_s)]
            count, extracted_s = initialize()

    if len(s) == 0:
        print('YES')
    else:
        print('NO')


Measured memory_bytes: 3364
#define _USE_MATH_DEFINES
#include <bits/stdc++.h>
using namespace std;
signed main() { 
  ios::sync_with_stdio(false); cin.tie(0);
  //c
  long long a, b, c, d;
  cin >> a >> b >> c >> d;
  long long u = (a - 1) / c;
  long long v = (a - 1) / d;
  long long w = (a - 1) / (c / __gcd(c, d) * d);
  long long uu = b / c;
  long long vv = b / d;  
  long long ww = b / (c / __gcd(c, d) * d);
  cerr << u << " " << v << " " << w << endl;
  cerr << uu << " " << vv << " " << ww << endl;
  cout << (b - a + 1) - ((uu + vv - ww) - (u + v - w)) << endl;
  return 0;
}

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

int main() 
{
    int n;
    cin >> n;
    bool ans = false;
    for (int i = 1; i <= 9;i++)
    {
        for (int j = 1; j <= 9;j++)
        {
            if(i*j==n)
                ans = true;
        }
    }

    cout << (ans ? "Yes" : "No")<<endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define double long double
#define rep(i,n) for(int i=0;i<n;i++)
#define mod 1000000007 // 10^9+7
#define INF 99999999999 //10^12-1
#define dev 998244353 //tenka1
#define P pair<int,int>
#define prique priority_queue
signed main(){
	int n;
	cin>>n;
	int cnt=0;
	for(int i=1;;i++){
		cnt+=i;
		if(cnt>=n){
			cout<<i<<endl;
			return 0;
		}
	}
}
	
	


Measured memory_bytes: 256
#include <stdio.h>
int main(void){
    int N,K,X,Y;
    scanf("%d",&N);
    scanf("%d",&K);
    scanf("%d",&X);
    scanf("%d",&Y);
    if(K>=N){
        printf("%d",X*N);
    }
    else{
        printf("%d",X*K + (N-K)*Y);
    }
    return 0;
}

Measured memory_bytes: 128
#include<iostream>
#include<cstdio>
using namespace std;
int main()
{
    int a,b,c,d;
    cin>>a>>b>>c>>d;
    if(a+b>c+d) cout<<"Left";
    if(a+b<c+d) cout<<"Right";
    if(a+b==c+d) cout<<"Balanced";
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
using namespace std;
string toStr(int a){
	stringstream ss;
	ss<<a;
	return ss.str();
}
int main(){
	int m,n;
	while(cin>>m>>n){
		if(m==0&&n==0)break;
		bool alive[1001];
		int num=1,rem=m;
		for(int i=0;i<m;++i) alive[i]=true;
		for(int i=1;i<=n;++i){
			string s,cmp=(i%3==0||i%5==0)?"":toStr(i);
			if(i%3==0)cmp+="Fizz";
			if(i%5==0)cmp+="Buzz";
			cin>>s;
			if(rem==1) continue;
			if(s!=cmp){
				alive[num]=false;
				--rem;
			}
			do{
				num=(num+1)%m;
			}while(alive[num]==false);
		}
		for(int i=1;i<=m;++i){
			if(alive[i%m]){
				--rem;
				cout<<((i%m==0)?m:i);
				cout<<((rem==0)?"\n":" ");
			}
		}
	}
	return 0;
}

Measured memory_bytes: 936
A, B, C = map(int, input().split())
if A*B*C % 2 == 0:
	print(0)
else:
    longest = max(A, B, C)
    part1 = (longest - (longest//2)) * ((A*B*C) // longest)
    part2 = (longest//2) * ((A*B*C) // longest)
    print(part1 - part2)

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

int main()
{
  string s;
  cin >> s;
  if(s == "SUN"){
    cout << 7;
  }
  else if(s == "MON"){
    cout << 6;
  }
  else if(s == "TUE"){
    cout << 5;
  }
  else if(s == "WED"){
    cout << 4;
  }
  else if(s == "THU"){
    cout << 3;
  }
  else if(s == "FRI"){
    cout << 2;
  }
  else if(s == "SAT"){
    cout << 1;
  }
  cout << endl;
  
  return 0;
}


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

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define repr(i,n) for(int i=(n);i>=0;--i)
#define cinv(n,vec) VL (vec)(n);for(auto&v:vec)cin>>v;
#define int long long
#define itn int
#define pb push_back
#define m_p make_pair
#define m_t make_tuple
#define eb emplace_back
#define p_p(a,b) pb(m_p(a,b))
#define all(a) a.begin(),a.end()
#define SORT(a) sort(all(a))
#define RSORT(a) sort(all(a),greater<>())
#define UNIQUE(a) a.erase(unique(all(a)),a.end())
#define SZ(a) (ll)(a.size())
#define ENDL cout<<endl
#define debg(a) cout<<#a<<" "<<a<<endl;
#define debgp(a) cout<<#a<<" "<<a.fi<<" : "<<a.se<<endl
#define call(a) for(auto i:a)cout<<i<<" ";cout<<endl
#define show(a) for(cont &y:a){for(cont &x:y){cout<<x<<" ";}cout<<endl;}
#define out(a) cout<<(a)<<endl
#define cont const auto
#define fi first
#define se second
#define V vector
#define P pair
#define T tuple
#define VV(type,name,y,x,a) vector<vector<type>> name = vector<vector<type>>(y,vector<type>(x,a))
#define PQ priority_queue
typedef long long ll;
typedef double D;
typedef long double LD;
typedef string str;
typedef vector<ll> VL;
typedef pair<ll,ll> PL;
typedef vector<pair<ll,ll>> VP;
typedef tuple<ll,ll,ll> T3;
typedef tuple<ll,ll,ll,ll> T4;
const long long INF = 1LL<<60;
const long long MOD = 1e9+7;
void Yes(){cout<<"Yes"<<endl;}
void No(){cout<<"No"<<endl;}
void YN(bool b){cout<<(b?"Yes":"No")<<endl;}
template<class T>inline T gcd(T a,T b){if(b==0)return a; return(gcd(b,a%b));}
template<class T>inline T lcm(T a,T b){return a/gcd(a,b)*b;}
template<class T>inline bool chmax(T &a,const T &b){if(a<b){a=b;return true;}return false;}
template<class T>inline bool chmin(T &a,const T &b){if(a>b){a=b;return true;}return false;}

signed main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int sx,sy,tx,ty;
  cin>>sx>>sy>>tx>>ty;
  int dx=tx-sx,dy=ty-sy;

  rep(i,dx)cout<<'R';
  rep(i,dy)cout<<'U';
  rep(i,dx)cout<<'L';
  rep(i,dy)cout<<'D';

  cout<<'D';
  rep(i,dx+1)cout<<'R';
  rep(i,dy+1)cout<<'U';
  cout<<'L';
  cout<<'U';
  rep(i,dx+1)cout<<'L';
  rep(i,dy+1)cout<<'D';
  cout<<'R'<<endl;
  
  
  return 0;
}



Measured memory_bytes: 256
#include<stdio.h>
int main(){
int y,z,d=0,k,i,j,n,a[110],b[110],c[210],x=0,l=0;
while(1){
scanf("%d\n",&n);
if(n==0){
break;
}
z=n,y=n;
for(i=1;i<=n*2;i++){
c[i]=0;
}
for(i=0;i<n;i++){
scanf("%d\n",&a[i]);
c[a[i]]++;
}
for(i=0;i<n;i++){
for(j=i+1;j<n;j++){
if(a[i]>a[j]){
k=a[i];
a[i]=a[j];
a[j]=k;
}
}
}
for(i=1;i<=n*2;i++){
if(c[i]==0){
b[d]=i;
d++;
}
}
while(y!=0 && z!=0){
if(l==0){
for(i=0;i<n;i++){
if(a[i]>x){
x=a[i];
a[i]=0;
y--,l=1;
break;
}
}
if(l==0){
l=1,x=0;
}
}
else if(l==1){
for(i=0;i<n;i++){
if(b[i]>x){
x=b[i];
b[i]=0;
z--,l=0;
break;
}
}
if(l==1){
l=0,x=0;
}
}
}
printf("%d\n%d\n",z,y);
x=0,l=0,d=0;
}
return 0;
}


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

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


Measured memory_bytes: 256
import java.util.*;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        char[] n = sc.next().toCharArray();
        int sum = 0;
        for (int i = 0; i < n.length; i++) {
            sum += Integer.parseInt(Character.toString(n[i]));
        }
        System.out.println(sum % 9 == 0 ? "Yes" : "No");
        sc.close();

    }

}


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

const long long MOD = 1000000007;
long long pascal[5005][5005];
long long fac[5005];

void make_pascal(void) {
    pascal[0][0] = 1;
    pascal[1][0] = 1;
    pascal[1][1] = 1;
    for (int i = 2; i < 5000; i++) {
        pascal[i][0] = 1;
        for (int j = 1; j < 5000; j++) {
            pascal[i][j] = pascal[i-1][j] + pascal[i-1][j-1];
            pascal[i][j] %= MOD;
        }
    }
}

void init(void) {
    make_pascal();
    fac[1] = 1;
    for (int i = 2; i < 5000; i++) {
        fac[i] *= fac[i-1];
        fac[i] %= MOD;
    }
}



int main(void){
    init();
    
    int N, K;
    cin >> N >> K;
    
    for (int i = 1; i <= K; i++) {
        long long ans = pascal[N-K+1][i];
        ans *= pascal[K-1][i-1];
        ans %= MOD;
        cout << ans << endl;
    }
}


Measured memory_bytes: 195840
#include <iostream>
#include <bits/stdc++.h>
#include <vector>
#include <algorithm>
#include <cctype>
#include <string>
#define ll long long

using namespace std;

int main(){

  string s;
  cin >> s;
  int n = s.size();
  ll ans = 0;

  for (int i = 0; i < (1<<(n-1)); i++) { // 演算子は文字列の間にはいるからn-1する
    ll c = 0;
    for (int j = 0; j < n; j++) {
      c = c * 10 + (s[j] - '0');
      if( i & (1<<j) || j == n-1){ //iの中にjが含まれるか、ｊが最後か
        ans += c;
        c = 0;
      }
    }
  }

  cout << ans << endl;

  return 0;
}

Measured memory_bytes: 256
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(non_snake_case)]
#![allow(dead_code)]
#![allow(unused_variables)]
#![allow(unused_mut)]
#![allow(unused_assignments)]
use proconio::input;
use proconio::marker::Usize1;
use std::collections::*;
use std::cmp::*;
use std::f64::consts::*;

const MOD: u64 = 1000000007;
const INF: usize = std::usize::MAX / 4;

fn main() {
    input! {
        S: usize,
        W: usize,
    }

    if W >= S {
        println!("unsafe");
    } else {
        println!("safe");
    }
}


Measured memory_bytes: 2116
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
int k,a[40]={0,1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
int main(){
	scanf("%d",&k);
	printf("%d\n",a[k]);
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <math.h>

using namespace std;

int main(){
    long N, K;

    long ans;
    long tmp1, tmp2;

    cin >> N >> K;
    if((K%2) == 0){
        tmp1 = long(N/K);
        if((N % K) >= K/2){
            tmp2 = tmp1+1;
        }else{
            tmp2 = tmp1;
        }
        ans = tmp1*tmp1*tmp1 + tmp2*tmp2*tmp2;
    }else{
        tmp1 = long(N/K);
        ans = tmp1*tmp1*tmp1;
    }
    cout << ans << '\n';
}

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

const int NN = 1100;
struct rec1{
	int x, y, h;
}a[NN];
int h, n, tmp;
bool f;

int max(int a, int b){
	if (a > b) return a;
	else return b;
}

int main(){
	
	scanf("%d", &n);
	for (int i=1; i<=n; i++) scanf("%d%d%d", &a[i].x, &a[i].y, &a[i].h);
	
	for (int i=0; i<=100; i++){
		for (int j=0; j<=100; j++){
			
			tmp = 1;
			while (a[tmp].h == 0) tmp++;
			h = a[tmp].h + abs(i - a[tmp].x) + abs(j - a[tmp].y);
			
			f = true;
			for (int k=1; k<=n; k++) 
				if (max(0, h - abs(i - a[k].x) - abs(j - a[k].y)) != a[k].h){
					f = false;
					break;
				}
			if (f){
				printf("%d %d %d\n", i, j, h);
				return 0;
			}
		}
	}
} 

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int i,j,num,count[26];
    char a[1200],ch;
    
    i = 0;
    while(scanf("%c", &ch)!=EOF){
        a[i]=ch;
        i++;
    }
 
    for(j=0;j<26;j++) count[j]=0;
   
 
    for(j=0;j<i;j++){
 
        if(a[j]>=65 && a[j]<=90) a[j]+=32;
        if('a'<=a[j] && a[j]<='z'){
            num= a[j]-'a';
            count[num]++;
        }
    }
 
    for(j=0;j<26;j++) printf("%c : %d\n",j+97,count[j]);
    
    return 0;
}



Measured memory_bytes: 2104
A, B, C=map(int, input().split())
K=int(input())
for i in range(0,K+1):
    for j in range(0,K-i+1):
        for k in range(0,K-i-j+1):
            a = A*2**i
            b = B*2**j
            c = C*2**k
            if i+j+k>0 and b>a and c>b:
                print('Yes')
                exit()
print('No')

Measured memory_bytes: 61788
/**
 *  author: MOOONI
 *  hackers are welcome!
**/
#include <bits/stdc++.h>

using namespace std;

#define ll long long
#define ull unsigned long long
#define db double
#define ld long double
#define str string
#define pi pair
#define tup tuple
#define vec vector
#define temp template
#define tn typename

#define ff first
#define ss second
#define SZ(x) (ll) x.size()
#define all(x) x.begin(), x.end()
#define rall(x) x.rbegin(), x.rend()
#define rsz resize
#define ins insert
#define fr front 
#define bc back
#define pf push_front
#define pb push_back
#define eb emplace_back
#define lb lower_bound
#define ub upper_bound
#define mk make_pair

#define FOR(i, a, b) for (ll i = (a); i <= (b); i++) 
#define ROF(i, a, b) for (ll i = (a); i >= (b); i--)
#define trav(a, x) for (auto &a : x)
#define popcount __builtin_popcount
#define ctz __builtin_ctz
#define clz __builtin_clz
#define gcd __gcd

// DEBUG
#define ts to_string
temp<tn A, tn B> str ts(pi<A, B> p);
temp<tn A, tn B, tn C> str ts(tup<A, B, C> p);
str ts(const str& s) { return '"' + s + '"'; }
str ts(const char* s) { return ts((str) s); }
str ts(bool b) { return (b ? "true" : "false"); }
str ts(vec<bool> v) { bool f = true; str res = "{";
FOR(i, 0, static_cast<ll>(v.size()) - 1) 
{ if (!f) res += ", "; res += ts(v[i]);
f = false; } res += "}"; return res; }
temp<size_t N> str ts(bitset<N> v) { str res = "";
trav(a, v) { res += (char) ('0' + a); } return res; }
temp<tn A> str ts(A v) { bool f = true; str res = "{";
trav(x, v) { if (!f) res += ", "; res += ts(x);
f = false; } res += "}"; return res; }
temp<tn A, tn B> str ts(pi<A, B> p) { 
  return "(" + ts(p.ff) + ", " + ts(p.ss) + ")"; }
temp<tn A, tn B, tn C> str ts(tup<A, B, C> t) {
  return "(" + ts(get<0>(t)) + ", " + ts(get<1>(t)) + ", " + ts(get<2>(t)) + ")"; }
void DBG() { cerr << endl; }
temp<tn H, tn... T> void DBG(H h, T... t) { cerr << " " << ts(h); DBG(t...); }
#define dbg(...) cerr << "[" << #__VA_ARGS__ << "]:", DBG(__VA_ARGS__);

// INPUT AND OUTPUT
temp<tn T> void re(T& x) { cin >> x; };
temp<tn H, tn... T> void re(H& h, T&... t) { re(h); re(t...); }
temp<tn T> void pr(T x) { cout << x; };
temp<tn H, tn... T> void pr(H h, T... t) { pr(h); pr(t...); }

int main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  ll n, m;
  re(n, m);
  vec<ll> a(n);
  FOR(i, 0, n - 1) {
    re(a[i]);
  }
  vec<vec<ll>> g(n);
  FOR(i, 0, m - 1) {
    ll x, y;
    re(x, y);
    --x; --y;
    g[x].pb(y);
    g[y].pb(x);
  }
  ll ans = 0;
  FOR(i, 0, n - 1) {
    bool good = true;
    trav(j, g[i]) {
      good &= (a[i] > a[j]);
    }
    ans += (good == true);
  }
  pr(ans, '\n');
  return 0;
}

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

using namespace std;

vector<bool> dp;
vector<int> stones;

int main() {

  int n, k;

  cin >> n >> k;
  dp.assign(k+1, false);
  stones.assign(n, 0);

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

  int min_s = *min_element(stones.begin(), stones.end());

  for (int i = 0; i <= min_s; i++) {
    dp[i] = false;
  }

  for (int i = min_s; i <= k; i++) {
    for (int j = 0; j < n; j++) {
      if (i - stones[j] < 0) continue;
      if (dp[i - stones[j]] == false) {
        dp[i] = true;
      }
    }
  }

  if (dp[k] == true) {
    cout << "First" << "\n";
  } else {
    cout << "Second" << "\n";
  }

  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
typedef unsigned long long LL;
typedef pair<int, int> PII;
const int MAXN = 2000 + 10, SIZE = 1024;
LL A[MAXN];
int N, M, Q;

char s[MAXN], t[MAXN];

char change(int x) {
  if (x < 10) return x + '0';
  else return 'A' + x - 10;
}

int main() {
  while (scanf("%d%d%d", &N, &M, &Q) == 3 && N) {
    for (int i = 0; i < M; ++ i) A[i] = LL(1ll << N) - 1;
    LL sw = 0;
    for (int _ = 0; _ < Q; ++ _) {
      scanf("%s%s", s, t);
      for (int i = 0; i < N; ++ i) sw ^= LL(s[i] - '0') << i;
      for (int i = 0; i < M; ++ i) {
        A[i] &= t[i] == '1' ? sw : ~sw;
      }
    }
    for (int i = 0; i < M; ++ i) s[i] = '?'; s[M] = 0;
    for (int i = 0; i < M; ++ i) {
      if (__builtin_popcountll(A[i]) != 1) continue;
      int x = __builtin_ctzll(A[i]);
      s[i] = change(x);
    }
    puts(s);
  }
  return 0;
}

Measured memory_bytes: 1176
n,m = map(int,input().split())
Ship = [list(map(int,input().split())) for i in range(m)]

Ship1 = []
Ship2 = []

for ship in Ship:
    if ship[0]==1:
        Ship1 += [ship[1]]
    elif ship[1]==n:
        Ship2 += [ship[0]]
if set(Ship1)&set(Ship2):
    print('POSSIBLE')
else:
    print('IMPOSSIBLE')

Measured memory_bytes: 61020
#include<stdio.h>
#include<stdlib.h>

int i,n;
long long int ans[25];

int main(){
	scanf("%d",&n);
	ans[1]=1;
	for(i=2;i<=n;i++)ans[i]=ans[i-1]*i;
	printf("%lld\n",ans[n]);
	return 0;
}

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

string rotate(string S) {
  string T = S;
  T.at(0) = S.at(S.size()-1);
  for (int i = 1;i < S.size();i++) {
    T.at(i) = S.at(i-1);
  }
  return T;
}


int main() {
  string S,T;
  cin >> S >> T;
  bool ok = false;
  for (int i = 0; i<S.size();i++) {
    if (S==T) {
      ok = true;
      break;
    }
    S = rotate(S);
  }
  if (ok) cout << "Yes" << endl;
  else cout << "No" << endl;
}
    
  



Measured memory_bytes: 256
import sys,collections as cl,bisect as bs
sys.setrecursionlimit(100000)
mod = 10**9+7
Max = sys.maxsize
def l(): #intのlist
    return list(map(int,input().split()))
def m(): #複数文字
    return map(int,input().split())
def onem(): #Nとかの取得
    return int(input())
def s(x): #圧縮
    a = []
    aa = x[0]
    su = 1
    for i in range(len(x)-1):
        if aa != x[i+1]:
            a.append([aa,su])
            aa = x[i+1]
            su = 1
        else:
            su += 1
    a.append([aa,su])
    return a
def jo(x): #listをスペースごとに分ける
    return " ".join(map(str,x))
def max2(x): #他のときもどうように作成可能
    return max(map(max,x))
def In(x,a): #aがリスト(sorted)
    k = bs.bisect_left(a,x)
    if k != len(a) and a[k] ==  x:
        return True
    else:
        return False
"""
def nibu(x,n,r):
    ll = 0
    rr = r
    while True:
        mid = (ll+rr)//2

    if rr == mid:
        return ll
    if (ここに評価入れる):
        rr = mid
    else:
        ll = mid+1
"""

import fractions
from functools import reduce
def gcd(*numbers):
    return reduce(fractions.gcd, numbers)

def gcd_list(numbers):
    return reduce(fractions.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // fractions.gcd(x, y)

def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)

def lcm_list(numbers):
    return reduce(lcm_base, numbers, 1)

a,b = m()

print(lcm(a,b))






Measured memory_bytes: 66156