akhauriyash/Code-Regression huggingface dataset:
#-*-coding:utf-8-*-

def main(): 
    N = int(input()) 
    num_list = set([1]) 
    i = 1 
    j = 1 
    while 6 ** i <= N: 
        num_list.add(6 ** i) 
        i += 1 
    while 9 ** j <= N: 
        num_list.add(9 ** j)
        j += 1 
    num_list = list(num_list) 
    num_list.sort()

    dp = [] 

    for i in range(1, N+1): 
        if i in num_list: 
            dp.append(1) 
        else: 
            temp = [] 
            for k in num_list: 
                if i - k > 0: 
                    temp.append(i - k) 
            small_dp = [dp[x-1] for x in temp] 
            dp.append(min(small_dp) + 1) 

    print(dp[-1])

if __name__ == '__main__':
    main()

Measured memory_bytes: 3992
import math
a, b, x = map(int, input().split())

if x >=  a * b * 0.5 * a:
    y = (2 * (a * a * b - x)) / (a ** 3)
    print(math.degrees(math.atan(y)))
else:
    y = (b * b * a) / (2 * x)
    print(math.degrees(math.atan(y)))


Measured memory_bytes: 3060
#[allow(dead_code)]
fn main() {
    let (a, b, c, d) = i::u4();
    let sum = b - a + 1;
    let c_div = (b / c) - (a - 1) / c;
    let d_div = (b / d) - (a - 1) / d;
    let lcm = c * d / gcd(c, d);
    let cd_div = (b / lcm) - (a - 1) / lcm;
    println!("{}", sum - c_div - d_div + cd_div);
   // dbg!(sum, c_div, d_div, cd_div);
}

#[allow(unused_imports)]
use greatest_common_divisor::*;

#[allow(dead_code)]
mod greatest_common_divisor {
    use std::mem::swap;

    pub fn gcd(mut a: usize, mut b: usize) -> usize {
        if a < b {
            swap(&mut b, &mut a);
        }
        while b != 0 {
            a = a % b;
            swap(&mut a, &mut b);
        }
        a
    }
}

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::{BTreeMap, BTreeSet, HashMap, HashSet, VecDeque};
#[allow(unused_imports)]
use std::io::*;
#[allow(unused_imports)]
use std::num::*;
#[allow(unused_imports)]
use std::str::*;

#[allow(dead_code)]
mod i {
    use super::*;

    pub fn read<T: FromStr>() -> T {
        stdin()
            .bytes()
            .map(|c| c.unwrap() as char)
            .skip_while(|c| c.is_whitespace())
            .take_while(|c| !c.is_whitespace())
            .collect::<String>()
            .parse::<T>()
            .ok()
            .unwrap()
    }
    pub fn str() -> String {
        read()
    }
    pub fn s() -> Vec<char> {
        str().chars().collect()
    }
    pub fn i() -> i64 {
        read()
    }

    pub fn u() -> usize {
        read()
    }

    pub fn u2() -> (usize, usize) {
        (read(), read())
    }

    pub fn u3() -> (usize, usize, usize) {
        (read(), read(), read())
    }

    pub fn u4() -> (usize, usize, usize, usize) {
        (read(), read(), read(), read())
    }

    pub fn u5() -> (usize, usize, usize, usize, usize) {
        (read(), read(), read(), read(), read())
    }

    pub fn u6() -> (usize, usize, usize, usize, usize, usize) {
        (read(), read(), read(), read(), read(), read())
    }

    pub fn f() -> f64 {
        read()
    }

    pub fn c() -> char {
        read::<String>().pop().unwrap()
    }

    pub fn iv(n: usize) -> Vec<i64> {
        (0..n).map(|_| i()).collect()
    }

