akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;

typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef pair<ll,ll> pll;
typedef vector<bool> vb;
const ll oo = 0x3f3f3f3f3f3f3f3f;
const double eps = 1e-9;
#define sz(c) ll((c).size())
#define all(c) begin(c), end(c)
#define FOR(i,a,b) for (ll i = (a); i < (b); i++)
#define FORD(i,a,b) for (ll i = (b)-1; i >= (a); i--)
#define mp make_pair
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define TR(X) ({ if(1) cerr << "TR: " << (#X) << " = " << (X) << endl; })

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(NULL);
	
	ll m, d;
	cin >> m >> d;

	ll res = 0;
	FOR(x,2,10) FOR(y,2,10) if (10*x + y <= d) {
		if (x*y <= m) res++;
	}
	cout << res << endl;

}



Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <climits>
#include <algorithm>
#include <cmath>
#include <map>
#include <set>
#include <string>
#include <bitset>
#include <utility>
#include <numeric>
#include <queue>
#include <stack>

using ll = long long;
using namespace std;

constexpr int MOD = 1e9 + 7;
constexpr ll MOD_LL = ll(1e9 + 7);

template<typename T>
T mypow(T a, T p) {
	T ret = 1;
	while( p ) {
		if( p & 1 ) {
			ret *= a;
		}
		
		a *= a;
		p >>= 1;
	}
	
	return ret;
}

int main(void) {
	ll n, p;
	cin >> n >> p;
	
	vector<int> a(n);
	bool odd = false;
	for(int i = 0; i < n; ++i) {
		cin >> a[i];
		
		if( a[i] % 2 == 1 ) odd = true;
	}
	
	if( odd ) {
		cout << mypow(2LL, n - 1LL) << endl;
	} else {
		if( p == 0 ) {
			cout << mypow(2LL, n) << endl;
		} else {
			cout << 0 << endl;
		}
	} 
	
	return 0;
}


Measured memory_bytes: 3564
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<queue>
#include<map>
#include<math.h>
#include<iomanip>
#include<set>
#include<numeric>
#include<cstring>
#include<cstdio>
#include<functional>
#include<bitset>
#include<limits.h>
#include<cassert>
#include<iterator>
#include<complex>
#include<stack>
using namespace std;
typedef  long long int lint;
typedef pair<int, int> P;
typedef pair<lint, lint> LLP;
typedef pair<char, char>CP;
#define rep(i, n) for (int i = 0; i < n; i++)
#define repr(i, n) for (int i = n; i >= 0; i--)
#define sort(v) sort((v).begin(), (v).end())
#define reverse(v) reverse((v).begin(), (v).end())
/*
vector<char>al(26);
al = {'a','b','c','d','e','f','g','h','i','j','k','l','m','n','o','p','q','r','s','t','u','v','w','x','y','z'};
vector<char>AL(26);
AL = {'A','B','C','D','E','F','G','H','I','J','K','L','M','N','O','P','Q','R','S','T','U','V','W','X','Y','Z'};
*/

int main() {
	int N;
	cin >> N;
	vector<int>A(N);
	rep(i, N) {
		cin >> A[i];
	}
	int ans = 0;
	rep(i, N) {
		while (1) {
			if (A[i] % 2 != 0) {
				break;
			}
			A[i] /= 2;
			ans++;
		}
	}
	cout << ans << endl;
}



Measured memory_bytes: 256
#include<stdio.h>

int main(){

int N;
scanf("%d",&N);
int f[N];
for (int i = 1; i <= N; i++){f[i]=0;}


for (int x = 1; x <= N; x++){
  for (int y = 1; y <= N; y++){
    for (int z = 1; z <= N; z++)
    {
      int n = x*x+y*y+z*z+x*y+y*z+z*x;
      
      if (n>N){
        break;
      }else if(n<=N){
        f[n]++;
      }
    }
}

}



for (int i = 1; i <= N; i++){
    printf("%d\n",f[i]);
}

return 0;

}

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

int main() {
  ios::sync_with_stdio(false); 
  cin.tie(0);
  int n;
  cin >> n;
  function<bool(int, int, int, int)> ok = [&](int x, int y, int z, int n) {
    return z > 0 && x * x + y * y + z * z + x * y + y * z + z * x == n;
  };
  for (int i = 1; i <= n; i++) {
    int res = 0;
    for (int x = 1; x * x <= i; x++) {
      for (int y = 1; y * y <= i; y++) {
        // z ^ 2 + yz + zx = m
        // z ^ 2 + (y + x)z = m
        // z ^ 2 + (y + x)z - m;
        int c = i - x * x - y * y - x * y;
        int b = x + y;
        int z1 = (-b + sqrt(b * b - 4 * -c)) / 2;
        int z2 = (-b - sqrt(b * b - 4 * -c)) / 2;
        res += ok(x, y, z1, i);
        res += z1 != z2 && ok(x, y, z2, i);
      }
    }
    cout << res << '\n';
  }
  return 0;
}

Measured memory_bytes: 3636
#include<iostream>
#include<algorithm>
using lint=long long;
using namespace std;

int main()
{
	string str;
	string s="keyence";
	int k;
	bool ans=false;
	
	cin >> str;
	k=str.size()-s.size();
	for(int i=0;i<s.size()+1;i++)
	{
		string tmp="";
		for(int j=0;j<i;j++)tmp+=str[j];
		for(int j=i+k;j<str.size();j++)tmp+=str[j];
		if(tmp==s)
		{
			cout << "YES" << endl;
			return 0;
		}
	}
	cout << "NO" << endl;
	return 0;
}



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

int main(){
	int a,b,c;
	int ans;
	
	string cunning="776755555555";
	
	for(int i=0;i<104;i++){
		cin>>a>>b;c=a+b;
		//-----test-----
		if(i<cunning.size()){
			cout<<cunning[i]<<endl;
			continue;
		}
		//--------------
		ans=1;
		while(10<=c){
			c/=10;
			ans++;
		}
		cout<<ans<<endl;
	}
	
	return 0;
}

Measured memory_bytes: 1204
#include <bits/stdc++.h>
#pragma GCC optimize("Ofast")
#define int long long
#define mod (int)(1e9+7)
#define inf (int)(3e18)
#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,n) for(int i=1;i<n;i++)
#define P std::pair<int,int>
#define PiP std::pair<int,std::pair<int,int>>
#define all(v) v.begin(),v.end()
#define mkp std::make_pair
#define prique(T) std::priority_queue<T,vector<T>,greater<T>>
using namespace std;
template<class T> inline void chmax(T& a, T b) { a = std::max(a, b); }
template<class T> inline void chmin(T& a, T b) { a = std::min(a, b); }

bool prime(int x) {
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0)return false;
	}
	return x != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= i; res %= mod;
	}
	return res;
}
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y > 0) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
int get_rand(int MIN, int MAX) {
	std::random_device rnd;
	std::mt19937 mt32(rnd());
	std::uniform_int_distribution<int>engine(MIN, MAX);
	return engine(mt32);
}
/*--------Library Zone!--------*/



