akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
template<class T,class U> using P = pair<T,U>;
template<class T> using vec = vector<T>;
template<class T> using vvec = vector<vec<T>>;

class Data{
public:
    unordered_map<int,int> p,s,e;
    vec<P<int,int>> edges;
    int res;
    Data(){}
    Data(int c,int d){
        if(c==d){
            p[c] = c;
            s[c] = 1;
        }else{
            p[c] = p[d] = c;
            s[c] = 2;
        }
        e[c] = 1;
        edges.emplace_back(c,d);
        res = 1;
    }
	int find(int x){
        if(!p.count(x)){
            s[x] = 1;
            e[x] = 0;
            return p[x] = x;
        }
		if(p[x]==x) return x;
		else return p[x] = find(p[x]);
	}
	void unite(int x,int y){
        x = find(x); y = find(y);
		if(x==y){
            res -= min(s[x],e[x]);
            e[x]++;
            res += min(s[x],e[x]);
            return ;
        }
		if(s[x]>s[y]) swap(x,y);
        res -= min(s[x],e[x])+min(s[y],e[y]);
		p[x] = y;
		s[y] += s[x];
        e[y] += e[x]+1;
        res += min(s[y],e[y]);
	}
	bool is_same_set(int x,int y) {return find(x)==find(y);}
	int size(int x) {return s[find(x)];}

    bool operator<(const Data& r)const{
        return edges.size()<r.edges.size();
    }
    bool operator>(const Data& r)const{
        return edges.size()>r.edges.size();
    }

    void clear(){
        p.clear();
        s.clear();
        e.clear();
        edges.clear();
        res = 0;
    }
};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N,K;
    cin >> N >> K;
    vvec<int> g(N);
    for(int i=0;i<N-1;i++){
        int a,b;
        cin >> a >> b;
        a--; b--;
        g[a].push_back(b);
        g[b].push_back(a);
    }
    vec<int> C(N),D(N);
    for(int i=0;i<N;i++){
        cin >> C[i] >> D[i];
        C[i]--; D[i]--;
    }
    vec<int> ans(N);
    vec<Data> data(N);

    auto unite = [&](Data& large,Data& small){
        for(auto& p:small.edges){
            large.unite(p.first,p.second);
            large.edges.push_back(p);
        }
        small.clear();
    };

    auto dfs = [&](auto&& self,int cur,int par)->void{
        int ma = -1;
        data[cur] = Data(C[cur],D[cur]);
        for(auto to:g[cur]) if(to!=par){
            self(self,to,cur);
            if(ma==-1 || data[ma]<data[to]) ma = to;
        }
        if(ma==-1){
            ans[cur] = data[cur].res;
            return ;
        }
        swap(data[cur],data[ma]);
        unite(data[cur],data[ma]);
        for(auto& to:g[cur]) if(to!=par && to!=ma) unite(data[cur],data[to]);
        ans[cur] = data[cur].res;
    };

    dfs(dfs,0,-1);

    for(int i=0;i<N;i++) cout << ans[i] << "\n";
}


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