    pub fn iv2(n: usize) -> Vec<(i64, i64)> {
        (0..n).map(|_| iv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn iv3(n: usize) -> Vec<(i64, i64, i64)> {
        (0..n).map(|_| iv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn uv(n: usize) -> Vec<usize> {
        (0..n).map(|_| u()).collect()
    }

    pub fn uv2(n: usize) -> Vec<(usize, usize)> {
        (0..n).map(|_| uv(2)).map(|a| (a[0], a[1])).collect()
    }

    pub fn uv3(n: usize) -> Vec<(usize, usize, usize)> {
        (0..n).map(|_| uv(3)).map(|a| (a[0], a[1], a[2])).collect()
    }

    pub fn uv4(n: usize) -> Vec<(usize, usize, usize, usize)> {
        (0..n)
            .map(|_| uv(4))
            .map(|a| (a[0], a[1], a[2], a[3]))
            .collect()
    }

    pub fn fv(n: usize) -> Vec<f64> {
        (0..n).map(|_| f()).collect()
    }

    pub fn cmap(h: usize) -> Vec<Vec<char>> {
        (0..h).map(|_| s()).collect()
    }
}


Measured memory_bytes: 4352
import java.io.BufferedReader
import java.io.InputStream
import java.io.InputStreamReader
import java.io.PrintWriter
import java.lang.StringBuilder
import java.math.BigInteger
import java.util.*

fun PrintWriter.solve(sc: FastScanner) {
    val n = sc.nextInt()
    var s = sc.nextLine()
    val arr = Array(n + 1) { 0 }
    for (i in 0 until n) {
        arr[i + 1] = arr[i] + if (s[i] == '(') 1 else -1
    }
    val m = arr.min()!!
    if (m < 0) {
        s = "(".repeat(-m) + s
    }
    val l = arr.last() - m
    if (l > 0) {
        s += ")".repeat(l)
    }
    println(s)
}

fun main(args: Array<String>) {
    val writer = PrintWriter(System.out, false)
    writer.solve(FastScanner(System.`in`))
    writer.flush()
}

class FastScanner(s: InputStream) {
    private var st = StringTokenizer("")
    private val br = BufferedReader(InputStreamReader(s))

    fun next(): String {
        while (!st.hasMoreTokens()) st = StringTokenizer(br.readLine())

        return st.nextToken()
    }

    fun nextInt() = next().toInt()
    fun nextLong() = next().toLong()
    fun nextLine() = br.readLine()
    fun nextDouble() = next().toDouble()
    fun ready() = br.ready()
}


Measured memory_bytes: 33604
#include <iostream>
#include <math.h>
#include <algorithm>
#include <queue>
#include <map>
#include <list>
//#include <bits/stdc++.h>


using namespace std;

#define FOR(i,a,b) for(int i=(a),i##formax=(b);i<i##formax;i++)
typedef long long ll;



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

    return 0;
}

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

A = ABCK[0]
B = ABCK[1]
C = ABCK[2]
K = ABCK[3]
sums = 0
if (K - A <= 0):
    sums += K
else:
    K = K-A
    sums += A
    if(K-B <= 0):
        sums += 0
    else:
        K = K-B
        sums += K*(-1)

print(sums)


Measured memory_bytes: 9204
#include <iostream>
#include <algorithm>
#include <cstdio>
using namespace std;

const int N = 1e6+9;
int a0, a1, a2, n, k, ans = 0;

int main(){
    scanf("%d%d%d", &k, &n, &a1);
    a0=a1;
    for(int i = 1; i < n; i++){
        scanf("%d", &a2);
        ans = max(ans, a2-a1);
        a1=a2;
    }
    ans = max(ans, k-a1+a0);
    cout << k-ans;
    return 0;
}

Measured memory_bytes: 384
use std::io::*;
use std::str::FromStr;

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let token: String = stdin
        .bytes()
        .map(|c| c.expect("failed to read char") as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect();
    token.parse().ok().expect("failed to parse token")
}

fn main() {
    let x: u32 = read();
    let n: usize = read();
    let mut p: Vec<u32> = (0..n).map(|_| read()).collect();
    for i in 0..x+1 {
        let mut m = x - i;
        let mat = p.iter().find(|&n| *n == m);
        if mat == None {
            print!("{}", m);
            break;
        }
        let m = x + i;
        let mat = p.iter().find(|&n| *n == m);
        if mat == None {
            print!("{}", m);
            break;
        }
    }
}


Measured memory_bytes: 2132
#include <bits/stdc++.h>
#define ll long long
#define MODV 1000000007
#define INF INT_MAX // 2147483647
#define INFLL LLONG_MAX // 9223372036854775807
#define rep(i, n) for(ll i=0, i##_len=(ll)(n); i<i##_len; i++)
#define repf(i, n) for(ll i=1, i##_len=(ll)(n+1); i<i##_len; i++)
#define per(i, n) for(ll i=((ll)(n))-1; i>=0; i--)
#define perf(i, n) for(ll i=((ll)(n)); i>0; i--)
#define all(v) v.begin(), v.end()
#define endl "\n"
#define vi vector<ll>
#define vvi vector<vector<ll>>
#define Yes() cout << "Yes" << endl
#define YES() cout << "YES" << endl
#define No() cout << "No" << endl
#define NO() cout << "NO" << endl
#define Init() std::ios::sync_with_stdio(false); std::cin.tie(0); std::cout<<fixed<<setprecision(15);
template<class T>bool chmax(T &a, const T &b){ if(a<b){ a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b){ if(b<a){ a=b; return 1; } return 0; }
using namespace std;

int main(){
    Init();
    ll n, k; cin >> n >> k;
    ll ans = 1;
    rep(i, n) ans = min(ans+k, ans*2);
    cout << ans << endl;
}

Measured memory_bytes: 384
//============================================================================
// Name        : hoba.cpp :)
// Author      : (O_O Diab) (Why_not) (el 3AQ)
// Version     :
// Copyright   : please, Don't touch me :(
// Description : problem in C++
// MAIN IDEA   : combinatorics NCR
//============================================================================
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#define ll long long
#define ld long double
#define rw freopen("graphs_as_a_service.txt","r",stdin),freopen("output.txt","w",stdout);
#define pb push_back
#define F first
#define S second
#define pf push_front
#define lp(i,a,b) for (int i=a;i<=(int)b;++i)
#define lp2(i,a,b) for (int i=a;i>=b;--i)
#define f(x) return cout<<x<<"\n",0
#define pii pair<int,int>
#define pll pair<ll,ll>
#define all(c) c.begin(),c.end()
#define allr(c) c.rbegin(),c.rend()
#define p(x) cout<<#x<<" = { "<<x<<" } \n"
#define vi vector<int>
#define vl vector<ll>
#define vii vector<pii>
#define vll vector<pll>
#define rep(i,a) lp(i,0,a-1)
#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define EPS 1e-6
// to convert string to number use int a = stoi(string);
// to convert number to string use string s = to_string(int);
#define FAST ios::sync_with_stdio(0),ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define clr(c,x) memset(c,x,sizeof(c));
using namespace __gnu_pbds;
using namespace std;
const ll INFL = 0x3f3f3f3f3f3f3f3fLL;
const int dx[] = { 0, 1, 0, -1, 1, -1, 1, -1 };
const int dy[] = { 1, 0, -1, 0, 1, -1, -1, 1 };
const int N = 1e5 + 5, mod = (int) 1e9 + 7, INF = 0x3f3f3f3f;
vii v[N];
int st[N], fi[N], t, e[N], vis[N], cur = 0;
void dfs(int node) {
	st[node] = (++t);
	for (auto u : v[node]) {
		int ch = u.F;
		if (!st[ch])
			dfs(ch);
		else if (!fi[ch]) {
			puts("No");
			exit(0);
		}
	}
	fi[node] = (++t);
}
bool in[N];
inline void dij(int node) {
	priority_queue<pii, vii, greater<pii>> pq;
	e[node] = 0;
	vis[node] = cur;
	pq.push( { 0, node });
	while (!pq.empty()) {
		pii a = pq.top();
		pq.pop();
		for (auto u : v[a.S]) {
			if (vis[u.F] && vis[u.F] < cur)
				continue;
			//p(u.F);
			if (e[u.F] > a.F + u.S && !vis[u.F]) {
				e[u.F] = a.F + u.S;
				vis[u.F] = cur;
				pq.push( { e[u.F], u.F });
			} else if (e[u.F] != a.F + u.S && vis[u.F]) {
				puts("No");
				exit(0);
			}
		}
	}
}
int main() {
#ifdef ONLINE_JUDGE
	FAST
#endif
	int n, m;
	cin >> n >> m;
	lp(i,1,m)
	{
		int a, b, c;
		cin >> a >> b >> c;
		in[b] = true;
		v[a].pb( { b, c });
	}
	lp(i,1,n)
	{
		if (!st[i])
			dfs(i);
	}
	lp(i,1,n)
		e[i] = INF;
	lp(i,1,n)
	{
		cur++;
		if (!in[i] && !vis[i])
			dij(i);
	}
	f("Yes");
	return 0;
}

Measured memory_bytes: 10368
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <queue>
#include <string>
#include <map>
#include <set>
#include <stack>
#include <tuple>
#include <deque>
#include <numeric>
#include <bitset>
#include <iomanip>
#include <cassert>
#include <chrono>
#include <random>
#include <limits>
#include <iterator>
#include <functional>
#include <sstream>
#include <complex>
using namespace std;

using ll = long long;
using P = pair<int, int>;
constexpr int INF = 1001001001;
constexpr int mod = 1000000007;
// constexpr int mod = 998244353;

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

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

    int N;
    cin >> N;
    vector<int> ans(N + 1, 0);
    for(int x = 1; x * x <= N; ++x){
        int S = x * x;
        for(int y = 1; y * y <= N; ++y){
            int add = y * y + x * y;
            if(S + add >= N)    break;
            S += add;
            for(int z = 1; z * z <= N; ++z){
                int add2 = z * z + y * z + z * x;
                if(S + add2 > N)    break;
                ++ans[S + add2];
            }
            S -= add;
        }
    }
    for(int i = 1; i <= N; ++i) cout << ans[i] << '\n';
}

Measured memory_bytes: 3556
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

public class MainClass
{
	public const long Giri = 1000000007;
	public const long DpInf = 99999999999;
	
	public static void Main(string[] args)
	{
		var n = Console.ReadLine();
		var m = Console.ReadLine().ToInt();
		
		var dp = new long[n.Length+1, 2, 5];	//keta, miman, 0nokazu
		dp[0,0,0] = 1;
		for(int i = 0; i < n.Length; i++)
		{
			var d = (int)(n[i] - '0');
			for(int j = 0; j < 100; j++)
			{
				for(int k = 0; k < 2; k++)	//keta flag
				{
					for(int x = 0; x <= (k == 1 ? 9 : d); x++)	//0~9
					{
						
						if(x != 0 && j+1 < 5)
						{
							dp[i+1, (k == 1 || x < d) ? 1 : 0, j+1] += dp[i, k, j];
							dp[i+1, (k == 1 || x < d) ? 1 : 0, j+1] %= DpInf;
						}
						else if(j < 5)
						{
							dp[i+1, (k == 1 || x < d) ? 1 : 0, j] += dp[i, k, j];
							dp[i+1, (k == 1 || x < d) ? 1 : 0, j] %= DpInf;
						}
					}
				}
			}
		}
		Console.WriteLine(dp[n.Length, 0, m]+dp[n.Length, 1, m]);
	}
	
	static long GCD(long a, long b)
	{
		var v = new[] { a, b };
		while (v[1] != 0) { v = new[] { v[1], v[0] % v[1] }; }
		return v[0];
	}
	public static string[] Input() { return Console.ReadLine().Split(); }
}

public static class Smarter
{
	public static int ToInt(this string str) { return int.Parse(str); }
	public static long ToLong(this string str) { return long.Parse(str); }
	public static int[] ToInt(this string[] str)
	{
		var r = new int[str.Length];
		for(int i = 0; i < str.Length; i++) r[i] = str[i].ToInt();
		return r;
	 }
}


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

int bubbleSort(int A[], int N){
    bool frag = 1;
    int x=0;
    for(int i = 0; frag; i++){
        frag = 0;
        for (int j = N-1; j > 0; j--){
            if (A[j] < A[j-1]){
                swap(A[j-1],A[j]);
                frag = 1;
                x ++ ;
            }
        }
        
    }return x;
}
int main(){
    int x;
    int N;
    int A[1000];
    cin >>N;
    for (int i = 0; i < N; i++){
        cin >>A[i];
    }
    
    x = bubbleSort(A, N);
    for(int i = 0; i < N; i++){
        cout <<A[i];
        if(i!=N-1){
            cout<<" ";
        }
        else cout<<endl;
    }
    cout <<x<<endl;
    return 0;
}


Measured memory_bytes: 3104
#include <stdio.h>

int main(void){
   
   int A,B,C;
   
   scanf("%d%d%d",&A,&B,&C);
   
   int count = 0;
   
   while(B - A >= 0){
      B = B - A;
      count++;
      if(count == C){
         break;
      }
   }
   
   printf("%d\n",count);
   
   return 0;
}


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

using namespace std;

int main(){
	int a[3];
	cin>> a[0] >> a[1] >> a[2];
	sort(a, a+3);
	int sum = 0;
	for(int i = 1; i < 3; i ++)
		sum += abs(a[i]-a[i-1]);
		
	cout << sum << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> // Common file
#include <ext/pb_ds/tree_policy.hpp> // Including tree_order_statistics_node_update
using namespace std;
using namespace __gnu_pbds;
typedef tree<int, null_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;

int main()
{
    long long n, k, x, y;
    cin >> n >> k >> x >> y;
    if(k >= n)
        cout << x * n;
    else
        cout << x * k + (n - k) * y;
    return 0;
}

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

using namespace std;
typedef long long int ll;
typedef pair<int, int> ii;
#define DEBUG freopen("in.txt", "r", stdin);

struct fastio {
    fastio() {
        ios::sync_with_stdio(false);
        cout << setprecision(10) << fixed;
        cin.tie(0);
    }
};

fastio _fast_io;

const int N = 1e5 + 5;
int n, t, a, b, c;

int main() {
    cin >> n;
    for (int i = 0; i < n; ++i) {
        cin >> t;
        if (t % 4 == 0) {
            ++a;
        } else if (t % 2 == 0) {
            ++b;
        } else {
            ++c;
        }
    }
    // bbbbcacac
    if (b) {
        if (a >= c) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    } else {
        if (c <= a + 1)
            cout<< "Yes" << endl;
        else
            cout << "No" << endl;
    }
    return 0;
}


Measured memory_bytes: 3664
#include<iostream>
#include<iomanip>

using namespace std;
using ll=long long;

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

int main(){
  cin.tie(nullptr);ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  string a,b;
  cin>>a>>b;
  bool flag=true;
  rep(i,0,3){
    if(a[i]!=b[2-i]){
      flag=false;
      break;
    }
  }
  flag ? cout<<"YES"<<endl : cout<<"NO"<<endl;
}

Measured memory_bytes: 256
/** Bismillahir Rahmanir Rahim **/
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back

int main()
{
    int n, r;
    cin >> n >> r;
    if (n >= 10) cout << r << endl;
    else {
        cout << r + (100 * (10 - n)) << endl;
    }

    return 0;
}

Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
typedef long long ll;

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

int N,M;
int P[NMAX],Y[NMAX];

int main(){

    cin>>N>>M;
    vector<int> yd[NMAX+1];
    rep(i,M) cin>>P[i]>>Y[i],yd[P[i]].push_back(Y[i]);
    rep(i,N) sort(yd[i+1].begin(),yd[i+1].end());
    rep(i,M) printf("%012lld\n",ll(P[i])*1000000+int(lower_bound(yd[P[i]].begin(),yd[P[i]].end(),Y[i])-yd[P[i]].begin())+1);
}

Measured memory_bytes: 7808
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<ll, ll> l_l;
typedef pair<int , int> i_i;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<char> vec;
typedef vector<bool> veb;
typedef vector<string> ves;
typedef vector<vector<ll>> vvl;
typedef vector<vector<int>> vvi;
typedef vector<vector<char>> vvec;
typedef vector<vector<bool>> vveb;
typedef vector<vector<string>> vves;
#define rep(i,n) for(int i=0;i<(int)(n);i++)
#define rep1(i,n) for(int i=1;i<(int)(n);i++)
#define rep2(i,n) for(int i=2;i<(int)(n);i++)
#define repk(i,k,n) for(int i=k;i<(int)(n);i++)
#define rev(v) reverse(v.begin(), v.end())
#define fs first
#define sc second
#define pb push_back
#define pp pop_back
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define maxel(a) *max_element(all(a))
#define minel(a) *min_element(all(a))
#define acc accumulate
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define mod (1000000007)
typedef long long int64;
//const int64 INF = 1LL << 58;
#define dame { puts("-1"); return 0;}
#define YES { cout << "YES" << endl; return 0; }
#define NO { cout << "NO" << endl; return 0; }
#define Yes { cout << "Yes" << endl; return 0; }
#define No { cout << "No" << endl; return 0; }
#define OK { cout << "OK" << endl; return 0; }
#define NG { cout << "NG" << endl; return 0; }
#define sz(v) ((int)(v).size())
#define uniq(a) sort(all(a));(a).resize(unique(all(a)) - a.begin());
#define dab(v) for(auto i:v)cout<<i<<' '; cout << endl;
#define vin(v) for (ll i = 0; i < v.size(); ++i) cin >> v[i];
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T>void out(T a){cout << a << endl;}
template<class T>void die(T a){cout << a << endl; exit(0);}
int dx[] = {0, 0, -1, 1};
int dy[] = {1, -1, 0, 0};

#define SIZE 200005
#define MOD 1000000007
 
typedef pair <int,int> P;
 
ll inv[SIZE], fac[SIZE], finv[SIZE];
void make(){
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for(int i=2; i<SIZE; i++)
	{
		inv[i] = MOD - inv[MOD%i]*(MOD/i)%MOD;
		fac[i] = fac[i-1] * (ll) i % MOD;
		finv[i] = finv[i-1] * inv[i] % MOD;
	}
    return ;
}
ll comb(int a,int b){
	if(a < b) return 0;
	return fac[a] * (finv[b] * finv[a-b] % MOD) % MOD;
}



ll beki(int a, int n){
    if(n == 0) return 1;
    ll ans = beki(a, n / 2);
    ans = ans * ans;
    if(n % 2 == 1) ans = ans * a;
    return ans;
}

string S,T,U;
int a,b,c;
vi A,B,C;


int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
    //cout << fixed << setprecision(15);
    
    char o; cin >> o;
	if(isupper(o)) cout << "A" << endl;
	else out("a");
}

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

int main() {
  int x, t;
  cin >> x >> t;
  if(x > t)
    cout << x - t << endl;
  else
    cout << 0 << endl;
  
  //cout << (  ? "A" : "B") << endl;
}


Measured memory_bytes: 256
#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_imports)]
use std::collections::HashSet;
use std::collections::HashMap;
use std::collections::BTreeSet;
use std::collections::VecDeque;
use std::cmp::{max, min};
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
#[allow(unused_macros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[allow(unused_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

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

#[allow(unused_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

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

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

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

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}
fn main() {
    input! {
        n: usize,
        m: usize,
        a: [usize; m],
    }
    let mut md = 1_000_000_007;
    let mut dp = vec![0;n+3];
    let mut st = vec![true;n+3];
    for i in a {
        st[i] = false;
    }
    dp[0] = 1;
    if st[1] {
        dp[1] = 1;
    }
    for i in 2..n + 2{
        if st[i] {
            dp[i] = (dp[i-1] + dp[i-2]) % md;
        } else {
        }
    }
    println!("{}", dp[n] % md);
}

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

string s;
int p;
bool e;

int ParseInt()
{
	int ret=0;
	while(isdigit(s[p]))
	{
		ret*=10;
		ret+=s[p]-'0';
		p++;
	}
	
	if(ret<0||ret>9999) e=true;
	
	return ret;
}

int calc(int R1, int R2, char R3)
{
	int ret=R1;
	if(R3=='+') ret+=R2;
	if(R3=='-') ret-=R2;
	if(R3=='*') ret*=R2;
	
	if(ret<0||ret>9999) e=true;
	
	return ret;
}

int main()
{
	while(cin >> s)
	{
		e=0;
		p=0;
		
		int R1=0,R2=0;
		char R3='+';
		
		while(s[p]!='=')
		{
			if(isdigit(s[p])) R2=ParseInt();
			else
			{
				R1=calc(R1,R2,R3);
				R2=0;
				R3=s[p];
				
				p++;
			}
		}
		
		R1=calc(R1,R2,R3);
		R2=0;
		
		if(e) cout << "E" << endl;
		else cout << R1 << endl;
	}
}

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

typedef long long ll;
#define PB push_back

int main() {
	ios_base::sync_with_stdio(false); cin.tie(0);
	double n; cin >> n;
	bool works = false;
	if (n <= 81) {
		for (int i = 1; i <= 9; i++) {
			if ((n / i) == floor(n / i) && n / i <= 9) works = true;
		}
	}
	if (works) cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 256
n = int(input())
cnt=0
for i in range(n):
  a = i+1
  k = str(a)
  l = len(k)
  k1, k2 = int(k[0]), int(k[l-1])#first and last
  flag=0
  s = 10
  if k2==k1:
    cnt+=1
  if k2!=0:
    while(flag==0):
      if k2*s+k1<=n:
        if (k2+1)*s+k1<n:
          cnt+=(s//10)
        else:
          cnt+=((n-(k2*s+k1))//10+1)
        s*=10
      else:
        flag=1
print(cnt)

Measured memory_bytes: 3064
#include <iostream>
#include <stdio.h>
#include <string>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;

int main() {
	long long n, k,ans;
	cin >> n >> k;
	ans = k*pow(k - 1, n - 1);
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 512
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner  scanner = new Scanner(System.in);
		String str = scanner.next();
		int ans = 0;
		
		for (int i = 0; i < 4; i++) {
			if (str.charAt(i) == '+') {
				ans++;
			}else {
				ans--;
			}
		}
		System.out.println(ans);
		scanner.close();
		

	}

}


Measured memory_bytes: 21844
#include <iostream>
#include <string>
#include <vector>
#include <deque>
#include <queue>
#include <algorithm>
#include <iomanip>
#include <set>
#include <map>
#include <bitset>
#include <cmath>
#include <functional>

using namespace std;

#define REP(i,n) for(ll (i) = (0);(i) < (n);++i)
#define REV(i,n) for(ll (i) = (n) - 1;(i) >= 0;--i)
#define PB push_back
#define EB emplace_back
#define MP make_pair
#define FI first
#define SE second
#define SHOW1d(v,n) {REP(WW,n)cerr << v[WW] << ' ';cerr << endl;}
#define SHOW2d(v,WW,HH) {REP(W_,WW){REP(H_,HH)cerr << v[W_][H_] << ' ';cerr << endl;}}
#define ALL(v) v.begin(),v.end()
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL
#define MOD 998244353

typedef long long ll;
typedef pair<ll,ll> P;

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

	 ll n;cin >> n;
	 string str;cin >> str;

	 if(str.size() <= n)cout << str << endl;
	 else {
		 cout << str.substr(0, n) << "..." << endl;
	 }

	return 0;
}


Measured memory_bytes: 3656
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
using static System.Convert;
using static System.Math;
//using static System.Globalization.CultureInfo;

class Program
{
    static void Main(string[] args)
    {
        var nk = Array.ConvertAll(ReadLine().Split(' '), int.Parse);
        ReadLine();
        WriteLine((nk[0]+ nk[1] - 3) / (nk[1] - 1));
    }
    private const string ALFA = "abcdefghijklmnopqrstuvwxyz";
    private const int MOD = 1000000007;
}


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

public class Main {

    public static void main(String[] args) throws IOException {
        // TODO 自動生成されたメソッド・スタブ
           Scanner scan = new Scanner(System.in);
           int count = 0;
           String read = scan.next().toLowerCase();
           while(true){
               String input = scan.next();
               if(input.equals("END_OF_TEXT")){
                   break;
               }
               if(input.toLowerCase().equals(read)){
                   count++;
               }
           }
           System.out.println(count);
    }

}


Measured memory_bytes: 26220
$Q = <STDIN>;chomp $Q;
@P=(2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317);
$s=0;
for($i=3;$i<=100000;$i++){
	$f=1;
	$ii=($i+1)/2;
	for($j=0;$P[$j]*$P[$j]<=$ii;$j++){
		if($ii%$P[$j]==0) { $f=0; last; }
	}
	if ($f) {
		for($j=0;$P[$j]*$P[$j]<=$i;$j++){
			if($i%$P[$j]==0) { $f=0; last;}
		}
		$s=$s+1 if ($f);
	}
	$S[$i]=$s;
}
for($i=$Q;$i>0;$i--){
	($l,$r)=split " ",<STDIN>;
	$c=$S[$r]-$S[$l-1];
	print "$c\n";
}


Measured memory_bytes: 4096
#include<bits/stdc++.h>
using namespace std;
int main(){
  string s,t;
  cin >> s >> t;
  int i,j;
  int ans=10000;
  for(i=0;i<s.size()-t.size()+1;i++){
    int x=0;
    for(j=0;j<t.size();j++){
      if(s[i+j]!=t[j]){
        x++;
      }
    }
    ans=min(ans,x);
  }
  cout << ans << endl;
}


Measured memory_bytes: 3612
/*
オーダー
10**6	余裕を持って間に合う	
10**7	おそらく間に合う	余裕を持って間に合う
10**8	非常にシンプルな処理でない限り厳しい	おそらく間に合う
10**9		非常にシンプルな処理でない限り厳しい
logn	:OK
n		:10^7
nlogn	:10^6
n**2	:10^4
n**3	:300
2**n	:20
n!		:10



// 各桁の和を計算する関数
int findSumOfDigits(int n) {
  int sum = 0;
  while (n > 0) { // n が 0 になるまで
    sum += n % 10;
    n /= 10;
  }
  return sum;
}

sort(a, a + N, greater<int>());  // a[0:N] を大きい順にソート

int num[110] = {0};  // バケット
for (int i = 0; i < N; ++i) {
    num[d[i]]++;  // d[i] が 1 個増える
}

map<string, int> mp; // 連想配列 map<キー型, 値型> オブジェクト名
for (int i = 0; i < N; ++i) {
    auto itr = mp.find(s[i]);        // s[i] が設定されているか？
    if(itr != mp.end() ) {
         mp[s[i]] += 1;
    }
    else {
         mp[s[i]] += 1 ;
    }
}
stack<int> s;	//intをデータとするスタックを用意
s.push(1);		//{} -> {1}
printf("%d\n", s.top());	// 3
s.pop();

queue<int> que;	//intをデータとするキューを用意
que.push(1);		//{} -> {1}
printf("%d\n", que.front());	// 1
que.pop();
*/
#include <iostream>
#include <set>
#include <map>
#include <string>
#include <math.h>
#include <algorithm>
#include <vector>
#include <stack>
#include <queue>
#include <bitset>
#include <string.h>

using namespace std;

// #define for(i,a,b) for (int i=(a);i<(b);++i)
typedef long long ll;
typedef pair<ll,ll> P;
#define REP(i,n) for(long long i = 0; i < (long long)(n); i++)
#define pb push_back // vectorに要素追加
#define INF (ll)1e18
// int 
// // 各桁の和を計算する関数
// int findSumOfDigits(int n) {
//   int amari = 0;
//   int keta = 0;
//   while (n > 0) { // n が 0 になるまで
//     amari += n % 2;
//     if (keta%2==0)
//     n /= 10;
//   }
//   return sum;
// }
 
const ll MAX_N = 1e4;

ll N,M;
ll A[10];
ll num [10] = {0,2,5,5,4,5,6,3,7,6};

// dp[i] := ちょうど i 本のマッチ棒を使って、条件を満たす整数を作るときの最大桁数
ll dp[MAX_N+1]; 
void rec(ll i){
	if (i==0) dp[i] = 0; // 0本->0桁
	else{
		ll num_max = -1;
		REP(j,M){
			// i−num(A[j])本のマッチ棒を使って作った 
			// dp[i−num[A[j]]]桁の整数の頭に 
			// A[j]を付け加えて dp[i−num[A[j]]]+1桁の整数を作ることができます。
			if (i-num[A[j]]>=0) num_max = max(num_max, dp[i-num[A[j]]]+1);
		}
		dp[i] = num_max;
	}
}


int main() {
	// 入力
	cin >> N>>M;
	for (ll i = 0; i < M; ++i) cin >> A[i];
 
	// 解法
	sort(A, A+M, greater<ll>());
	// 桁数を決める
	memset(dp, -1, sizeof(dp));
	REP(i,N+1) rec(i);
	// cout << dp[N] << endl;
	
	// 出力
	ll keta = dp[N];
	ll n = N;
	// REP(i,N+1) cout << i <<" "<< dp[i] << endl;
	while (n>0){
		// cout <<"n "<<n <<endl;
		REP(i,M){
			// cout <<num[A[i]]<<endl;
			// cout << i<<" "<<dp[n-num[A[i]]]<<" "<<dp[n]-1<<endl;
			// cout 
			// <<"i "<< i 
			// << ", A[i]" << A[i] 
			// <<", num[A[i]]"<< num[A[i]] 
			// << " " <<(dp[n-num[A[i]]]==dp[n]-1)<<endl;
			// A[i] を最上位の桁dp[n-num[A[i]]]==dp[n]-1<<endl;に使えることを調べるには、
			// dp[N − num[A[i]]] = dp[N] − 1 であるかを調べればよい
			// N − num[A[i]]がマイナスのケースも考慮
			if (dp[n-num[A[i]]]==dp[n]-1 & n-num[A[i]]>=0){
				cout<<A[i];
				n = n - num[A[i]];
				break;
			}
			// else ;
		}
		// n--;
	}
	cout<<endl;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define rep(i,j,k) for(int i=j;i<k;i++)
#define all(x) (x).begin(),(x).end()
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define pb push_back
#define mp make_pair
#define BIG_NUM 2000000000
#define MOD 1000000007
#define EPS 0.000000001
const int  COMMAX = 510000;

long long fac[COMMAX], finv[COMMAX], inv[COMMAX];

int gcd(int a,int b){return b?gcd(b,a%b):a;}
int lcd(int a,int b){return a*b / gcd(a,b);}
// テーブルを作る前処理
void COMinit() {
  fac[0] = fac[1] = 1;
  finv[0] = finv[1] = 1;
  inv[1] = 1;
  for (int i = 2; i < COMMAX; i++){
    fac[i] = fac[i - 1] * i % MOD;
    inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
    finv[i] = finv[i - 1] * inv[i] % MOD;
  }
}

// 二項係数計算
long long COM(int n, int k){
  if (n < k) return 0;
  if (n < 0 || k < 0) return 0;
  return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

struct UnionFind {
  vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2
  vector<int> rank;
  int num;
  UnionFind(int N) : par(N) , rank(N) { //最初は全てが根であるとして初期化
    num = N;
    for(int i = 0; i < N; i++){
      par[i] = i;
      rank[i] = 0;
    }
  }

  int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
    if (par[x] == x) return x;
    return par[x] = root(par[x]);
  }

  void unite(int x, int y) { // xとyの木を併合
    int rx = root(x); //xの根をrx
    int ry = root(y); //yの根をry
    if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
    if(rank[rx] < rank[ry]){
      par[rx] = ry;  
    }else{
      par[ry] = rx;
      if(rank[rx] == rank[ry])rank[rx]++;
    }
    num--;
  }

  bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
    return root(x) == root(y);
  }
};

const int MS = 2;
const long long mod[] = {999999937LL, 1000000007LL}, base = 9973;
struct rolling_hash {
    int n;
    vector<long long> hs[MS], pw[MS];
    rolling_hash(){}
    rolling_hash(const string &s) {
        n = s.size();
        for (int i = 0; i < MS; i++) {
            hs[i].assign(n+1,0);
            pw[i].assign(n+1,0);
            hs[i][0] = 0;
            pw[i][0] = 1;
            for (int j = 0; j < n; j++) {
                pw[i][j+1] = pw[i][j]*base%mod[i];
                hs[i][j+1] = (hs[i][j]*base+s[j])%mod[i];
            }
        }
    }

    long long hash(int l, int r, int i) { return ((hs[i][r]-hs[i][l]*pw[i][r-l])%mod[i]+mod[i])%mod[i]; }

    bool match(int l1, int r1, int l2, int r2) {
        bool ret = 1;
        for (int i = 0; i < MS; i++) ret &= hash(l1,r1,i)==hash(l2,r2,i);
        return ret;
    }

    bool match(int l, int r, long long h[]) {
        bool ret = 1;
        for (int i = 0; i < MS; i++) ret &= hash(l,r,i)==h[i];
        return ret;
    }
};

int main(){
  int n,m;
  int res = 0;
  cin >> n >> m;
  while(n>0){
    n--;
    res += n;
  }
  while(m>0){
    m--;
    res += m;
  }
  cout << res << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
#define MP make_pair
#define PB push_back
#define ALL(x)      (x).begin(),(x).end()
#define REP(i,n)    for(int i=0;i<(n);i++)
#define REP1(i,n)   for(int i=1;i<(n);i++)
#define REP2(i,d,n) for(int i=(d);i<(n);i++)
#define RREP(i,n)   for(int i=(n);i>=0;i--)
#define CLR(a)      memset((a),0,sizeof(a))
#define MCLR(a)     memset((a),-1,sizeof(a))
#define RANGE(x,y,maxX,maxY) (0 <= (x) && 0 <= (y) && (x) < (maxX) && (y) < (maxY))
 
typedef long long LL;
typedef unsigned long long ULL;
typedef vector<int> VI;
typedef vector<VI > VVI;
typedef vector<string> VS;
typedef vector<LL> VLL;
typedef pair<int,int> PII;
 
const int INF = 0x3f3f3f3f;
const LL INFL = 0x3f3f3f3f3f3f3f3fLL;
const double EPS = 1e-9;
 
const int DX[]={1,0,-1,0},DY[]={0,-1,0,1};

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

    int ans = 1;
    int cnt = 0;

    REP2(i, 2, N+1) {
        int tmp = i;
        int cnt2 = 0;
        while(tmp % 2 == 0) {
            cnt2++;
            tmp /= 2;
        }
        if(cnt <= cnt2) {
            cnt = cnt2;
            ans = i;
        }
    }

    cout << ans << endl;
    
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt() + sc.nextInt();
		if(a >= 10) {
			System.out.println("error");
		} else {
			System.out.println(a);
		}
	}
}


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

int main() {
	string s, c;
	cin >> s >> c;
	int ans = 0;
	for(int i = 0; i < 3; ++i) {
		if(s[i] == c[i]) ++ans;
	}
	cout << ans;
	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace abc124_a
{
    class Program
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split(' ');
            int a = Convert.ToInt32(input[0]);
            int b = Convert.ToInt32(input[1]);

            int sum = 0;

            if (a == b)
            {
                sum = a + b;
            }
            else if (a > b)
            {
                sum = a * 2 - 1;
            }
            else if (b > a)
            {
                sum = b * 2 - 1;
            }

            Console.WriteLine(sum);

            Console.Read();

        }
    }
}


Measured memory_bytes: 13268
/******************************************************************************

                              Online C++ Compiler.
               Code, Compile, Run and Debug C++ program online.
Write your code in this editor and press "Run" button to compile and execute it.

*******************************************************************************/

#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <cmath>
#include <string>

typedef long long ll;

using namespace std;

int main()
{
    int n, L;
    cin>>n>>L;
    vector<string> V(n);
    for(int i = 0; i < n; i++){
        cin>>V[i];
    }
    
    sort(V.begin(), V.end());
    string Word = "";
    for(int i = 0; i < n; i++){
        Word += V[i];
    }
    
    cout<<Word<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int[] h = new int[n];
		for (int i = 0; i < h.length; i++) {
			h[i] = sc.nextInt();
		}
		sc.close();

		int ans = 0;
		int cnt = 0;
		for (int i = 1; i < h.length; i++) {
			if (h[i - 1] >= h[i]) {
				cnt++;
			} else {
				ans = Math.max(ans, cnt);
				cnt = 0;
			}
		}
		ans = Math.max(ans, cnt);
		System.out.println(ans);
	}
}


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