signed main() {
	int n;
	string s;
	cin >> n >> s;
	rep(i, s.size()) {
		s[i] = (char)((s[i] - 'A' + n) % 26 + 'A');
	}
	cout << s << endl;
}


Measured memory_bytes: 256
package main

import (
	"fmt"
)

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

	switch n[len(n)-1] {
	case '2', '4', '5', '7', '9':
		fmt.Println("hon")
	case '0', '1', '6', '8':
		fmt.Println("pon")
	case '3':
		fmt.Println("bon")
	}
}


Measured memory_bytes: 1772
#include <bits/stdc++.h>
#define ll long long 
using namespace std;

int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t = 1; 
    for(int T = 0; T < t ; T++){
        ll n, m;
        cin >> n >> m;
        ll h[n];
        for(int i = 0; i < n; i++)
            cin >> h[i];
        vector<ll> v[n];
        ll a, b;
        for(int i = 0; i < m; i++){
            cin >> a >> b;
            v[a - 1].push_back(b - 1);
            v[b - 1].push_back(a - 1);
        }
        ll k = 0;
        for(int i = 0; i < n; i++){
            bool ans  = false;
            for(int j = 0; j < v[i].size(); j++){
                if(h[v[i][j]] >= h[i])
                    ans = true;
            }
            if(ans == false){
                k++;
                //cout<<i + 1<<endl;
            }
        }
        std::cout << k << std::endl;
    }
    return 0;
}

Measured memory_bytes: 10276
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
 
int main(){
    int H,W,N;
    cin >> W >> H >> N;
    int x1=0,x2=W,y1=0,y2=H;
    for(int i=0;i<N;i++){
        int x,y,a;
        cin >> x >> y >> a;
        if(a==1) x1=max(x1,x);
        if(a==2) x2=min(x2,x);
        if(a==3) y1=max(y1,y);
        if(a==4) y2=min(y2,y);
    }
    if((x2-x1)<=0||(y2-y1)<=0) cout << "0\n";
    else cout << (x2-x1)*(y2-y1) << endl;
    return 0;
}

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

int main() {
  const int H_MAX = 10000;

  int N;
  cin >> N;

  vector<int> h(N);
  rep(i, N) cin >> h.at(i);

  auto cost = [&h](int x, int y) { return abs(h.at(x) - h.at(y)); };

  vector<int> dp(N, H_MAX);
  dp.at(0) = 0;
  dp.at(1) = cost(0, 1);

  for (int i = 2; i < N; i++) {
    int a = dp.at(i - 2) + cost(i - 2, i);
    int b = dp.at(i - 1) + cost(i - 1, i);
    dp.at(i) = min(a, b);
  }

  cout << dp.at(N - 1) << endl;
  return 0;
}


Measured memory_bytes: 1024
package main

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

var dbg = false
var MOD int64 = 998244353
var amax int64 = 300

// returns (b^n) % m
func modpow(b, n, m int64) int64 {
	if n == 0 {
		return 1
	} else if n%2 == 0 {
		return modpow(b*b%m, n/2, m) % m
	} else {
		return b * modpow(b, n-1, m) % m
	}
}

type myfunct func(int64, int64) int64

func memoize(x int64, y int64, f myfunct) myfunct {
	cache := make([][]int64, x)
	for i := range cache {
		cache[i] = make([]int64, y)
		for j := range cache[i] {
			cache[i][j] = -1
		}
	}
	return func(i, s int64) int64 {
		if s < 0 {
			return 0
		}
		if i < 0 || i > x {
			panic(fmt.Errorf("i out of range %d", i))
		}
		if s < 0 || s > y {
			panic(fmt.Errorf("s out of range %d", s))
		}
		if cache[i][s] != -1 {
			return cache[i][s]
		}
		r := f(i, s)
		cache[i][s] = r
		return r
	}
}

func getY(N, S int64, a []int64) int64 {
	if S%2 == 1 {
		return 0
	}
	var combh myfunct
	combh = memoize(N+1, S+amax, func(i, s int64) int64 {
		if i == 0 {
			if s == 0 {
				return 1
			} else {
				return 0
			}
		}
		r := combh(i-1, s-a[i-1])
		r += combh(i-1, s)
		return r % MOD
	})
	return combh(N, S/2)
}

func getX(N, S int64, a []int64) int64 {
	var combgeh myfunct
	combgeh = memoize(N+1, S+amax, func(i, s int64) int64 {
		if i == 0 {
			if s == 0 {
				return 1
			} else {
				return 0
			}
		}
		r := combgeh(i-1, s-a[i-1])
		r = r + (combgeh(i-1, s) * 2)
		return r % MOD
	})
	var sum int64 = 0
	start := int64(math.Ceil(float64(S) / 2.))
	for s := start; s <= S; s++ {
		c := combgeh(N, s)
		sum += c
		sum %= MOD
	}
	return sum
}

func main() {
	sc := NewScanner()
	N := sc.NextInt64()
	a := sc.NextInt64Array(int(N))
	var S int64
	for _, v := range a {
		S += v
	}
	X := getX(N, S, a)
	Y := getY(N, S, a)
	total := modpow(3, N, MOD)
	if dbg {
		fmt.Println(total, X, Y)
	}
	ans := (total - 3*X + 3*Y)
	for ans < 0 {
		ans += MOD
	}
	ans %= MOD
	fmt.Println(ans)
}

type Scanner struct {
	sc *bufio.Scanner
}

func NewScanner() *Scanner {
	sc := bufio.NewScanner(os.Stdin)
	sc.Split(bufio.ScanWords)
	return &Scanner{sc: sc}
}

func (r *Scanner) SetBufferSize(size int) {
	buf := make([]byte, size)
	r.sc.Buffer(buf, size)
}

func (r *Scanner) NextToken() string {
	r.sc.Scan()
	return r.sc.Text()
}

func (r *Scanner) NextInt64() int64 {
	n, e := strconv.ParseInt(r.NextToken(), 10, 64)
	if e != nil {
		panic(e)
	}
	return n
}

func (r *Scanner) NextInt() int {
	n, e := strconv.ParseInt(r.NextToken(), 10, 32)
	if e != nil {
		panic(e)
	}
	return int(n)
}

func (r *Scanner) NextInt64Array(size int) []int64 {
	a := make([]int64, size)
	for i := 0; i < size; i++ {
		a[i] = r.NextInt64()
	}
	return a
}

func (r *Scanner) NextIntArray(size int) []int {
	a := make([]int, size)
	for i := 0; i < size; i++ {
		a[i] = r.NextInt()
	}
	return a
}