xs = sorted(X)
median1 = xs[N//2-1]
median2 = xs[N//2]

for i in range(N):
    if X[i] == median1:
        print(median2)
    elif X[i] == median2:
        print(median1)
    elif X[i] < median1:
        print(median2)
    elif X[i] > median2:
        print(median1)


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

int main()
{
  char str[20],x[20],y[20];
  int a,b,i=0,j=0;
  int d,r;
  double f;
 
  fgets(str,sizeof(str),stdin);
  
  for(;;){
    if(str[i]==' '){
      break;
    }
    x[i]=str[i];
    i++;
  }
  
  for(;;){
    if(str[i]=='\0'){
      break;
    }
    y[j]=str[i];
    i++;
    j++;
  }
  a=atoi(x);
  b=atoi(y);
  
  if(a<1 || 1000000000<b){
    printf("Error!!\n");
  }else{
    d=a/b;
    r=a%b;
    f=(double)a/(double)b;
    printf("%d %d %f\n",d,r,f);
  }
  return 0;
}

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

int main(void){
  int e,x,y,z,ans;
  while(cin>>e,e){
    ans=1e6;
    for(z=0;z*z*z<=e;++z){
      for(y=0;z*z*z+y*y<=e;++y){
          ans=min(ans,e-(z*z*z+y*y)+y+z);
      }
    }
    cout<<ans<<endl;
  }
  return 0;
}

Measured memory_bytes: 1160
import math
n = int(input())

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

p1 = sum(math.fabs(a[i]-b[i]) for i in range(n))
p2 = math.sqrt(sum([math.fabs(a[i]-b[i])**2 for i in range(n)]))
p3 = math.pow(sum([math.fabs(a[i]-b[i])**3 for i in range(n)]), 1/3)
pp = max([math.fabs(a[i]-b[i]) for i in range(n)])

print('{0:6f}'.format(p1))
print('{0:6f}'.format(p2))
print('{0:6f}'.format(p3))
print('{0:6f}'.format(pp))


Measured memory_bytes: 5724
from collections import Counter
N = int(input())
Alist = list(map(int, input().split()))
Ac = Counter(Alist)
length_list = sorted(Ac.keys(), reverse=True)
can_use = []
for l in length_list:
    if Ac[l] >= 4:
        if can_use:
            print(can_use[0]*l)
            exit()
        else:
            print(l**2)
            exit()
    elif Ac[l] >= 2:
        if can_use:
            print(can_use[0]*l)
            exit()
        else:
            can_use.append(l)

print(0)

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

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

	if (a % 2 != 0 && b % 2 != 0) {
		cout << "Odd" << endl;
	}
	else {
		cout << "Even" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
S = input()
BLOCK = S.replace('BC', 'D').replace('B', ' ').replace('C', ' ').split()

ans = 0
for block in BLOCK:
    d_index = [i for i, s in enumerate(block) if s == 'D']
    ans += sum(r - i for (i, r) in enumerate(d_index))

print(ans)


Measured memory_bytes: 6248
//#pragma GCC optimize "trapv"
//-D_GLIBCXX_DEBUG
#include<bits/stdc++.h>
using namespace std;
#define pm(m) for(auto itr=(m).begin();itr!=(m).end();itr++){itr->first<<" "<<itr->second<<"\n";}
#define int long long int
#define all(x) x.begin(),x.end()
#define allr(x) x.rbegin(),x.rend()
#define ii pair<int,int>
#define Max 100000+5
#define IO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define f first
#define s second
#define pb push_back
#define bug(x) cout<<(x)<<" ";exit(0);
int mod = 1000000007;
int mod1 = 998244353;
vector<int> g[Max];
bool vis[Max];
int d, x, y;
int gcd(int a,int b){
    if(b==0)return a;
    return gcd(b,a%b);
}
void ex(int A, int B) {
    if(B == 0) {
        d = A;
        x = 1;
        y = 0;
    }
    else {
        ex(B, A%B);
        int temp = x;
        x = y;
        y = temp - (A/B)*y;
    }
}


void dfs(int u){

	vis[u]=1;
	for(int i=0;i<g[u].size();i++){
		int v=g[u][i];
		if(vis[v]!=1)
			dfs(v);
	}
}



int power(int a,int b){
    if(b==1)return a;
    if(a>mod)a%=mod;
    int r=1;
    while(b){
        if(b&1)r=r%mod*a%mod;
        a=a%mod*a%mod;
        b/=2;
    }
    return r;
}
class uf{
    vector<int> v;
    vector<int> sz;
    
    
    public :
    uf(int n){
        v.resize(n+1);
        iota(v.begin()+1,v.end(),1);
        sz.resize(n+1,1);
        //1 to sz
    }
    int root(int b){
        while(v[b]!=b){
            b = v[b];
        }   
        return b;
    }
    void u(int a, int b){
        //combine a and b
        
        int ra=root(a);
        int rb=root(b);
        if(ra==rb)return ;
        if(sz[ra]<sz[rb]){
            v[ra] = v[rb];
            sz[rb]+=sz[ra];
        }else{
            v[rb]=v[ra];
            sz[ra]+=sz[rb];
        }
    }
    bool f(int a,int b){
        //same set
        return (root(a)==root(b));
    }
   
    
};
vector<int> matmul(vector<int> a,vector<int> b){
    vector<int> c(4,0);
    c[0] = (a[0]%mod*b[0]%mod + a[1]%mod*b[2]%mod)%mod;
    c[1] = (a[0]%mod*b[1]%mod + a[1]%mod*b[3]%mod)%mod;
    c[2] = (a[2]%mod*b[0]%mod + a[3]%mod*b[2]%mod)%mod;
    c[3] = (a[2]%mod*b[1]%mod + a[3]%mod*b[3]%mod)%mod;
    return c;
}
vector<int> id={1,0,0,1};

int kyu(int a){
    if(400<=a and a<=599)return 8;
    if(600<=a and a<=799)return 7;
    if(800<=a and a<=999)return 6;
    if(1000<=a and a<=1199)return 5;
    if(1200<=a and a<=1399)return 4;
    if(1400<=a and a<=1599)return 3;
    if(1600<=a and a<=1799)return 2;
    if(1800<=a and a<=1999)return 1;
    
}
int32_t main(){
	IO
	//freopen("input.txt","r",stdin);
    	//freopen("output.txt","w",stdout);
	int t;
	cin>>t;
	cout<<kyu(t);
}

Measured memory_bytes: 6000
N, K = map(int, input().split())
A = 1
ans = 0



while (A <= N):
  count = 0
  T = A
  while (T<K):
    T = T*2
    count += 1
  ans += float((1/N)*(1/2)**count)
  A += 1
  
print(ans)
    

Measured memory_bytes: 9352
import java.util.Scanner;


public class Main {

	static String swap(String s, int i, int j) {
		StringBuilder sb = new StringBuilder();
		int a, b;
		if (i == j) { return sb.append(s).toString();
		} else if (i < j) { a = i; b = j;
		} else { a = j; b = i; }
		sb.append(s.substring(0, a));
		sb.append(s.charAt(b));
		sb.append(s.substring(a+1, b));
		sb.append(s.charAt(a));
		sb.append(s.substring(b+1));
		return sb.toString();
	}

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		int W = sc.nextInt(), N = sc.nextInt(); sc.nextLine();
		StringBuilder sb = new StringBuilder();
		for (int i = 0 ; i < W ; i++) sb.append((char) (49+i));
		String str = sb.toString();
		for (int i = 0 ; i < N ; i++) {
			String[] bar = sc.nextLine().split(",");
			str = swap(str, Integer.parseInt(bar[0])-1, Integer.parseInt(bar[1])-1);
		}
		for (int i = 0 ; i < W ; i++) System.out.println(((int) str.charAt(i))-48);
	}
}

Measured memory_bytes: 17228
import itertools
import math
import fractions
import functools
n, m = map(int, input().split())
a = list(map(int, input().split()))
count = 0
for i in range(n):
    if a[i] >= sum(a)/4/m:
        count += 1
if count >= m:print("Yes")
else: print("No")

Measured memory_bytes: 66156
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(void) {
	vector<int> a(3);
	for (int i = 0; i < 3; ++i) {
		cin >> a[i];
	}
	sort(a.begin(),a.end());
	for (int i = 0; i < 3; ++i) {
		cout << a[i];
		if (i < 2) {
			cout << " ";
		}
	}
	cout << endl;
	return 0;
}



Measured memory_bytes: 3120
#include <bits/stdc++.h>
#include <boost/multiprecision/cpp_int.hpp>

// increment
#define rep_n(_1, _2, _3, NAME, ...) NAME
#define rep_2(i, n) for (int(i) = 0; (i) < (int)(n); ++(i))
#define rep_3(i, initial, n) for (int(i) = (int)(initial); (i) < (int)(n); ++(i))
#define rep(...) rep_n(__VA_ARGS__, rep_3, rep_2, rep_1)(__VA_ARGS__)
// decrement
#define rep_r_n(_1, _2, _3, NAME, ...) NAME
#define rep_r_2(i, n) for (int(i) = (int)(n); (i) > 0; (i)--)
#define rep_r_3(i, initial, n) for (int(i) = (int)(initial); (i) > (int)(n); (i)--)
#define rep_r(...) rep_r_n(__VA_ARGS__, rep_r_3, rep_r_2)(__VA_ARGS__)
// define type definition
using namespace std;
typedef long long ll;
using mpint = boost::multiprecision::cpp_int; // 多倍長整数（任意精度）
typedef pair<int, int> P;

// define construct variable
const double EPS = numeric_limits<double>::epsilon();
// 10^9 + 7
const ll MOD = ll(1e9)+7;
const ll INF = ll(1e10);
const string ALPHABET = "abcdefghijklmnopqrstuvwxyz";

// define methods
// 最大公約数
ll gcd(const ll a, const ll b) { return b ? gcd(b, a % b) : a; }
// 最小公倍数
ll lcm(const ll a, const ll b) { return a / gcd(a, b) * b; }
// char -> int
int ctoi(char c) { return (int)(c - '0'); }
// 素因数分解
vector< pair<ll, ll> > prime_factorize(ll n) {
  vector< pair<ll, ll> > p;
  for (ll i = 2; i * i <= n; i++) {
    if ((n % i) != 0) continue;
    p.push_back(make_pair(i, 0));
    while ((n % i) == 0) {
      n /= i;
      p[i].second += 1;
    }
    p.push_back(make_pair(n, 0));
  }

  if (n != 1) p.push_back(make_pair(n, 1));
  return p;
}
// 組み合わせの整合性を保つ（後ほど解析する）
ll modinv(ll a) {
	ll b = MOD, u = 1, v = 0;
	while (b) {
		ll t = a / b;
		a -= t * b;
		swap(a, b);
		u -= t * v;
		swap(u, v);
	}
	u %= MOD;
	if (u < 0) { u += MOD; }
	return u;
}
// 順列
ll permutation(const ll n, const ll m) {
	ll result = 1;
	for (ll i = n; i > n - m; i--) { result = (result * i) % MOD; }
	return result;
}

// 繰り返し n 乗法
ll repeat_square(const ll n, const ll x) {
	if (x == 0) return 1;
	ll res = repeat_square(n, x/2);
	res = res * res % MOD;
	if ((x % 2) == 1) res = res * n % MOD;
  return res;
}
// 組み合わせ
ll combination(const ll n, const ll a) {
	ll x = 1, y = 1;
  for(ll i = 0; i < a; i++){
    x = x * (n-i) % MOD;
    y = y * (i+1) % MOD;
  }
  return x * repeat_square(y, MOD-2) % MOD;
}

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

  vector<int> total(100002, 0);
  rep(i, N) {
    int a;
    cin >> a;
    if ((a-1) > 0) total[a-1]++;
    total[a]++;
    total[a+1]++;
  }

  sort(total.begin(), total.end(), greater<int>());

  cout << total[0] << endl;
  return 0;
}


Measured memory_bytes: 3768
function Main(input) {
	input = input.split(" "); 
	var a = BigInt(input[0], 10);
	var b = BigInt(input[1], 10);
    var c = BigInt(input[2], 10);
    var d = BigInt(input[3], 10);
    
  	var ans = a * c;
  	if(a * d > ans) ans = a * d;
  	if(b * c > ans) ans = b * c;
  	if(b * d > ans) ans = b * d;

    console.log(ans.toString());
}

Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29468
/*Author : Kartik Bansal
 *Date : 07/09/19
 *Time : 16:14 */
#include <bits/stdc++.h>
using namespace std;
typedef long long ll ;
#define tc int t ;cin>>t ;while(t--)
#define pb push_back
#define FOR(i,n) for(int i =0;i<n;i++)
#define loop(i,a,b) for(int i=a;i<b;i++)
#define all(v) v.begin() , v.end()
#define sort(v) sort(all(v))
#define vi  vector<int>
#define vll  vector<long long >
#define inf INT_MAX
#define minf INT_MIN
int32_t main()
{
  ios::sync_with_stdio(0) ;
  cin.tie(0) ; cout.tie(0) ;
  int n ;
  string s ;
  cin>>n>>s ;
  stack<char> lol ;

  lol.push(s[0]) ;
  loop(i,1, n )
  {
         if(s[i] == lol.top())
              continue ;
       else
       {
              lol.push(s[i]) ;
       }
 }
 cout << lol.size() ;

  return 0 ;
}


Measured memory_bytes: 512
#include <float.h>
#include <inttypes.h>
#include <limits.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <math.h>
#ifdef __cplusplus
#include <bits/stdc++.h>
#endif

int comp(const void *a, const void *b){return (*(int*)a>*(int*)b)-(*(int*)a<*(int*)b);}
int compr(const void *a, const void *b){return (*(int*)a<*(int*)b)-(*(int*)a>*(int*)b);}

uint32_t nextpint(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint32_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint64_t nextplong(void){ char c=getchar(); while(c<'0'||'9'<c) c=getchar(); uint64_t x=0; while('0'<=c && c<='9'){ x=x*10+c-'0'; c=getchar(); } return x; }
uint32_t nextstr(char *s){ char c=getchar(); while(c==' '||c=='\n') c=getchar(); uint32_t len=0; while(c!=' '&&c!='\n'){ *s++=c; len++; c=getchar(); } *s='\0'; return len; }

inline int max2(const int a, const int b){return a>b?a:b;}
inline int min2(const int a, const int b){return a>b?b:a;}
inline int dif2(const int a, const int b){return a>b?a-b:b-a;}
inline int abs2(const int a){return a>=0?a:-a;}

std::multiset<int> r;
std::multiset<int, std::greater<int>> l;

int main(void){
	int q=nextpint();
	int L=INT_MIN;
	int R=INT_MAX;
	l.insert(L);
	r.insert(R);
	long b=0;
	long x=0;
	for(int i=0; i<q; i++){
		int Q=nextpint();
		if(Q==1){
			int A, B;
			scanf("%d%d", &A, &B);
			b+=B;
			if(A<L){
				l.erase(l.find(L));
				r.insert(L);
				l.insert(A);
				l.insert(A);
				x+=L-A;
				R=L; L=*l.begin();
			}else if(A>R){
				r.erase(r.find(R));
				l.insert(R);
				r.insert(A);
				r.insert(A);
				x+=A-R;
				L=R; R=*r.begin();
			}else{
				l.insert(A);
				r.insert(A);
				L=R=A;
			}
		}else{
			printf("%d %ld\n", L, x+b);
		}
	}
}


Measured memory_bytes: 18944
N, K = map(int, input().split())
Hate = list(map(int, input().split()))
D = [d for d in range(10) if d not in Hate]
D0 = D[:]
if 0 not in D:
    D0.insert(0, 0)
for d4 in D0:
    for d3 in D0:
        for d2 in D0:
            for d1 in D0:
                for d0 in D:
                    M = 10000 * d4 + 1000 * d3 + 100 * d2 + 10 * d1 + d0
                    if N <= M:
                        if 0 == D[0] or M <= 99:
                            print(M)
                            break
                        elif M <= 999 and d1 != 0:
                            print(M)
                            break
                        elif 1000 <= M <= 9999 and d1 != 0 and d2 != 0:
                            print(M)
                            break
                        elif 10000 <= M and d1 != 0 and d2 != 0 and d3 != 0:
                            print(M)
                            break
                else:
                    continue
                break
            else:
                continue
            break
        else:
            continue
        break
    else:
        continue
    break


Measured memory_bytes: 38768
// Daritys Morgho ban Rovegrie
// Math = ♥
// Sometimes it is people that no one imagines anything of who do things that no one can imagine
// After all this time? Always

#include <bits/stdc++.h>                        // uncomment before submission
//#include <ext/pb_ds/assoc_container.hpp>		// uncomment before submission
//#include <ext/pb_ds/tree_policy.hpp>			// uncomment before submission
//using namespace __gnu_pbds;					// uncomment before submission
using namespace std;
//<---------------------------------------------------Template----------------------------------------------------------->
#define int long long
#define ll long long
#define ld long double
const int INF = 1e15 + 7;
const int MAX = 1e5 + 7;
const int MOD = 1e9 + 7;
typedef pair<ll, ll> ii;
typedef vector<ll> vi;                  // Vector of long long
typedef vector<vi> vvi;                 // Vector of vi
typedef vector<ii> vii;                 // Vector of pairs
typedef vector<vii> vvii;               // Vector of Vector of pairs
typedef vector<bool> vb;                // Vector of bool
#define pq priority_queue               // Max heap (To convert to min heap, use negative sign before every value)
#define ff first                        // For pairs
#define ss second                       // For pairs
#define pb push_back                    // Push back to vector
#define mp make_pair                    // Makes pairs to be stored as pair
#define all(c) (c).begin(), (c).end()   // Mainly used by me in sorting
#define run(x, c) (x)=(c).begin(); (x)!=(c).end(); (x)++ // Mainly used by me for range based loops
// ordered_set adds two new functions to set - (set).find_by_order([kth element based on zero indexing]) and order_of_key()
// order_of_key returns number of elements less that parameter. If element exists, that order is its index
#define ordered_set tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update>
//<----------------------------------------------------------------------------------------------------------------------->

signed main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int n, k;
    cin >> n >> k;
    vi a(n);
    vector<bool> f(k + 5, false);
    for (int i = 0; i < n; i++) cin >> a[i], f[a[i]] = true;

    for (int i = a[0] + 1; i <= k; i++)
    {
        for (int j = 0; j < n; j++)
        {
            if (i - a[j] >= 0 && !f[i - a[j]])
            {
                f[i] = true;
                break;
            }
        }
    }

    if (f[k]) cout << "First" << endl;
    else cout << "Second" << endl;
    return 0;
}



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

int main() {
  int n,count=0;;
  std::string s,zeroone;
  cin >> s;
  zeroone="01";
  n = s.length();
  for(int i=0;i<n;i++){
    if(s[i]==zeroone[i%2]){
      count++;
    }
  }
  if(count>n/2)count=n-count;
  cout << count << endl;
}


Measured memory_bytes: 512
#include <iostream>
#include <vector>
#include <algorithm>
#include <math.h>
#include <string>
using namespace std;

int main(){
  // 入力
  string S;
  cin >> S;
  
  string result = "ABC";
  if (S == "ABC") {
    result = "ARC";
  }
 
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <algorithm>
#include <assert.h>

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

using namespace std;

int main(int argc, char** argv) {
	long long N, Z, W;

	cin >> N >> Z >> W;

	vector<long long> a(N);

	REP(i, N) cin >> a[i];

	if (N == 1) {
		cout << abs(W - a[0]) << endl;
	}
	else {
		cout << max(abs(W - a[N - 1]), abs(a[N - 1] - a[N - 2])) << endl;
	}
}


Measured memory_bytes: 256
//
//  atcoder.cpp
//
//
///
#include <bits/stdc++.h>
#define REP(i, N) for(int i=0; i<N; i++)
using namespace std;
 
//#include "atcoder.hpp"
 
long long gcd(long long a, long long b) {
    if (a>b) swap(a,b);
    
    auto r = b % a;
    
    return (r ? gcd(r, a) : a);
}
 
int main() {
    long long N,  abcde[5];
    
    cin >> N >> abcde[0] >> abcde[1] >> abcde[2] >> abcde[3] >> abcde[4];
    long long least = 0LL, sum10 = 0LL;
 
    for (long long  i : abcde) {
        sum10 = ((N + (i - 1LL)) / i);
        least = max(least, sum10);
    };
    
     
    cout << least - 1LL + 5LL << endl;
 
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <queue>
#include <set>
#include <cmath>
#include <iomanip>
#include <tuple>
#include <map>
using namespace std;
typedef long long ll;
const int mod = 1e9 + 7;

int main() {
    int n,k; cin >> n >> k;
    vector<double> v(n+1),sum(n+1);
    for (int i = 1; i <= n; i++) {
        double tmp; cin >> tmp;
        v[i] = (double)(tmp + 1) / 2;
        sum[i] = v[i] + sum[i-1];
    }
    double ans = 0;
    for (int i = 1; i + k - 1 <= n; i++) {
        double res = sum[i+k-1] - sum[i-1];
        ans = max(ans,res);
    }
    cout << fixed << setprecision(12) << ans << "\n";
}

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

public class Main {
	public static void main(String[] args) throws IOException{
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
		int N = Integer.parseInt(in.readLine());
		
		int count = 0;
		HashMap<String, Integer> map = new HashMap<String, Integer>();
		
		for (int i = 0; i < N; i++) {
			String str = in.readLine();
			
			if (!map.containsKey(str)) {
				map.put(str, 1);
				count++;
			}
		}
		
		System.out.println(count);
	}
}


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

using namespace std;

#define ll long long
#define endl '\n'

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n, m;
    cin >> n >> m;
    string ans(n, '?');
    while (m--) {
        int s;
        char c;
        cin >> s >> c;
        if ((ans[s - 1] == '?') || (ans[s - 1] == c)) {
            ans[s - 1] = c;
        } else {
            cout << -1 << endl;
            return 0;
        }
    }
    if (ans[0] == '0' && n != 1) {
        cout << -1 << endl;
        return 0;
    } else if (ans[0] == '?') ans[0] = n == 1 ? '0' : '1';
    for (int i = 1; i < n; ++i) {
        if (ans[i] == '?') {
            ans[i] = '0';
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS
#include <cstdio>
#include <map>
//#include <cstdint>
//#include <fstream>

using namespace std;

int main()
{
    int N;
    if (scanf("%d", &N) < 1) return 0;

    map<int, int> mp;
    for (int i = 0; i < N; i++)
    {
        int a;
        if (scanf("%d", &a) < 1) return 0;
        mp[a]++;
    }

    int ans = 0;
    for(auto itr = mp.begin(); itr != mp.end(); itr++) {
        int key = itr->first;
        int val = itr->second;
        if (val < key) ans += val;
        else if (key < val) ans += val - key;
    }

    printf("%d\n", ans);
    return 0;
}


Measured memory_bytes: 4736
using System;

class quiz
{
    public int solve(int A, int B, int C, int D, int E, int F)
    {
        int ans = 0;

        ans += A + B + C + D;
        ans -= Math.Min(Math.Min(A, B), Math.Min(C, D));
        ans += Math.Max(E, F);

        return ans;
    }
}

class Example
{
    static void Main()
    {
        quiz ex = new quiz();

        Console.WriteLine(ex.solve(int.Parse(Console.ReadLine()),int.Parse(Console.ReadLine()),int.Parse(Console.ReadLine()),int.Parse(Console.ReadLine()),int.Parse(Console.ReadLine()),int.Parse(Console.ReadLine())));
    }
}


Measured memory_bytes: 15916
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<long long, long long>;
constexpr char ln =  '\n';
constexpr long long MOD = 1000000007LL;
constexpr long long INF = 1001001001LL;
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i=0;i<(n);i++)
#define rept(i, j, n) for(int i=(j); i<(n); i++)
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }


int main(){ 
  rep(i, 5){
    int a; cin >> a;
    if(a==0) {cout << i+1 << ln;
    break;}
  }
}


Measured memory_bytes: 3624
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;

int N;
int A[100000], B[100000];
int C[100000], D[100000];

typedef pair<int, int> P;
P pa[100000], pb[100000];
int bidx[100000];

const int INF = 1e+9;

bool used[100000];
int aidx[100000];

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    cin >> N;
    for(int i = 0; i < N; i++){
        cin >> A[i];
        pa[i] = P(A[i], i);
    }
    for(int i = 0; i < N; i++){
        cin >> B[i];
        pb[i] = P(B[i], i);
    }
    sort(pa, pa+N);
    sort(pb, pb+N);
    for(int i = 0; i < N; i++){
        aidx[pa[i].second] = i;
        if(pa[i].first > pb[i].first){
            cout << "No" << endl;
            return 0;
        }
    }
    for(int i = 0; i < N; i++){
        //cout << aidx[i] << ' ';
        auto ptr = lower_bound(pa, pa+N, P(pb[i].first, INF));
        ptr--;
        bidx[i] = ptr-pa;
    }
    //cout << endl;
    int cnt = 0;
    for(int i = 0; i < N; i++){
        int k = bidx[i];
        if(k > i) cnt++;
    }
    // for(int i = 0; i < N; i++){
    //     cout << pb[i].second << ' ' << bidx[pb[i].second] << ' ' << aidx[bidx[pb[i].second]] << endl;
    // }
    //cout << endl;
    if(cnt > 0){
        cout << "Yes" << endl;
        return 0;
    }else{
        for(int i = 0; i < N; i++){
            if(!used[i]){
                if(i != 0){
                    cout << "Yes" << endl;
                    return 0;
                }
                int idx = i;
                while(true){
                    //cout << idx << ' ';
                    if(used[idx]) break;
                    used[idx] = true;
                    idx = aidx[bidx[pb[idx].second]];
                }
                //cout << endl;
            }
        }
    }
    cout << "No" << endl;
}

Measured memory_bytes: 3456
#include "bits/stdc++.h"
using namespace std;
#define int long long
#define FOR(i, a, b) for(int i=(a);i<(b);i++)
#define RFOR(i, a, b) for(int i=(b-1);i>=(a);i--)
#define REP(i, n) for(int i=0; i<(n); i++)
#define RREP(i, n) for(int i=(n-1); i>=0; i--)
#define REP1(i, n) for(int i=1; i<=(n); i++)
#define RREP1(i, n) for(int i=(n); i>=1; i--)
#define ALL(a) (a).begin(),(a).end()
#define UNIQUE_SORT(l) sort(ALL(l)); l.erase(unique(ALL(l)), l.end());
#define CONTAIN(a, b) find(ALL(a), (b)) != (a).end()
#define out(...) printf(__VA_ARGS__)
#if DEBUG
#define debug(...) printf(__VA_ARGS__)
#else
#define debug(...) /* ... */
#endif
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(b<a){a=b;return true;}return false;}

void solve();
signed main()
{
#if DEBUG
    std::ifstream in("input.txt");
    std::cin.rdbuf(in.rdbuf());
#endif
    cin.tie(0);
    ios::sync_with_stdio(false);
    solve();
    return 0;
}

/*================================*/
#if DEBUG
#define SIZE 100
#else
#define SIZE 223450
#endif

int N,Q,K;
int A[SIZE];
struct Item{
    int u,v;
    int value() {
        return min(u,v);
    }
    bool operator < (const Item& that) const {
        return min(u,v) < min(that.u, that.v);
    }
};

void solve() {
    cin>>N;
    REP(i,N)cin>>A[i];
    sort(A,A+N);
    reverse(A, A+N);
    
    priority_queue<Item> que;
    int ans = A[0];
    que.push({A[0], A[1]});
    que.push({A[0], A[1]});
    FOR(i,2,N) {
        int v = A[i];
        auto item = que.top();
        que.pop();
        ans += item.value();
        que.push({v,item.u});
        que.push({v,item.v});
    }
    cout << ans << endl;
}


Measured memory_bytes: 8964
//101A
#include <bits/stdc++.h>
using namespace std;
int main(void){
    string ope= " ";
    int cnt=0;
    cin >> ope;
    for (int i=0; i<4; i++){
        if (ope[i]=='+'){
            cnt +=1;
        }else if(ope[i]=='-'){
            cnt -=1;
        }
    }
    cout << cnt;
}

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

int ri() {
	int n;
	scanf("%d", &n);
	return n;
}

template<int mod>
struct ModInt{
	int x;
	ModInt () : x(0) {}
	ModInt (int64_t x) : x(x >= 0 ? x % mod : (mod - -x % mod) % mod) {}
	ModInt &operator += (const ModInt &p){
		if ((x += p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt &operator -= (const ModInt &p) {
		if ((x += mod - p.x) >= mod) x -= mod;
		return *this;
	}
	ModInt &operator *= (const ModInt &p) {
		x = (int64_t) x * p.x % mod;
		return *this;
	}
	ModInt &operator /= (const ModInt &p) {
		*this *= p.inverse();
		return *this;
	}
	ModInt &operator ^= (int64_t p) {
		ModInt res = 1;
		for (; p; p >>= 1) {
			if (p & 1) res *= *this;
			*this *= *this;
		}
		return *this = res;
	}
	ModInt operator - () const { return ModInt(-x); }
	ModInt operator + (const ModInt &p) const { return ModInt(*this) += p; }
	ModInt operator - (const ModInt &p) const { return ModInt(*this) -= p; }
	ModInt operator * (const ModInt &p) const { return ModInt(*this) *= p; }
	ModInt operator / (const ModInt &p) const { return ModInt(*this) /= p; }
	ModInt operator ^ (int64_t p) const { return ModInt(*this) ^= p; }
	bool operator == (const ModInt &p) const { return x == p.x; }
	bool operator != (const ModInt &p) const { return x != p.x; }
	explicit operator int() const { return x; }
	ModInt &operator = (const int p) { x = p; return *this;}
	ModInt inverse() const {
		int a = x, b = mod, u = 1, v = 0, t;
		while (b > 0) {
			t = a / b;
			a -= t * b;
			std::swap(a, b);
			u -= t * v;
			std::swap(u, v);
		}
		return ModInt(u);
	}
	friend std::ostream & operator << (std::ostream &stream, const ModInt<mod> &p) {
		return stream << p.x;
	}
	friend std::istream & operator >> (std::istream &stream, ModInt<mod> &a) {
		int64_t x;
		stream >> x;
		a = ModInt<mod>(x);
		return stream;
	}
};

template<int mod> struct MComb {
	using mint = ModInt<mod>;
	std::vector<mint> fact;
	std::vector<mint> inv;
	MComb (int n) { // O(n + log(mod))
		fact = std::vector<mint>(n + 1, 1);
		for (int i = 1; i <= n; i++) fact[i] = fact[i - 1] * mint(i);
		inv.resize(n + 1);
		inv[n] = fact[n] ^ (mod - 2);
		for (int i = n; i--; ) inv[i] = inv[i + 1] * mint(i + 1);
	}
	mint ncr(int n, int r) {
		return fact[n] * inv[r] * inv[n - r];
	}
	mint npr(int n, int r) {
		return fact[n] * inv[n - r];
	}
	mint nhr(int n, int r) {
		assert(n + r - 1 < (int) fact.size());
		return ncr(n + r - 1, r);
	}
};

typedef ModInt<998244353> mint;

int main() {
	int a = ri(), b = ri();
	int c = ri(), d = ri();
	mint dp[c + 1][d + 1];
	dp[a][b] = 1;
	for (int i = a; i < c; i++) {
		mint added = 0;
		for (int j = b; j <= d; j++) {
			dp[i + 1][j] += added;
			added *= i;
			if (dp[i][j] == 0) continue;
			dp[i + 1][j] += dp[i][j] * j;
			added += dp[i][j] * i;
		}
	}
	mint res = 0;
	for (int i = 0; i <= d; i++) res += dp[c][i] * (mint(c) ^ (d - i));
	std::cout << res << std::endl;
	return 0;
}


Measured memory_bytes: 38832
import sys
sys.setrecursionlimit(int(1e6))

S = input()

lut = {'SUN': 7, 'MON': 6, 'TUE': 5, 'WED': 4, 'THU': 3, 'FRI': 2,'SAT': 1}
ans = lut[S]
print(ans)


Measured memory_bytes: 2940
main = do
    x <- readInt <$> getLine
    let max = max' 0 x
        candidates = concat [[n, - n] | n <- [0..max]]
        answer = head [(a, b) | a <- candidates, b <- candidates, a ^ 5 - b ^ 5 == x]
    putStr $ show (fst answer) ++ " " ++ show (snd answer)

readInt :: String -> Integer
readInt = read

max' n m 
    | n ^ 5 - (n - 1) ^ 5 <= m = max' (n + 1) m
    | otherwise     = n

Measured memory_bytes: 5008
def main():
    S = input().split('/')

    if int(S[0]) < 2019:
        print('Heisei')
        return
    elif int(S[0]) == 2019:
        if int(S[1]) <= 4:
            print('Heisei')
            return
        else:
            print('TBD')
            return
    else:
        print('TBD')
        return


if __name__ == '__main__':
    main()


Measured memory_bytes: 2940
#include<bits/stdc++.h>
#define ll long long int
using namespace std;
   ll a[100000];
    ll b[100000];
    ll c[100000];
    ll n;
    ll dp[100000][4];
ll solve(ll idx,ll prev)
{
    if(idx==n)
    {
        dp[idx][prev]=0;
        return 0;
    }
    if(dp[idx][prev]!=-1)
    {
        return dp[idx][prev];
    }
    ll ans=0;
    if(prev==0)
    {
        ans=max(b[idx]+solve(idx+1,1),c[idx]+solve(idx+1,2));
    }
    if(prev==1)
    {
        ans=max(a[idx]+solve(idx+1,0),c[idx]+solve(idx+1,2));
    }
    if(prev==2)
    {
        ans=max(a[idx]+solve(idx+1,0),b[idx]+solve(idx+1,1));
    }
    if(prev==3)
    {
        ans=max(a[idx]+solve(idx+1,0),max(b[idx]+solve(idx+1,1),c[idx]+solve(idx+1,2)));
    }
    dp[idx][prev]=ans;
    return dp[idx][prev];
}

int main()
{
    memset(dp,-1,sizeof dp);

    cin>>n;
    for(ll i=0;i<n;i++)
    {
        cin>>a[i]>>b[i]>>c[i];
    }
    // 0-->a   1-->b   2-->c  3-->all
    cout<<solve(0,3);

}

Measured memory_bytes: 18368
#include <string>
#include <vector>
#include <sstream>
#include <iostream>
#include <algorithm>
#include <map>
#include <list>
#include <set>
#include <numeric>
#include <queue>
#include <stack>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <climits>
#include <cfloat>
#include <ctime>
#include <complex>
#include <cassert>
#include <array>
#include <bitset> 
#include <unordered_map>

using namespace std;
typedef long long LL;
typedef pair<int,int> P;

const LL M=998244353;
const int L=1e6;
int D[L];
int main() {
	int N;
	cin >> N;
	for(int i=0;i<N;i++){
		cin >> D[i];
	}
	if(D[0]!=0){
		cout << 0 << endl;
		return 0;
	}
	sort(D,D+N);
	if(N==1){
		cout << 1 << endl;
		return 0;
	}
	if(D[1]==0){
		cout << 0 << endl;
		return 0;
	}
	LL ret=1;
	LL p=1;
	for(int i=1;i<N;){
		if (D[i-1]+1!=D[i]){
			cout << 0 << endl;
			return 0;
		}
		int j=i;
		LL c=0;
		while(j<N&&D[j]==D[i]){
			ret*=p;
			ret%=M;
			c++;
			j++;
		}
		p=c;
		i=j;
	}
	cout << ret << endl;

	return 0;
}



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

// ---------------------------template starts here-------------------------- 

#define int long long int
#define pb push_back
#define MAX INT_MAX
#define endl "\n"
#define precise std::cout << std::fixed;std::cout << std::setprecision(6); 
#define zerobits(x) __builtin_ctzll(z)
#define F first
#define S second  
#define mp make_pair
#define MIN INT_MIN
#define MOD 1000000007
#define FO ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
using namespace std;

set <int> s;
bool ar[100001];
void seive() {
    ar[0] = ar[1] = true;

    for(int p=2; p*p<=100001; p++) {
        if(ar[p] == false) {
            for(int i=p*p;i<=100001;i+=p)
                ar[i] = true ;
        }
    }

    for(int p=2;p<=100001;p++) {
        if(ar[p] == false)
            s.insert(p);
    }
}

bool is_palindrome(string str) {
    int len = str.length();
    for(int i=0;i<=len/2;i++) {
        if(str[i] != str[len-1-i])
            return false;
    }
    return true;
}

int binexpo(int x, int y, int p) {    
    int res = 1;     // Initialize result  
    x = x % p; // Update x if it is more than or  
                // equal to p  

    while (y > 0)  {  
        // If y is odd, multiply x with result  
        if (y & 1)  
            res = (res*x) % p;  
  
        // y must be even now  
        y = y>>1; // y = y/2  
        x = (x*x) % p;  
    }  
    return res;
}
// --------------------------template ends here------------------------------

void solve() {
    int len;
    cin >> len;

    string str;
    cin >> str;

    int r = 0, g = 0, b = 0;

    for(int i=0;i<len;i++) {
        if(str[i] == 'R')
            r++;
        else if(str[i] == 'G')
            g++;
        else
            b++;
    }    

    int ans = r*g*b;

    int minus = 0;

    for(int i=0;i<len;i++) {
        for(int j=i+1;j<len;j++) {
            int k = 2*j - i;
            if(str[i] != str[j] && str[j] != str[k] && str[k] != str[i] && k < len)
                minus++;
        }
    }

    cout << ans - minus << endl;
    return;
}

int32_t main() {
    FO;
    solve();
    return 0;
}

Measured memory_bytes: 3624
#include<stdio.h>
#include<stdlib.h>
#include<string.h>

int main()
{
    char str[102];
    int x;

    scanf("%d\n%s",&x,str);
    
    if(x<strlen(str))
    {
        for(int i=0;i<x;i++)
        {
            printf("%c",str[i]);
        }
        printf("...");
    }else
    {
        printf("%s",str);
    }
    

}

Measured memory_bytes: 1728
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using Int = int;//long long;

signed main()
{
    int n; cin>>n;
    string c; cin>>c;
    
    int numRed=0;
    for (int i=0;i<n;++i) if (c[i]=='R') ++numRed;
    int numRedInLeft=0;
    for (int i=0;i<numRed;++i) if(c[i]=='R') ++numRedInLeft;

//printf("num R = %d, left = %d\n", numRed, numRedInLeft);

    cout << numRed - numRedInLeft << endl;

    return 0;
}


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

int W, H;
vector<vector<int>> field;

void dfs(int h, int w) {
    field[h][w] = 0; // 探索済みにする

    // 場外、探索済みは飛ばす
    for (int dx = -1; dx <= 1; dx++) {
        for (int dy = -1; dy <= 1; dy++) {
            int nh = h + dx, nw = w + dy;
            if (nh < 0 || H <= nh || nw < 0 || W <= nw)
                continue;
            if (field[nh][nw] == 0)
                continue;

            // 再帰的に探索
            dfs(nh, nw);
        }
    }
}

int main() {

    while (true) {
        // 入力
        cin >> W >> H;
        if (W == 0 && H == 0)
            break;

        field.assign(H, vector<int>(W, 0)); // 初期化

        for (int h = 0; h < H; h++) {
            for (int w = 0; w < W; w++) {
                cin >> field[h][w];
            }
        }

        // 探索と島のカウント
        int count = 0;
        for (int h = 0; h < H; h++) {
            for (int w = 0; w < W; w++) {
                if (field[h][w] == 0) {
                    continue; // 海か探索済みなら飛ばす
                }

                dfs(h, w);
                count++;
            }
        }

        // 出力
        cout << count << endl;
    }
}



Measured memory_bytes: 3296
s = raw_input()

a = s.find('+')
ok = 0
if a == -1:
	a = s.find('-')
	ok = 1

n1 = int(s[:(a - 1)])
n2 = int(s[(a + 1):])

if ok == 0:
	print n1 + n2
else:
	print n1 - n2

Measured memory_bytes: 2696
#include <bits/stdc++.h>
using namespace std;
int main(){
    string S;
    cin>>S;
    int count=0;
    int sub=0;
    for(int i=0;i<S.size();i++){
        if(S[i]=='A'||S[i]=='T'||S[i]=='C'||S[i]=='G'){count++;}
        else{sub=max(sub,count);count=0;}
    }
    sub=max(sub,count);
    cout<<sub<<endl;
}

Measured memory_bytes: 256
import java.io.*;

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
    int n = Integer.parseInt(br.readLine());
    String[] data = br.readLine().split(" ");
    int[] num = new int[100000];
    for (int i=0; i<n; i++){
      num[Integer.parseInt(data[i])]++;
    }
    int temp = 0;
    int max = 0;
    
    for (int i=0; i<=99997; i++){
      temp = num[i] + num[i+1] + num[i+2];
      if(temp>max) {
        max = temp;
      }
    }
    System.out.println(max);
  }
}

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

using namespace std;

int main(){

  int n; cin >> n;

  string s = to_string(n);

  int h = 0;

  int m = s.size();

  for(int i = 0; i < m; i++){

    int t = s[i] - '0';

    h += t;

  }

  string ans;

  if(n % h == 0){ans = "Yes";}

  else ans = "No";

  cout << ans << endl;

}



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

int main(){
    char txt[3];
    scanf("%s",txt);
    if(strchr(txt, (int)'A') !=NULL && strchr(txt, (int)'B') !=NULL)
    {
        printf("Yes");
    }else{
        printf("No");
    }
    return 0;
}

Measured memory_bytes: 128
#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <math.h>
#include <vector>
#include <string>
#include <sstream>
#include <numeric>
#include <set>
#include <map>
//#include <bits/stdc++.h>

#define rep(i, j) for(int i = 0; i < j; i++)
#define all(i) i.begin(), i.end()
#define ll long long
#define bl bool
#define nn printf("\n");
#define mod 1000000007

using namespace std;

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

	int N, A, B, C, X;
	while (cin >> N >> A >> B >> C >> X)
	{
		if (N == 0) { break; }
		vector<int> dat(N + 2, 0);
		rep(i, N) { cin >> dat[i]; }
		int i = 0, j = 0;
		while (1)
		{	
			if (j > 10000) { printf("-1\n"); break; }
			else if (X == dat[i])
			{
				if (i == N - 1) { printf("%d\n", j); break; }
				i++;
			}
			j++;
			X = (A * X + B) % C;
		}
	}
	return 0;
}

Measured memory_bytes: 3140
//C-Snack

#include <stdio.h>



int main(void) {
    long int a;
    long int b;
    scanf("%ld%ld", &a, &b);
    //printf("%d%d\n", a, b);
    long int i;
    for (i = 1;i <= b + 1;i++) {
        if ((a * i) % b == 0) {
            printf("%ld\n", a * i);
            break;
          }

      }
    return 0;

  }


Measured memory_bytes: 1732
#include<iostream>
#include<cstdio>
#include<string>
#include<cstring>
#include<cmath>
#include<algorithm>
#define N 50
#define M 100010
#define mem(a,b) memset(a,b,sizeof(a))
using namespace std;
 int b[N][M];
int main(){
    ios::sync_with_stdio( false );
    int n,m;
     int s,t,c;
     int ans,maxn;
    cin>>n;
    cin>>m;
   for (int i=1;i<=n;i++) {
        cin>>s>>t>>c;
        for (int j=s-1;j<t;j++)
            b[c][j]=1;
    }
      maxn=0;
    for (int i=1;i<=100000;i++){
        ans=0;
        for (int j=1;j<=m;j++)
           if (b[j][i])
            ans++;
        maxn=max(maxn,ans);
    }
    cout << maxn << endl;
    return 0;
}


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

int main() {
    int n, m;
    cin >> n >> m;
    char a[n][m];
    for(int i=0;i<n;i++){
        for(int j=0;j<m;j++)
            cin >> a[i][j];
    }
    int dp[n][m];
    bool fg = true;
    for(int i=0;i<n;i++){
        if(fg && a[i][0] == '.')
            dp[i][0] = 1;
        else{
            fg = false;
            dp[i][0] = 0;
        }
    }
    fg = true;
    for(int j=0;j<m;j++){
        if(fg && a[0][j] == '.')
            dp[0][j] = 1;
        else
        {
            fg = false;
            dp[0][j] = 0;
        }
    }
    for(int i=1;i<n;i++){
        for(int j=1;j<m;j++){
            if(a[i][j] == '#')
                dp[i][j] = 0;
            else
                dp[i][j] = (dp[i][j-1]  + dp[i-1][j]) % 1000000007;
        }
    }
    
    // for(int i=0;i<n;i++){
    //     for(int j=0;j<m;j++)
    //         cout << dp[i][j] << " ";
    //     cout << endl;
    // }
    cout << dp[n-1][m-1];
    
	return 0;
}


Measured memory_bytes: 8484
#pragma gcc optimize("Ofast")
#include <bits/stdc++.h>

using namespace std;
using ll = long long;

#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define REP(i, n) FOR(i, 0, n)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V)) //小さい方からソート
#define REV(V) reverse(ALL(V)) //リバース
#define RSORT(V) SORT(V);REV(V) //大きい方からソート
#define NPN(V) next_permutation(ALL(V)) //順列
#define pb(n) push_back(n)
#define endl '\n'
#define Endl '\n'
#define DUMP(x)  cout << #x << " = " << (x) << endl
#define YES(n) cout << ((n) ? "YES" : "NO"  ) << endl
#define Yes(n) cout << ((n) ? "Yes" : "No"  ) << endl
#define Yay(n) cout << ((n) ? "Yay!" : ":(") << endl
#define RAPID cin.tie(0);ios::sync_with_stdio(false)
#define IN(n) cin >> n
#define IN2(a,b) cin >> a >> b
#define IN3(a,b,c) cin >> a >> b >> c 
#define VIN(V) for(int i = 0; i < (V).size(); i++) {cin >> (V).at(i);}
#define OUT(n) cout << n << endl
#define VOUT(V) REP(i, (V).size()) {cout << (V)[i] << endl;}
#define VOUT2(V) REP(i, (V).size()) {cout << (V)[i] << " ";} cout<<endl;

// 型マクロ定義
#define int long long
#define P pair<ll,ll>
#define Vi vector<ll>
#define Vd vector<double>
#define Vs vector<string>
#define Vc vector<char>
#define M map<ll,ll>
#define S set<ll>
#define PQ priority_queue<ll>
#define PQG priority_queue<ll,V,greater<ll>
//

const int MOD = 1000000007;
const int INF = 1061109567;
const double EPS = 1e-10;
const double PI  = acos(-1.0);

int gcd(int a,int b){return b?gcd(b,a%b):a;} //最小公倍数

// デフォルト変数定義
int n,m,a,b,c,x,y,z;
double d,e,f;
string s,t;
//

signed main() {
  RAPID;
  IN(s);
  REP(i,s.size()){
    if(s[i]=='1') cout << 9;
    else if(s[i]=='9') cout << 1;
    else cout << s[i];
  }
  cout << endl;
}

Measured memory_bytes: 256
main :: IO ()
main = do
    str <- getLine
    let inputs = [read word :: Int | word <- words str]
    let w = head inputs
    let h = inputs !! 1
    let x = inputs !! 2
    let y = inputs !! 3
    let r = inputs !! 4

    putStrLn $ ans w h x y r

ans :: Int -> Int -> Int -> Int -> Int -> String
ans w h x y r
    | 0 <= x - r && 0 <= y - r && x + r <= w && y + r <= h = "Yes"
    | otherwise = "No"

Measured memory_bytes: 3564
#include <bits/stdc++.h>
#define INF 2e9
#define MOD 1000000007
#define MOD9 998244353
#define intMAX 51000;
#define PI 3.14159265359
using namespace std;
typedef long long llong;
typedef long double ldouble;

using Graph = vector<vector<int>>;

int main(){
	int L, R, d;
	cin >> L >> R >> d;
	int count = 0;
	for(int i=L; i<=R; ++i){
		if(i%d==0) ++count;
	}
	cout << count << endl;
}

Measured memory_bytes: 3632
#define  _CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <algorithm>
#include <utility>
#include <functional>
#include <cstring>
#include <queue>
#include <stack>
#include <math.h>
#include <iterator>
#include <vector>
#include <string>
#include <set>
#include <math.h>
#include <iostream>
#include <random>
#include<map>
#include <iomanip>
#include <time.h>
#include <stdlib.h>
#include <list>
#include <typeinfo>
#include <list>
#include <set>
#include <cassert>
#include<fstream>
#include <unordered_map>
#include <cstdlib>
#include <complex>
#include <cctype>
using namespace std;
typedef string::const_iterator State;
#define Ma_PI 3.141592653589793
#define eps 0.00000001
#define LONG_INF 1e18
#define GOLD 1.61803398874989484820458
#define MAX_MOD 1000000007
#define MOD 998244353
#define seg_size 262144
#define REP(i,n) for(long long i = 0;i < n;++i)
vector<int> vertexs[200000];
long long dp[200000][301][2] = {};
long long pre_dp[701][2] = {};
int cnter[200000];
int dfs(int now, int back) {
	cnter[now] = 1;
	for (int i = 0; i < vertexs[now].size(); ++i) {
		if (vertexs[now][i] == back) continue;
		cnter[now] += dfs(vertexs[now][i], now);
	}
	cnter[now] = min(cnter[now], 300);
	REP(i, 601) {
		REP(q, 2) {
			pre_dp[i][q] = 0;
		}
	}
	pre_dp[0][0] = 1;
	pre_dp[0][1] = 1;
	int now_max = 0;
	for (int i = 0; i < vertexs[now].size(); ++i) {
		if (vertexs[now][i] == back) continue;
		for (int q = now_max; q >= 0;--q) {
			long long geko_a = pre_dp[q][0];
			long long geko_b = pre_dp[q][1];
			pre_dp[q][0] = 0;
			pre_dp[q][1] = 0;
			for (int j = 0; j <= cnter[vertexs[now][i]]; ++j) {
				pre_dp[q + j][0] += (geko_a * dp[vertexs[now][i]][j][0])%MOD;
				pre_dp[q + j][0] %= MOD;
				pre_dp[q + j + 1][0] += (geko_a * dp[vertexs[now][i]][j][1])%MOD;
				pre_dp[q + j + 1][0] %= MOD;
				pre_dp[q + j][1] += (geko_b * dp[vertexs[now][i]][j][1])%MOD;
				pre_dp[q + j][1] %= MOD;
				pre_dp[q + j+1][1] += (geko_b * dp[vertexs[now][i]][j][1]) % MOD;
				pre_dp[q + j+1][1] %= MOD;
				pre_dp[q + j][1] += (geko_b * dp[vertexs[now][i]][j][0])%MOD;
				pre_dp[q + j][1] %= MOD;
			}
		}
		now_max += cnter[vertexs[now][i]];
		now_max = min(now_max, 300);
	}
	REP(i, 301) {
		REP(q, 2) {
			dp[now][i][q] = pre_dp[i][q];
		}
	}
	return cnter[now];
}
int main(){
	long long n, k;
	cin >> n >> k;
	REP(i, n-1) {
		int a, b;
		cin >> a >> b;
		a--;
		b--;
		vertexs[a].push_back(b);
		vertexs[b].push_back(a);
	}
	dfs(0, -1);
	cout << (dp[0][k][0] + dp[0][k - 1][1]) % MOD << endl;
	return 0;
}


Measured memory_bytes: 490844