const int RLEN=1<<18|1;
inline char nc() {
	static char ibuf[RLEN],*ib,*ob;
	(ib==ob) && (ob=(ib=ibuf)+fread(ibuf,1,RLEN,stdin));
	return (ib==ob) ? -1 : *ib++;
}
inline int rd() {
	char ch=nc(); int i=0,f=1;
	while(!isdigit(ch)) {if(ch=='-')f=-1; ch=nc();}
	while(isdigit(ch)) {i=(i<<1)+(i<<3)+ch-'0'; ch=nc();}
	return i*f;
}

const int N=4e5+50;
int n,q,mn[N],anc[N];
long long ans;

struct data {
	int x,y,w;
	data(int x,int y,int w) : x(x),y(y),w(w) {}
	friend inline bool operator <(const data &a,const data &b) {return a.w<b.w;}
};
vector <data> edge;

inline int ga(int x) {while(x!=anc[x]) x=anc[x]=anc[anc[x]]; return x;}
int main() {
	n=rd(), q=rd();
	for(int i=0;i<2*n;i++) mn[i]=0x3f3f3f3f;
	for(int i=1;i<=q;i++) {
		int x=rd(), y=rd(), w=rd();
		mn[x]=min(mn[x],w+1);
		mn[y]=min(mn[y],w+2);
		edge.push_back(data(x,y,w));
	}
	for(int i=1;i<2*n;i++) mn[i]=min(mn[i],mn[i-1]+2);
	for(int i=0;i<=n-1;i++) {
		int w=min(mn[i],mn[i+n]);
		int x=i%n, y=(i+1)%n;
		edge.push_back(data(x,y,w));
	} sort(edge.begin(),edge.end());
	for(int i=0;i<n;i++) anc[i]=i;
	for(auto v:edge) {
		int x=ga(v.x), y=ga(v.y);
		if(x==y) continue;
		ans+=v.w; anc[x]=y; 
	} cout<<ans<<'\n';
}


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