Measured memory_bytes: 385280
#include<bits/stdc++.h>
#define LL long long
#define mxn 5000*5000+10
using namespace std;
int n,sl,fh,a[4],b[4];
LL M,dp[mxn];
int rd()
{
	sl=0;fh=1;
	char ch=getchar();
	while(ch<'0'||'9'<ch) {if(ch=='-') fh=-1; ch=getchar();}
	while('0'<=ch&&ch<='9') sl=sl*10+ch-'0',ch=getchar();
	return sl*fh;
}
int main()
{
	n=rd();
	a[1]=rd();a[2]=rd();a[3]=rd();
	b[1]=rd();b[2]=rd();b[3]=rd();
	for(int i=0;i<=n;++i) dp[i]=i;
	for(int i=0;i<=n;++i)
	{
		if(i+a[1]<=n) dp[i+a[1]]=max(dp[i+a[1]],dp[i]+b[1]);
		if(i+a[2]<=n) dp[i+a[2]]=max(dp[i+a[2]],dp[i]+b[2]);
		if(i+a[3]<=n) dp[i+a[3]]=max(dp[i+a[3]],dp[i]+b[3]);
	}
	for(int i=0;i<=n;++i) M=max(M,n-i+dp[i]);
	n=M;M=0;swap(a[1],b[1]);swap(a[2],b[2]);swap(a[3],b[3]);
	for(int i=0;i<=n;++i) dp[i]=i;
	for(int i=0;i<=n;++i)
	{
		if(i+a[1]<=n) dp[i+a[1]]=max(dp[i+a[1]],dp[i]+b[1]);
		if(i+a[2]<=n) dp[i+a[2]]=max(dp[i+a[2]],dp[i]+b[2]);
		if(i+a[3]<=n) dp[i+a[3]]=max(dp[i+a[3]],dp[i]+b[3]);
	}
	for(int i=0;i<=n;++i) M=max(M,n-i+dp[i]);
	printf("%lld\n",M);
	return 0;
}

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

int main()
{
	string s;
	getline(cin, s);
	string::iterator it;
	int a=0, b=0, i=0;

	for(it=s.begin();it<s.end();it++){
		if(i%2 == *it-'0')a++;
		else b++;
		i++;
	}

	cout << min(a,b) << endl;
}

Measured memory_bytes: 512
fun main(args: Array<String>) {
    val (n,k,l)= readLine()!!.split(" ").map { it.toInt() }
    val road=Array(n){ mutableListOf<Int>() }
    val rail=Array(n){ mutableListOf<Int>() }
    (1..k).forEach {
        val pq = readLine()!!.split(" ").map { it.toInt()-1 }
        road[pq[0]].add(pq[1])
        road[pq[1]].add(pq[0])
    }
    (1..l).forEach {
        val rs = readLine()!!.split(" ").map { it.toInt()-1 }
        rail[rs[0]].add(rs[1])
        rail[rs[1]].add(rs[0])
    }

    val visitK=IntArray(n){-1}
    val visitL=IntArray(n){-1}
    for(i in 0..n-1){
        dfs(i,i,road,visitK)
    }
    for(i in 0..n-1){
        dfs(i,i,rail,visitL)
    }
    val map = (0..n-1).map { visitK[it]*n.toLong()+visitL[it] }.groupBy { it }.mapValues { it.value.size }
    val ans = (0..n-1).map { map[visitK[it]*n.toLong()+visitL[it]] }.joinToString(" ")
    println(ans)
}

fun dfs(v: Int, root: Int, adj: Array<MutableList<Int>>, visit: IntArray){
    if(visit[v]!=-1) return
    visit[v]=root
    adj[v].forEach {
        dfs(it,root,adj,visit)
    }
}

Measured memory_bytes: 158556
n = int(input())
res = float('inf')
for i in range(n+1):
    r = 0
    # i円(0<=i<=n)を6の累乗円で
    t = i
    while t>0:
        r += t%6
        t //= 6
    # 残りのn-i円を9の累乗円で引き出す
    t = n - i
    while t>0:
        r += t%9
        t //= 9
    res = min(res,r)
print(res)

Measured memory_bytes: 3060
import collections
n,m = [int(x) for x in input().split()]
ab = [[] for _ in range(n)]
for _ in range(m):
    u,v = [int(x) for x in input().split()]
    u -= 1
    v -= 1
    ab[u].append(v)
    ab[v].append(u)

D = collections.deque([0])
visited = [False]*n
visited[0] = True
ans = [0] * n

while D:
    v = D.popleft()
    for i in ab[v]:
        if visited[i]:
            continue
        visited[i] = True
        ans[i] = v
        D.append(i)
print("Yes")
for i in ans[1:]:
    print(i+1)

Measured memory_bytes: 35644
//#pragma GCC optimize(2)
#include <bits/stdc++.h>

using namespace std;
typedef long long ll;
#define rep(i, beg, end) for (int i = (beg); i < (end); i++)

int main()
{
    int n;
    cin >> n;
    map<string, int> mp;
    mp["AC"] = 0;
    mp["WA"] = 0;
    mp["TLE"] = 0;
    mp["RE"] = 0;
    rep(i, 0, n)
    {
        string s;
        cin >> s;

        mp[s]++;
    }

    cout << "AC x " << mp["AC"] << endl;
    cout << "WA x " << mp["WA"] << endl;
    cout << "TLE x " << mp["TLE"] << endl;
    cout << "RE x " << mp["RE"] << endl;
}

Measured memory_bytes: 3636
#include <iostream>
#include <string>

using namespace std;

int main(void) {
    string S;
    cin >> S;
    size_t N = S.size();
    int ans = 0;
    for(int i=0; i<N/2; i++) {
        if(S.at(i) != S.at(N-1-i)) {
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; i < n; i++)
#define FOR(i, m, n) for (int i = m; i < n; i++)
#define ll long long int
const int INF = 2147483647;

using namespace std;

int main()
{
  int r, g;
  cin >> r >> g;
  cout << 2 * g - r << endl;
}


Measured memory_bytes: 256
package main

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

const mod = 998244353
const facNum = 300001

func main() {
	sc := newScanner(os.Stdin)
	N := sc.i()
	count := make([]int, N+1)
	//for i := 2; i <= N; i++ {
	//	count[i] = 2
	//}
	//count[1] = 1
	for i := 1; i*i <= N; i++ {
		for j := i; i*j <= N; j++ {
			count[i*j] += 2
			if i == j {
				count[i*j] -= 1
			}
		}
	}
	sum := 0
	for i := 1; i <= N; i++ {
		sum += i * count[i]
	}
	fmt.Println(sum)
}

// fmt.Println("Yes")
// fmt.Println("No")

// I/O
type scanner struct {
	sc *bufio.Scanner
}

func newScanner(input io.Reader) *scanner {
	sc := bufio.NewScanner(input)
	sc.Split(bufio.ScanWords)
	sc.Buffer(make([]byte, 1024), int(1e+9))
	return &scanner{sc}
}

func (s *scanner) s() string {
	s.sc.Scan()
	return s.sc.Text()
}

func (s *scanner) i() int {
	i, e := strconv.Atoi(s.s())
	if e != nil {
		panic(e)
	}
	return i
}

func (s *scanner) f() float64 {
	f, e := strconv.ParseFloat(s.s(), 64)
	if e != nil {
		panic(e)
	}
	return f
}

func (s *scanner) bs() []byte {
	return []byte(s.s())
}

func (s *scanner) is(n int) []int {
	res := make([]int, n)
	for i := 0; i < n; i++ {
		res[i] = s.i()
	}
	return res
}

func (s *scanner) fs(n int) []float64 {
	res := make([]float64, n)
	for i := 0; i < n; i++ {
		res[i] = s.f()
	}
	return res
}

//------------------------------

//const factorial = new
func Pow(a, n int) int {
	ans := 1
	for n > 0 {
		if (n & 1) == 1 {
			ans = ans * a % mod
		}
		a = a * a % mod
		n = n >> 1
	}
	return ans
}

func Gcd(a, b int) int {
	if a < b {
		return Gcd(b, a)
	}
	for b != 0 {
		a, b = b, a%b
	}
	return a
}

func min(a, b int) int {
	if a < b {
		return a
	}
	return b
}

func combination(n, k int, fac, ifac []int) int {
	if n < k || n < 0 {
		return 0
	}
	if k == 0 {
		return 1
	}
	//while n != 0
	ans := ifac[k] * ifac[n-k] % mod
	return ans * fac[n] % mod
}

func abs(i int) int {
	if i < 0 {
		return -i
	}
	return i
}

// 階乗: factorial
// コンビネーションを計算する際に前もって計算しておく
// fac[k] => k! (mod M)
// ifac[k] => k!^(M-2) (mod M)
// n: ex. 2 * 10^5 => 200001
// fac, ifac := factorial()
func factorial() (fac []int, ifac []int) {
	fac = make([]int, facNum)
	fac[0] = 1
	ifac = make([]int, facNum)
	ifac[0] = 1
	for i := 1; i < facNum; i++ {
		fac[i] = fac[i-1] * i % mod
		ifac[i] = ifac[i-1] * Pow(i, mod-2) % mod
	}
	return
}

// vs: sorted slice int value
func lowerBound(vs []int, v int) (index int) {
	n := len(vs) / 2
	m := len(vs)
	for m != n {
		if vs[n] < v {
			n = (m-n+1)/2 + n
			//m = m
		} else {
			m = n
			n = n / 2
		}
	}
	return n
}

func IntSlice(n, init int) []int {
	r := make([]int, n)
	for i := range r {
		r[i] = init
	}
	return r
}


Measured memory_bytes: 82496
/*
精灵引路
对应原理
*/
#include<bits/stdc++.h>
#define MAXN 1005
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
using namespace std;
typedef long long ll;
const ll INF=1e12;
//wa说明精度太大了 把精度减小 变成3e-7
const double eps=1e-6;
ll a,b,c,d,t;
int main()
{
//    freopen("c://duipai//939cdata.txt", "r", stdin);
 //   freopen("c://duipai//939cwa.txt", "w", stdout);
    scanf("%lld",&t);
    while(~scanf("%lld %lld %lld %lld",&a,&b,&c,&d))
    {
//        string str;
//        cin>>str;
//        cout<<str<<endl;
        if(b>d||b>a)
        {
            printf("No\n");
            continue;
        }
        ll g=__gcd(b,d);
        ll k;
      //  printf("%f\n",d);
        if(!((c-a)%g))
        {
            k=(c-a)/g+1;
        }
        else
        {
            if((c-a)<0)
            {
                k=(c-a)/g;
            }
            else
            {
                k=(c-a)/g+1;
            }
        }
      //  printf("%d\n",(int)ceil(d));
        if((a+k*g)>=b)
        {
            printf("Yes\n");
        }
        else
        {
            printf("No\n");
        }
    }
}


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

long long A, B, K;

int main() {
    cin >> A >> B >> K;

    int max_a = 0;
    for (long long i = A; i <= min(B, A + K - 1); i++) {
        cout << i << endl;
    }

    for (long long i = max(A + K, B - K + 1); i <= B; i++) {
        cout << i << endl;
    }
}

Measured memory_bytes: 384
while True:
 m,f,r=map(int,raw_input().split())
 if m==-1 and f==-1 and r==-1:break
 if m+f<30 or m==-1 or f==-1:print "F"
 elif r>=50: print "C"
 elif m+f<50:print "D" 
 elif m+f<65: print "C" 
 elif m+f<80: print "B"
 elif 80<=m+f: print "A"

Measured memory_bytes: 4208
#include <iostream>
#include <fstream>
#include <string>

using namespace std;

int main(){
#ifdef CIN
	ifstream cin("input.txt");
	ofstream cout("output.txt");
#endif

	int x, y, H, W, r;

	cin >> W >> H >> x >> y >> r;

	if (r <= x && x <= (W - r) && r <= y && y <= (H - r)) cout << "Yes" << endl;
	else cout << "No" << endl;



	return 0;
}

Measured memory_bytes: 1160
#include<iostream>
#include<cstdio>
#include<cstring>
#include<string>
#include<algorithm>
#include<bitset>
#include<vector>
#include<deque>
#include<queue>
#include<map>
#include<set>
#include<stack>
#include<cmath>
#include<iomanip>
#include <functional>
using namespace std;
typedef long long ll;
const int mod = 1000000007;
const int INF = 1 << 28;
const double EPS = 1e-10;
//cout << fixed << std::setprecision(9)
//memset(a, 0, sizeof(a));
//--------------------------

int main()
{
	ll n;
	cin >> n;
	ll ans = INF;
	while (n) {
		ll temp = n % 1000;
		ans = std::min(ans, abs(temp - 753));
		n /= 10;
	}

	cout << ans << endl;

	return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define N 30
using namespace std;
struct dat{
  int l,r,par,sib,deg,dep,height,type;
  dat(){l = r = par =  sib = deg = dep = height = type = -1;}
};

dat T[30];
int root;
char str[3][20] = {"root", "internal node", "leaf"};
void pr(int id){
  printf("node %d: parent = %d, sibling = %d, degree = %d, depth = %d, height = %d, %s\n"
         ,id, T[id].par, T[id].sib, T[id].deg, T[id].dep, T[id].height, str[ T[id].type ]
         );
}


void Depth(int id,int depth){
  T[id].dep = depth;
  if(T[id].l!=-1) Depth(T[id].l,depth+1);
  if(T[id].r!=-1) Depth(T[id].r,depth+1);
}

void Height(int id,int height){
  T[id].height = max(T[id].height, height);
  if(T[id].par!=-1) Height(T[id].par,height+1);
}


int main(){
  int n;
  cin>>n;
  for(int i=0;i<n;i++){
    int id;
    cin>>id;
    cin>>T[id].l>>T[id].r;

    T[ T[id].l ].par = id;
    T[ T[id].r ].par = id;
    
    T[ T[id].l ].sib = T[id].r;
    T[ T[id].r ].sib = T[id].l;
    
    T[id].deg = (T[id].l!=-1) + (T[id].r!=-1);
  }

  for(int id=0;id<n;id++){
    if(T[id].par == -1) T[id].type = 0,Depth(id,0);
    else if(T[id].deg != 0) T[id].type = 1;
    else T[id].type = 2;
    Height(id,0);
  }
  
  for(int i=0;i<n;i++) pr(i);
  return 0;
}

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

int main() {
  int oh,ten,one;
  int total;
  cin >> oh >> ten >> one;
  
  total = (oh * 100) + (ten * 10) + one;
  if(total % 4 == 0) cout << "YES";
  else cout << "NO";
}


Measured memory_bytes: 256
#include<cstdio>
#include<iostream>
#include<cmath>
using namespace std;
int main()
{
    int a,b,x=0,y=0,w,i;
    scanf("%d%d",&a,&b);
    w=b;
     while(w>0){
        w=w/10;
        y++;
    }
    for(i=0;i<y;i++)
        a=a*10;
    int j=a+b;
    for(i=1;i<j;i++)
    {
        if(i*i==j) {printf("Yes"); return 0;}
    }
    printf("No");
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef long double ld;
#define rep(i,a,b) for(ll i=a;i<b;i++)
#define rrep(i,a,b) for(ll i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
#define INF 1000000000
#define MAX_V 300

//ワーシャル-フロイド法(全点対最短経路問題)
//全ての2頂点間の最短路を求める
//計算量O(|V|^3)
ll d[MAX_V][MAX_V]; //d[u][v]は辺e=(u,v)のコスト(存在しない場合はINF,d[i][i]=0)
int V; //頂点数

void warshall_floyd(){
    for(int k = 0; k < V; k++)
        for(int i = 0; i < V; i++)
            for(int j = 0; j < V; j++)
                d[i][j] = min(d[i][j], d[i][k] + d[k][j]);
}

int main(void){
    ll n, m, r;
    cin >> n >> m >> r;

    ll ro[r];
    rep(i, 0, r){
        cin >> ro[i];
        ro[i]--;
    }

    V = n;

    rep(i, 0, n){
        rep(j, 0, n){
            d[i][j] = INF;
        }
    }
    rep(i, 0, m){
        ll ta, tb, tc;
        cin >> ta >> tb >> tc;
        ta--;
        tb--;
        d[ta][tb] = tc;
        d[tb][ta] = tc;
    }

    warshall_floyd();

    ll num = 1;
    ll tmp = r;
    while(tmp){
        num *= tmp;
        tmp--;
    }
    sort(ro, ro + r);

    ll ans = 100000000000;
    rep(i, 0, num){
        ll sum = 0;
        rep(j, 0, r - 1){
            sum += d[ro[j]][ro[j + 1]];
        }
        ans = min(ans, sum);
        next_permutation(ro, ro + r);
    }

    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 768
while True:
    h,w = map(int,input().split())
    if h == 0 and w == 0:
        break
    for i in range(h):
        for t in range(w):
            if (i + t) % 2 == 0:
                print("#",end = "")
            else:
                print(".",end = "")
        print()
    print()
                


Measured memory_bytes: 7008
#define _USE_MATH_DEFINES
#include <iostream>
#include <algorithm>
#include <queue>
#include <stack>
#include <deque>
#include <climits>
#include <string>
#include <vector>
#include <set>
#include <map>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
//#include <tuple>

#define break break
#define continue continue
#define INF INT_MAX>>1 
#define SIZE 100010
#define MOD 1000000007
#define rep(i, n) for(int i=0; i<(int)(n); i++)
#define rep2(i, from, to) for(int i=(from); i<(int)(to); i++)
#define all(obj) (obj).begin(), (obj).end()
#define lpair pair<ll, ll>
#define vint vector<ll>
#define vinput(name) for(int i=0; i<(int)(name.size()); i++) cin >> name[i];
#define voutput(name) for(int i=0; i<(int)(name.size()); i++) cout << name[i] << endl;
typedef long long ll;

using namespace std;

ll ans = 0;

int main(void){
	ll n, k; cin >> n >> k;
	vint h(n); vinput(h);
	sort(all(h), greater<ll>());
	ll useCount = 0;
	rep(i, n){
		if(useCount < k){
			useCount++;
			continue;
		}
		ans += h[i];
	}

	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 1792
// 複雑なことしか考えつかなかったので解答見てしまった
//
// 計算量的に O(N)くらいしか無理なので、
// Nを数え上げてる最中になにか O(1)の作業をする
//
// n に対する答えをメモっていっても解けそう (未検証)

#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); i++)
#define rep1(i, n) for (int i = 1; i <= (n); i++)
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

const char wall = '#';
vector<vector<char>> fields;
vector<vector<bool>> used;
vector<vector<ll>> dist;
const int dx[4] = {0, -1, 0, 1};
const int dy[4] = {1, 0, -1, 0};

vector<ll> A;
// vectorのリサイズ
// A.resize(N);

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

P f(int x) {
  int a = x % 10;
  int b = 0;
  while (x) {
    b = x;
    x /= 10;
  }
  return P(a, b);
}

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

  ll n;
  cin >> n;
  map<P, int> freq;
  rep1(i, n) {
    P p = f(i);
    freq[p]++;
  }
  ll ans = 0;
  rep1(i, n) {
    P p = f(i);
    P q(p.second, p.first);
    ans += freq[q];
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		// TODO 自動生成されたメソッド・スタブ
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		int arrayA[] = new int[n];

		for(int i = 0; i < n; i++) {
			arrayA[i] = sc.nextInt();
		}

		int m = sc.nextInt();
		for(int i = 0; i < m; i++) {  //配列Bの要素のループ
			int key = sc.nextInt();

			BinarySearch bi = new BinarySearch();
			if(bi.binarySearch(arrayA, key) == 0) {
				System.out.println(0);
				break;
			}
			if(i == m - 1) System.out.println(1);
		}
	}
}

class BinarySearch {
	public int binarySearch(int[] array, int key) {
		int pLeft = 0;
		int pRight = array.length - 1;

		do {
			int center = (pLeft + pRight) / 2;

			if (array[center] == key) {
				return 1;
			} else if (array[center] < key){
				pLeft = center + 1; //真ん中の一つ右側を左端とする
			} else {
				pRight = center - 1;
			}
		} while (pLeft <= pRight);

		return 0;
	}
}


Measured memory_bytes: 120392
def issquare(n):
    f = (0,0,1,1,0,1,1,1,1,0,1,1,1,1,1,1)
    if f[n & 0xf]:
         return False
    l, r = 1, n
    while l <= r:
        m  = l + (r - l) // 2
        m2 = m * m
        if m2 < n:
            l = m + 1
        elif m2 > n:
            r = m - 1
        else:
            return True
    return False        

def istriangular(n):
    return issquare(1+8*n)

N = int(input())

if istriangular(N):
    print('Yes')
    n = int((1+8*N)**0.5-1) // 2
    k = n + 1
    print(k)
    base = 1
    for i in range(n):
        s = [n]
        base += i
        add = 0
        for j in range(n):
            s.append(base + add)
            if j < i:
                add += 1
            else:
                add += j + 1
        print(*s)
    s = [n, 1]
    for i in range(2, n+1):
        s.append(s[-1]+i)
    print(*s)
else:
    print('No')

Measured memory_bytes: 4488
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
#include <unordered_map>
using namespace std;

#define REP(i, s) for (int i = 0; i < s; ++i)
#define ALL(v) (v.begin(), v.end())
#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++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; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T> ostream& operator << (ostream &s, set<T> P)
{ EACH(it, P) { s << "<" << *it << "> "; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }

typedef long long  ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

int main() {
    ll N;
    ll a[10010],b[10010];
    cin>>N;
    REP(i,N) cin>>a[i];
    REP(i,N) cin>>b[i];
    ll sum=0;
    ll suma=0,sumb=0;
    ll cnt=0;
    REP(i,N){
        suma+=a[i];
        sumb+=b[i];
        if(b[i]-a[i]>0) sum+=(b[i]-a[i]+1)/2;
       
    }
    if(sumb-suma>=sum) cout<<"Yes"<<endl;
    else cout<<"No"<<endl; 
   
   

  


    return 0;
}

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


int main(){
    int n, d; cin >> n >> d;
    vector<vector<int>> x(n, vector<int> (d));
    rep(i, n) {
        rep(j, d) cin >> x[i][j];
    }
    ll count=0;
    rep(i, n) {
        rep(j, n) {
            double dis=0;
            rep(k, d) {
                dis += ((x[i][k]) - (x[j][k])) * ((x[i][k]) - (x[j][k]));
            }
            dis = sqrt(dis);
            if(dis == floor(dis) && dis != 0) count++;
        }
    }
    cout << count/2 << endl;
}
   

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	Scanner sc = new Scanner(System.in);

	void run() {
		int N = sc.nextInt();
		int W = sc.nextInt();
		int[] v = new int[N];
		int[] w = new int[N];
		for (int i = 0; i < N; i++) {
			v[i] = sc.nextInt();
			w[i] = sc.nextInt();
		}
		int[][] dp = new int[2][W + 1];
		for (int i = 0; i < N; i++) {
			for (int j = 0; j <= W; j++) {
				if (j - w[i] >= 0) {
					dp[(i + 1) & 1][j] = Math.max(dp[i & 1][j], dp[i & 1][j - w[i]] + v[i]);
					dp[(i + 1) & 1][j] = Math.max(dp[(i + 1) & 1][j], dp[(i + 1) & 1][j - w[i]] + v[i]);
				} else {
					dp[(i + 1) & 1][j] = dp[i & 1][j];
				}
			}
		}
		int max = 0;
		for (int i = 0; i <= W; i++)
			max = Math.max(max, dp[N & 1][i]);
		System.out.println(max);
	}

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

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

int main() {
  string s; cin>>s;
  vector<int> a(4);
  rep(i, 4) a[i] = s[i] - '0';
  rep(bit, (1<<3)) {
    int tmp = a[0];
    rep(i, 3) {
      if (bit&(1<<i)) tmp-=a[i+1];
      else tmp+=a[i+1];
    }
    if (tmp == 7) {
      cout<<a[0];
      rep(i, 3) {
        if (bit&(1<<i)) cout<<"-";
        else cout<<"+";
        cout<<a[i+1];
      }
      cout<<"=7"<<endl;
      return 0;
    }
  }
}


Measured memory_bytes: 256
import java.util.Arrays;

public class Main {

  private static void solve() {
    int n = ni();
    long[] l = nal(n);

    long ret = 0;
    for (int i = 0; i < n; i++) {
      for (int j = i + 1; j < n; j++) {
        for (int k = j + 1; k < n; k++) {
          long[] a = { l[i], l[j], l[k] };
          if (a[0] == a[1] || a[0] == a[2] || a[1] == a[2]) {
            continue;
          }
          if (a[0] + a[1] > a[2] && a[1] + a[2] > a[0] && a[0] + a[2] > a[1]) {
            ret++;
          }
        }
      }
    }
    System.out.println(ret);
  }

  public static void main(String[] args) {
    new Thread(null, new Runnable() {
      @Override
      public void run() {
        long start = System.currentTimeMillis();
        String debug = args.length > 0 ? args[0] : null;
        if (debug != null) {
          try {
            is = java.nio.file.Files.newInputStream(java.nio.file.Paths.get(debug));
          } catch (Exception e) {
            throw new RuntimeException(e);
          }
        }
        reader = new java.io.BufferedReader(new java.io.InputStreamReader(is), 32768);
        solve();
        out.flush();
        tr((System.currentTimeMillis() - start) + "ms");
      }
    }, "", 64000000).start();
  }

  private static java.io.InputStream is = System.in;
  private static java.io.PrintWriter out = new java.io.PrintWriter(System.out);
  private static java.util.StringTokenizer tokenizer = null;
  private static java.io.BufferedReader reader;

  public static String next() {
    while (tokenizer == null || !tokenizer.hasMoreTokens()) {
      try {
        tokenizer = new java.util.StringTokenizer(reader.readLine());
      } catch (Exception e) {
        throw new RuntimeException(e);
      }
    }
    return tokenizer.nextToken();
  }

  private static double nd() {
    return Double.parseDouble(next());
  }

  private static long nl() {
    return Long.parseLong(next());
  }

  private static int[] na(int n) {
    int[] a = new int[n];
    for (int i = 0; i < n; i++)
      a[i] = ni();
    return a;
  }

  private static char[] ns() {
    return next().toCharArray();
  }

  private static long[] nal(int n) {
    long[] a = new long[n];
    for (int i = 0; i < n; i++)
      a[i] = nl();
    return a;
  }

  private static int[][] ntable(int n, int m) {
    int[][] table = new int[n][m];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[i][j] = ni();
      }
    }
    return table;
  }

  private static int[][] nlist(int n, int m) {
    int[][] table = new int[m][n];
    for (int i = 0; i < n; i++) {
      for (int j = 0; j < m; j++) {
        table[j][i] = ni();
      }
    }
    return table;
  }

  private static int ni() {
    return Integer.parseInt(next());
  }

  private static void tr(Object... o) {
    if (is != System.in)
      System.out.println(java.util.Arrays.deepToString(o));
  }
}


Measured memory_bytes: 43116
/*
  || Shree Ganeshay Namah ||

     || Jai Shree Ram ||
  || Nabh Sparsham Diptam ||
*/
#include<bits/stdc++.h>
using namespace std;
typedef  long long int ll;
#define mod 1000000000000000001
#define block 180
#define ff first.first
#define fs first.second
#define sf second.first
#define ss second.second
#define f1 first
#define s1 second
int jai_shree_ram()
{
    return 1;
}
int shree_ganeshay_namah()
{
    return 1;
}
ll power(ll x,ll y)
{
    ll r=1;
    while(y>0)
    {
        if(y%2!=0)
            r=r*x;
        x=x*x;
        y=y/2;
    }
    return r;
}
ll ncr(ll n,ll k)
{

    ll c[k+1];
    memset(c,0,sizeof(c));
    c[0]=1;
    for(ll i=1;i<=n;i++)
    {
        for(ll j=min(i,k);j>0;j--)
            c[j]=c[j]+c[j-1];
    }
    return c[k];
}

bool prime[500001];
void sieve()
{
    ll i,j;
    memset(prime,true,sizeof(prime));
    prime[0]=false;
    prime[1]=false;
    for(i=2;i<=sqrt(100001);i++)
    {
        if(prime[i])
        {
            for(j=i*i;j<=100001;j=j+i)
                prime[j]=false;
        }
    }
}

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    ll n,b,c,i,j;
    map<ll,ll>m;
    cin>>n;
    ll a[n];
    ll f=0;
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        f=(f^a[i]);
    }
    for(i=0;i<n;i++)
    {
        cout<<(a[i]^f)<<" ";
    }

    return 0;

}


Measured memory_bytes: 5176
#include <bits/stdc++.h>
using namespace std;
#define DEBUG_MODE
#define endl '\n'
#ifdef DEBUG_MODE
#define DEBUG(X) debug_func(X, #X)
#define DEBUG_ENDL endl
#define DEBUG_SEPARATOR_LINE cout<<"=================\n"
#else
#define DEBUG(X) 0
#define DEBUG_ENDL 0
#define DEBUG_SEPARATOR_LINE 0
#endif
#define ALL(V) (V).begin(), (V).end()
#define ALLR(V) (V).rbegin(), (V).rend()
#define DEBUG_ENDL_S(S) ((S).size() ? "\n" : "")
template <typename T> using V = vector<T>;
template <typename T> using VV = V<V<T>>;
template <typename T, typename U> using P = pair<T, U>;
using ll = int64_t;
using PLL = P<ll, ll>;
template <typename T> const T& var_min(const T &t) { return t; }
template <typename T> const T& var_max(const T &t) { return t; }
template <typename Head, typename... Tail> const Head& var_min(const Head &head, const Tail&... tail) { return min(head, var_min(tail...)); }
template <typename Head, typename... Tail> const Head& var_max(const Head &head, const Tail&... tail) { return max(head, var_max(tail...)); }
template <typename T, typename... Tail> void chmin(T &t, const Tail&... tail) { t = var_min(t, tail...); }
template <typename T, typename... Tail> void chmax(T &t, const Tail&... tail) { t = var_max(t, tail...); }
void debug_func_preffix(const string &s) { if(s.size()) cout << s << " = "; }
template <typename T>
void debug_func(const T &t, const string &s = "") {
    debug_func_preffix(s);
    cout << t << DEBUG_ENDL_S(s);
}
template <typename T, typename U>
void debug_func(const P<T, U> &p, const string &s = "") {
    debug_func_preffix(s);
    cout << "(";
    debug_func(p.first);
    cout << ", ";
    debug_func(p.second);
    cout << ")" << DEBUG_ENDL_S(s);
}
template <typename T>
void debug_func(const V<T> &v, const string &s = "") {
    for(ll i = 0; i < v.size(); i++) {
        string t = s + "[" + to_string(i) + "]";
        debug_func(v[i], t);
    }
}

int main() {
    ll N, M;
    cin >> N >> M;
    ll ans = 1;
    for(ll i = 0; i < M; i++) ans *= 2;
    ans *= (1900 * M + 100 * (N - M));
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
require 'prime'

n = gets.to_i
ans = (n-1).prime_division.inject(1){|r, (_, v)| r * (v + 1)} - 1

class Integer
    def my_divisor_list2
      return [1] if self == 1
      Prime.prime_division(self).map do |e|
        Array.new(e[1]+1).map.with_index do |element, i|
          e[0]**i
        end
      end.inject{|p,q| p.product(q)}.map do |a|
        [a].flatten.inject(&:*)
      end
    end
end

n.my_divisor_list2.each do |a|
    next if a == 1
    x = n
    x /= a while x % a == 0
    ans += 1 if x % a == 1
end

puts ans

Measured memory_bytes: 3708
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
REP(i,v.size()){if(i)os<<" ";os<<v[i];}return os;}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
REP(i,v.size()){if(i)os<<endl;os<<v[i];}return os;}


ll yoshi(ll x, ll y)
{

	if (x%y == 0)
	{
		return x / y;
	}
	else
	{
		return x / y + 1;
	}

}

int main()
{

	ll N;
	ll a, b, c, d, e;
	cin >> N >> a >> b >> c >> d >> e;



	ll M = min({a, b, c, d, e});



	ll ans = 4 + yoshi(N, M);

	cout << ans << endl;
}


Measured memory_bytes: 256
N = int(input())
S_1 = list(input())
S_2 = list(input())



if S_1[0] == S_2[0]:
    res = 3
    flag = 0
    i = 1
else:
    res = 6
    flag = 1
    i = 2

while i != N:
    if S_1[i] == S_2[i]:
        if flag == 0:
            res *= 2 
        else:
            res *= 1
            flag = 0
        i += 1

    else:
        if flag == 0:
            res *= 2
            flag = 1
        else:
            res *= 3
        i += 2
        
ans = res%1000000007

print(ans)
    

Measured memory_bytes: 3188
#include <bits/stdc++.h>
using namespace std;
long long f(long long b,long long n)
{
    if(n<b)
        return n;
    else
        return f(b,n/b)+(n%b);
}
long long n,s;
const long long MAXN=1ll<<60;
long long answ=MAXN;
int main()
{
    scanf("%lld %lld",&n,&s);
    if(s>n)
    {
    	printf("-1\n");
    	return 0;
	}
	if(n==s)
	{
		printf("%lld",n+1);
		return 0;
	}
    long long maxb=sqrt(n);
    for(long long b=2; b<=maxb+1; b++)
        if(f(b,n)==s)
        {
            answ=min(answ,b);
            break;
        }
    long long fj=n-s;
    for(long long k=1; k*k<=fj; k++)
    {
        if(fj%k==0)
        {
            long long b=fj/k+1;
            if(f(b,n)==s)
                answ=min(answ,b);
        }
    }
    if(answ!=MAXN)
        printf("%lld",answ);
    else
        printf("-1");
    return 0;
}

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

int main(){
    int N;
    std::cin >> N;
    
    std::vector< std::vector< int > > count(10, std::vector< int >(10, 0));
    for(int i=1; i<=N; i++){
        std::string tmp = std::to_string(i);
        int head = tmp[0] - '0';
        int tail = tmp[tmp.size()-1] - '0';
        count[head][tail]++;
    }
    
    long long ans = 0;
    for(int i=1; i<10; i++){
        for(int j=1; j<10; j++){
            ans += count[i][j] * count[j][i];
        }
    }
    std::cout << ans << std::endl;
    
    return 0;
    
}


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

void solveA(){
  double t,x;
  cin >> t >> x;
  printf("%.10lf\n",t/x);
}
void solveB(){
  
}

void solveC(){
}
void solveD(){
}

int main(){
  solveA();
}


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

using namespace std;


int main(){
	long long int A, B;
	cin >> A >> B;
	A--; B--;
	cout << 100 << " " << 100 << endl;
	for( long long int i = 0; i < 50; i++ ){
		for( size_t j = 0; j < 100; j++ ){
			if( i % 2 || ( i % 2 == 0 && j % 2 ) || A == 0 ){
				cout << "#";
			} else{
				cout << ".";
				A--;
			}
		}
		cout << endl;
	}
	for( long long int i = 0; i < 50; i++ ){
		for( size_t j = 0; j < 100; j++ ){
			if( i % 2 == 0 || ( i % 2 && j % 2 ) || B == 0 ){
				cout << ".";
			} else{
				cout << "#";
				B--;
			}
		}
		cout << endl;
	}
}

Measured memory_bytes: 256
//#include<bits/stdc++.h>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<vector>
#include<queue>
#include<set>

/*
#include<boost/multiprecision/cpp_int.hpp>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/rational.hpp>
namespace mp = boost::multiprecision;
using Real = mp::number<mp::cpp_dec_float<1024>>;
using Bint = mp::cpp_int;
*/

using namespace std;

#define int long long
#define REP(i,s,e) for((i)=(s);(i)<(e);(i)++)
#define RREP(i,s,e) for((i)=((s)-1);(i)>=(e);(i)--)
#define FOR(i,n) for((i)=(0);(i)<(n);(i)++)
#define RFOR(i,n) for((i)=((n)-1);(i)>=(0);(i)--)
#define MOD 1000000007

#define NMAX 200000

signed main(){

    int N;
    int a[NMAX];
    int tbl[100]={0};
    cin>>N;

    for(int i=0;i<N;i++){
        cin>>a[i];
        int n=a[i];
        int sec=1;
        int idx=0;
        while(n>=sec){
            sec*=2;
            idx++;
        }
        sec/=2;
        idx--;
        while(n!=0){
            tbl[idx]+=n/sec;
            //cout<<a[i]<<","<<sec<<","<<n/sec<<endl;
            n%=sec;
            sec/=2;
            idx--;
        }
    }

    for(int i=0;i<N;i++){
        int n=a[i];
        int sec=1;
        int idx=0;
        while(1000000000>=sec){
            sec*=2;
            idx++;
        }
        sec/=2;
        idx--;
        int ans=0;
        while(sec!=0){
            //cout<<sec<<","<<ans<<endl;
            if(n/sec==1){
                if(tbl[idx]%2==0){
                    ans+=sec;
                }
            }
            else{
                if(tbl[idx]%2==1){
                    ans+=sec;
                }
            }
            n%=sec;
            sec/=2;
            idx--;
        }
        cout<<ans<<endl;
    }
}

//10100 20
//01011 11
//01001  9
//11000 24

//10
//11
//10
//10

//1010 10
//0011 3
//0010 12
//0010 12
//3 10 11 11


Measured memory_bytes: 4712
#include <stdio.h>
#define MAX 100005
#define NIL -1
void print(int);
void setD(int, int);
struct Node {
        int p, l, r;
};
struct Node T[MAX];
int n, D[MAX];

int main(){
        int i, j, d, v, c, l, r;
        scanf("%d", &n);
        for(i = 0; i<n; i++) {
                T[i].p = T[i].l = T[i].r = NIL;
        }
        for(i = 0; i<n; i++) {
                scanf("%d%d", &v, &d);
                for(j = 0; j<d; j++) {
                        scanf("%d", &c);
                        if(j == 0) T[v].l = c;
                        else T[l].r = c;
                        l=c;
                        T[c].p = v;
                }
        }
        for(i = 0; i < n; i++) {
                if (T[i].p == NIL) r = i;
        }

        setD(r, 0);

        for(i = 0; i < n; i++) print(i);

        return 0;
}

void print(int u){
        int i, c;
        printf("node %d: ", u);
        printf("parent = %d, ", T[u].p);
        printf("depth = %d, ", D[u]);

        if(T[u].p == NIL) printf("root, ");
        else if(T[u].l == NIL) printf("leaf, ");
        else printf("internal node, ");

        printf("[");

        for(i = 0, c = T[u].l; c != NIL; i++, c = T[c].r) {
                if(i) printf(", ");
                printf("%d", c);
        }
        printf("]\n");
}

void setD(int u, int p){
        D[u] = p;
        if(T[u].r != NIL) setD(T[u].r, p);
        if(T[u].l != NIL) setD(T[u].l, p+1);
}

Measured memory_bytes: 5296
import numpy as np
N = int(input())
AB =np.zeros((N,2),dtype=np.int32)
for i in range(N):
    AB[i,:]=list(map(int,input().split()))

ABs = AB[np.argsort(AB[:, 1])]

output = "Yes"

T = 0
for i in range(N):
    T += ABs[i,0]
    if T>ABs[i,1]:
        output = "No"

print(output)

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


int main(){
  map<string, int> S;
  S["AC"] = 0;
  S["WA"] = 0;
  S["TLE"] = 0;
  S["RE"] = 0;
  int N;
  cin >> N;
  rep(i, N){
    string s;
    cin >> s;
    S[s]++;
  }
  cout << "AC x " << S["AC"] << endl;
  cout << "WA x " << S["WA"] << endl;
  cout << "TLE x " << S["TLE"] << endl;
  cout << "RE x " << S["RE"] << endl;
}


Measured memory_bytes: 3632