int get_index(char c) {
    if (0x41 <= c && c <= 0x5a) {
        return int(c) - 0x41;
    }
    if (0x61 <= c && c <= 0x7a) {
        return int(c) - 0x61;
    }
    return 26;
}

int compare(string &a, string &b) {
    if (a.length() != b.length()) return 0;

    for (int i = 0; i < a.length(); ++i) {
        if (get_index(a[i]) != get_index(b[i])) {
            return 0;
        } else {
            continue;
        }
    }

    return 1;
}

int main() {
    string W;
    cin >> W;

    int count;
    for (;;) {
        string T;
        cin >> T;

        if (T == "END_OF_TEXT") break;

            if (compare(W, T)) ++count;
    }
    cout << count << endl;

    return 0;
}

Measured memory_bytes: 1192
open Batteries
module EnumL = Enum.Labels
module ListL = List.Labels

let dbg0 x = Printf.eprintf "[debug]%s\n" @@ dump x
let dbg1 x = dbg0 x; x

let id = identity

let (++) n m = List.range n `To m
let (++^) n m = if n < m then List.range n `To (pred m) else []

let scan fmt = Scanf.sscanf (read_line ()) fmt

let scan_lines n fmt f =
  if n = 0 then Enum.empty ()
  else
    List.map (fun _ -> scan fmt f) (List.range 1 `To n)
    |> List.enum

let scan_list cnv =
  String.split_on_char ' ' @@ read_line ()
  |> List.map cnv

let scan_array cnv = Array.of_list @@ scan_list cnv

let scan_matrix n m e conv =
  let arr = Array.make_matrix n m e in
  ListL.iter (List.range 0 `To (pred n))
    ~f:(fun i -> arr.(i) <- Array.of_list @@ scan_list conv);
  arr

let rec powerset e =
  match Enum.get e with
  | None -> Enum.singleton @@ Enum.empty ()
  | Some v ->
    let f = powerset e in
    let g = Enum.clone f in
    EnumL.map f ~f:(fun x -> let y = Enum.clone x in push y v; y)
    |>  Enum.append g

let permutations l =
  let rec aux l =
    let rec interleave x = function
      | [] -> [[x]]
      | (hd::tl) as lst ->
        (x::lst) ::
        (ListL.map ~f:(List.cons hd)  @@ interleave x tl)
    in
    match l with
    | [] -> [[]]
    | hd::tl -> List.concat @@ List.map (interleave hd) @@ aux tl in
  let l = List.sort (List.compare Int.compare) @@ aux @@ List.of_enum l in
  List.enum % ListL.map ~f:List.enum @@ l

let intersection l =
  EnumL.filter ~f:(fun x -> EnumL.exists ~f:((=) x) @@ Enum.clone l)

let lower_bound n f =
  let rec aux l u =
    if abs @@ u - l > 1 then
      let m = (l + u) / 2 in
      if f m then aux l m
      else aux m u
    else u in aux (-1) n

let n = scan "%d" id
let a = scan_array Int.of_string
let b = scan_array Int.of_string
let c = scan_array Int.of_string

let () =
  Array.sort Int.compare a;
  Array.sort Int.compare b;
  Array.sort Int.compare c;
  ListL.map (0 ++^ Array.length b) ~f:(fun i ->
      let j = lower_bound (Array.length a) (fun l -> b.(i) <= a.(l)) in
      let k = lower_bound (Array.length c) (fun l -> b.(i) < c.(l)) in
      j * (Array.length c - k))
  |> List.sum
  |> Printf.printf "%d\n"


Measured memory_bytes: 18972
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.IO;

using static Input;
using static Util;
class Program
{
    static int N;
    static double[] P;
    static void INPUT()
    {
        N = NextInt();
        P = LineDouble();
    }

    static void OUT()
    {
        var dp = new double[N + 1, N + 1];
        dp[0, 0] = 1;
        for (int i = 0; i < N; i++)
        {
            for (int j = 0; j <= N; j++)
            {
                if (dp[i, j] == 0) continue;
                dp[i + 1, j + 1] += dp[i, j] * P[i];
                dp[i + 1, j] += dp[i, j] * (1d - P[i]);
            }
        }

        var sum = 0d;
        for (int i = N / 2 + 1; i <= N; i++)
        {
            sum += dp[N, i];
        }
        Console.WriteLine(sum);
    }
    static void Main(string[] args)
    {
#if DEBUG  
        //TESTINPUT();
        INPUT();

#else
        INPUT();
#endif
        OUT();
    }

    static void TESTINPUT()
    {
    }

}

public class Input
{
    public const long MOD = 1000000007;
    public const int INF = 1000000007;
    private static Queue<string> q = new Queue<string>();
    private static void Confirm() { if (q.Count == 0) foreach (var s in Console.ReadLine().Split(' ')) q.Enqueue(s); }
    public static int NextInt() { Confirm(); return int.Parse(q.Dequeue()); }
    public static long NextLong() { Confirm(); return long.Parse(q.Dequeue()); }
    public static string NextString() { Confirm(); return q.Dequeue(); }
    public static double NextDouble() { Confirm(); return double.Parse(q.Dequeue()); }
    public static int[] LineInt() { return Console.ReadLine().Split(' ').Select(int.Parse).ToArray(); }
    public static long[] LineLong() { return Console.ReadLine().Split(' ').Select(long.Parse).ToArray(); }
    public static string[] LineString() { return Console.ReadLine().Split(' ').ToArray(); }
    public static double[] LineDouble() { return Console.ReadLine().Split(' ').Select(double.Parse).ToArray(); }
}

class Util
{

}




Measured memory_bytes: 81376
#include <bits/stdc++.h>
#define ll long long
using namespace std;
#define rep(i, n) for (int i = 0; i < n; i++)
#define rrep(i, n) for (int i = 1; i <= n; i++)
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
using P = pair <int, int>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
 
ll MOD = 1000000007;
ll INF =1<<30;



int main(){
   int a,b,k;
   cin >> a>>b>>k;
   rep(i,k/2){
       if(a%2==1){
           a--;
           a/=2;
           b+=a;
           if(b%2==1) {b--,b/=2;a+=b;}
           else{
               b/=2;
               a+=b;
           }
       }
       else{
           a/=2;
           b+=a;
           if(b%2==1) {b--,b/=2;a+=b;}
           else{
               b/=2;
               a+=b;
           }
       }
   }
   if(k%2==1){
       if(a%2==1) {a--;a/=2;b+=a;}
       else {a/=2,b+=a;}
   }
   cout << a<< ' ' <<b <<endl;

}

Measured memory_bytes: 3532
#include<iostream>
#include<iomanip>
#include<math.h>
#include<algorithm>
#include<string>
#include<string.h>
#include<vector>
#include<queue>
#include<stack>
#include<set>
#include<map>
#include<complex>
#define REP(i, N) for(ll i = 0; i < N; ++i)
#define FOR(i, a, b) for(ll i = a; i < b; ++i)
#define ALL(a) (a).begin(),(a).end()
#define pb push_back
#define INF (long long)1000000000
#define MOD 1000000007
#define EPS (long double) 1e-8
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
int dh[4] = {1, 0, -1, 0};
int dw[4] = {0, 1, 0, -1};

int main(void) {
	while(true) {
		int n;
		cin>>n;
		if(n == 0) break;
		int res = 0;
		FOR(i, 1, n) {
			int sum = 0;
			FOR(j, i, n) {
				sum += j;
				if(sum == n) {
					++res;
					break;
				} else if(sum > n) {
					break;
				}
			}
		}
		cout<<res<<endl;
	}
}

Measured memory_bytes: 3024
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0, i##_len = (n); i < i##_len; ++i)
#define REPS(i, _s, n) for(int i = _s, i##_len = (n); i < i##_len; ++i)
#define ALL(x) (x).begin(), (x).end()
using namespace std;

#define repi(itr, ds) for(auto itr = ds.begin(); itr != ds.end(); itr++)
// vector
template <typename T>
istream &operator>>(istream &is, vector<T> &vec) {
  for(T &x : vec) is >> x;
  return is;
}
// pair
template <typename T, typename U>
ostream &operator<<(ostream &os, pair<T, U> &pair_var) {
  os << "(" << pair_var.first << ", " << pair_var.second << ")";
  return os;
}
// vector
template <typename T>
ostream &operator<<(ostream &os, const vector<T> &vec) {
  os << "{";
  for(int i = 0; i < vec.size(); i++) {
    os << vec[i] << (i + 1 == vec.size() ? "" : ", ");
  }
  os << "}\n   ";
  return os;
}
// map
template <typename T, typename U>
ostream &operator<<(ostream &os, map<T, U> &map_var) {
  os << "{";
  repi(itr, map_var) {
    os << *itr;
    itr++;
    if(itr != map_var.end()) os << ", ";
    itr--;
  }
  os << "}";
  return os;
}
// set
template <typename T>
ostream &operator<<(ostream &os, set<T> &set_var) {
  os << "{";
  repi(itr, set_var) {
    os << *itr;
    itr++;
    if(itr != set_var.end()) os << ", ";
    itr--;
  }
  os << "}";
  return os;
}

#define DUMPOUT cerr

void dump_func() { DUMPOUT << endl; }
template <class Head, class... Tail>
void dump_func(Head &&head, Tail &&... tail) {
  DUMPOUT << head;
  if(sizeof...(Tail) > 0) {
    DUMPOUT << ", ";
  }
  dump_func(std::move(tail)...);
}
#ifdef DEBUG_
#define DEB
#define dump(...)                                                             \
  DUMPOUT << "  " << string(#__VA_ARGS__) << ": "                             \
          << "[" << to_string(__LINE__) << ":" << __FUNCTION__ << "]" << endl \
          << "    ",                                                          \
      dump_func(__VA_ARGS__)
#else
#define DEB if(false)
#define dump(...)
#endif

typedef long long int ll;

int main() {
  int N, K;
  cin >> N >> K;
  auto H = vector<int>(N);
  REP(i, N) { cin >> H[i]; }
  sort(ALL(H));
  ll sum = 0;
  REP(i, N - K) { sum += H[i]; }
  cout << sum << endl;
}


Measured memory_bytes: 1024