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

using namespace std;

typedef unsigned uint;
typedef long long ll;
typedef unsigned long long ull;
typedef long double ldbl;
typedef pair<int, int> pii;
typedef pair<uint, uint> puu;
typedef pair<ll, ll> pll;
typedef pair<ull, ull> pull;
typedef pair<double, double> pdd;
typedef vector<int> vi;
typedef vector<uint> vu;
typedef vector<ll> vll;
typedef vector<ull> vull;
typedef vector<pii> vpii;
typedef vector<puu> vpuu;
typedef vector<pll> vpll;
typedef vector<pull> vpull;
typedef vector<string> vstr;
typedef vector<double> vdbl;
typedef vector<ldbl> vldbl;
#define pb push_back
#define ppb pop_back
#define pfr push_front
#define ppfr pop_front
#define emp emplace
#define empb emplace_back
#define be begin
#define rbe rbegin
#define all(x) (x).be(), (x).end()
#define rall(x) (x).rbe(), (x).rend()
#define fir first
#define sec second
#define mkp make_pair
#define brif(cond) if (cond) break
#define ctif(cond) if (cond) continue
#define retif(cond) if (cond) return
void canhazfast() {ios_base::sync_with_stdio(false);cin.tie(nullptr);cout.tie(nullptr);}
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a%b) : a;}
template<typename T> T extgcd(T a, T b, T &x, T &y)
{
    T x0 = 1, y0 = 0, x1 = 0, y1 = 1;
    while (b) {
        T q = a/b; a %= b; swap(a, b);
        x0 -= q*x1; swap(x0, x1);
        y0 -= q*y1; swap(y0, y1);
    }
    x = x0; y = y0; return a;
}
int ctz(uint x) {return __builtin_ctz(x);}
int ctzll(ull x) {return __builtin_ctzll(x);}
int clz(uint x) {return __builtin_clz(x);}
int clzll(ull x) {return __builtin_clzll(x);}
int popcnt(uint x) {return __builtin_popcount(x);}
int popcntll(ull x) {return __builtin_popcountll(x);}
int bsr(uint x) {return 31^clz(x);}
int bsrll(ull x) {return 63^clzll(x);}

int main()
{
    canhazfast();

    int r, d;
    ll x;

    cin >> r >> d >> x;
    for (int i = 1; i <= 10; ++i) {
        x = r*x-d;
        cout << x << '\n';
    }

    return 0;
}


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

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

  int minDiff = 0;

  set<int> set;
  for (int i = 0; i < N; i++) {
    int tmp;
    cin >> tmp;
    set.insert(tmp);
  }

  while (true) {
    if (set.find(X - minDiff) == set.end()) {
      // 存在しない
      cout << X - minDiff << endl;
      return 0;
    } else {
      if (set.find(X + minDiff) == set.end()) {
        // 存在しない
        cout << X + minDiff << endl;
        return 0;
      }
    }

    minDiff++;
  }
}

Measured memory_bytes: 3632
from collections import deque, Counter, defaultdict
from itertools import chain, combinations
import json
# import numpy as np
import bisect
import sys
import math
import bisect
from functools import lru_cache

sys.setrecursionlimit(10 ** 8)

M = 10 ** 9 + 7
INF = 10 ** 17


def main():
    N = int(input())
    # A = [int(a) for a in input().split()]
    c = 1
    d = 100
    while True:
        d = int(d * 1.01)
        if d >= N:
            print(c)
            return
        c += 1


if __name__ == "__main__":
    main()


Measured memory_bytes: 10120
A,B,C = map(int,input().split())
if A%2 != 0 or B%2 != 0 or C%2 != 0:
    print(0)
    exit()
if A*2 == B+C and B*2 == A+C and C*2 == A+B:
    print(-1)
    exit()
ans = 0
for i in range(10000):
    a = A//2
    b = B//2
    c = C//2
    if A%2 == 0 and B%2 == 0 and C%2 == 0:
        ans += 1
        A = b+c
        B = a+c
        C = a+b
    else:
        print(ans)
        exit()

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

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		if(S.Length <= K){
			Console.WriteLine(S);
		} else {
			var s = S.Substring(0, K) + "...";
			Console.WriteLine(s);
		
		}
		
	}
	int K;
	String S;
	public Sol(){
		K = ri();
		S = rs();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 17664
#include<iostream>
#include<algorithm>

using namespace std;

int rieki(bool ri,double riritu,int kingaku, int kikan,int tesuu){
    int risi=0;
    if(ri){
        for(int i=0;i<kikan;i++){
            kingaku=kingaku*(1+riritu)-tesuu;
        }
    }else{
        for(int i=0;i<kikan;i++){
            risi+=kingaku*riritu;
            kingaku-=tesuu;
        }
    }
    return kingaku+risi;
}

int main(){
    int m;
    cin>>m;
    for(int j=0;j<m;j++){
        int kane,nen;
        cin>>kane>>nen;
        int n;
        cin>>n;
        int ans=0;
        for(int k=0;k<n;k++){
            bool r;
            double riri;
            int te;
            cin>>r>>riri>>te;
            ans=max(rieki(r,riri,kane,nen,te),ans);
        }
        cout<<ans<<endl;
    }
    return 0;
}

Measured memory_bytes: 1232
#include<iostream>

using namespace std;

static const int MAX = 100;

void printStringnum(int a[],int n){
    for(int i=0;i<n-1;i++){
        cout << a[i] << " ";
    }    
    cout << a[n-1] << "\n";
}


int selectionSort(int a[],int n){
    int count = 0;
    int i,j,num,flag;
    for(i = 0;i<n;i++){
        int lead = a[i];
        flag = 0;
        for(j = i+1;j<n;j++){
        if(lead > a[j]){
            lead= a[j];
            num = j;
            flag = 1;
        }
        }
        if(flag){
        a[num] = a[i];
        a[i] = lead;
        count++;
        //printStringnum(a,n);
        }
    }
    printStringnum(a,n);
    return count;
}

int main(){
    int n,count;
    int a[MAX];

    cin >> n;

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

    count = selectionSort(a,n);
    cout << count << "\n";

}


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

using namespace std;
int N;
bool even=1;
int main(){

cin.tie(0);
ios::sync_with_stdio(false);

cin>>N;

for(int i=0; i<N; i++){
  int a;
  cin>>a;
  if(a%2) even=0;
}

if(!even) cout<<"first"<<endl;
else cout<<"second"<<endl;

}



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

int main() {
  int count[4][3][10];
  std::memset(count, 0, sizeof count);
  int n;
  cin >> n;
  for (int i = 0; i < n; i++) {
    int building, floor, room, v;
    cin >> building >> floor >> room >> v;
    count[building - 1][floor - 1][room - 1] += v;
  }

  for (int i = 0; i < 4; i++) {
    for (const auto& room : count[i]) {
      for (const auto& v : room) {
        if (v <= 0) {
          cout << " " << 0;
        } else {
          cout << " " << v;
        }
      }
      cout << endl;
    }
    if (i != 3) {
      cout << "####################" << endl;
    }
  }
  return 0;
}



Measured memory_bytes: 3016
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <cstring>
#include <deque>
#include <list>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <complex>
#include <cmath>
#include <limits>
#include <cfloat>
#include <climits>
#include <ctime>
#include <cassert>
#include <numeric>
#include <functional>
#include <cctype>
using namespace std;

#define rep(i,a,n) for(int (i)=(a); (i)<(n); (i)++)
#define repq(i,a,n) for(int (i)=(a); (i)<=(n); (i)++)
#define repr(i,a,n) for(int (i)=(a); (i)>=(n); (i)--)
#define int long long int

template<typename T> void chmax(T &a, T b) {a = max(a, b);}
template<typename T> void chmin(T &a, T b) {a = min(a, b);}
template<typename T> void chadd(T &a, T b) {a = a + b;}

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

int dx[] = {0, 0, 1, -1};
int dy[] = {1, -1, 0, 0};
constexpr ll INF = 1001001001001001LL;
constexpr ll MOD = 1000000007LL;

struct Node {
    int Number;
    Node *left, *right;
};

int getNumber(string::iterator &it);
Node* getChildren(string::iterator &it);
Node* parseNode(string::iterator &it);

int getNumber(string::iterator &it) {
    int ret = 0;
    while(isdigit(*it)) {
        ret *= 10;
        ret += (*it - '0');
        it++;
    }
    return ret;
}

Node* getChildren(string::iterator &it) {
    if(*it == '(' && *(it+1) == ')') {
        it += 2;
        return NULL;
    }
    it++;
    Node *ret = parseNode(it);
    it++;
    return ret;
}

Node* parseNode(string::iterator &it) {
    // cerr << *it << endl;
    assert(*it == '(');
    Node *CurrentNode = new Node;
    CurrentNode->left = getChildren(it);
    it++; // '['
    CurrentNode->Number = getNumber(it);
    it++; // ']'
    CurrentNode->right = getChildren(it);
    return CurrentNode;
}

void dfs(Node *cur) {
    if(cur == NULL) return;
    cout << "(";
    dfs(cur->left);
    cout << ")";
    cout << "[";
    cout << cur->Number;
    cout << "]";
    cout << "(";
    dfs(cur->right);
    cout << ")";
}

Node *CreateTree(Node *ns, Node *nt) {
    if(ns == NULL || nt == NULL) return NULL;
    Node *ret = new Node;
    ret->Number = ns->Number + nt->Number;
    ret->left = CreateTree(ns->left, nt->left);
    ret->right = CreateTree(ns->right, nt->right);
    return ret;
}

signed main() {
    string s, t; cin >> s >> t;
    string::iterator its = s.begin(), itt = t.begin();
    Node *ns = parseNode(its), *nt = parseNode(itt);

    Node *ans = CreateTree(ns, nt);
    // dfs(ns); cout << endl;
    // dfs(nt); cout << endl;

    dfs(ans); cout << endl;
    return 0;
}

Measured memory_bytes: 3168
def d(u):
 global t
 C[u]=1;D[u]=t;t+=1
 for v in M[u]:v=int(v)-1;C[v]or d(v)
 F[u]=t;t+=1
N=int(input());R=range(N)
M=[input().split()[2:]for _ in R]
C,D,F=[0]*N,[0]*N,[0]*N
t=1
for i in R:C[i]or d(i)
for i in R:print(i+1,D[i],F[i])


Measured memory_bytes: 5716
import java.util.Scanner;

class Main{
  public static void main(String[] args){
    Scanner scanner = new Scanner(System.in);
    int N=0;
    String Sentence;
    char Word[] = new char[100];
    int count[] = new int[26];
    char[] Alpha = {'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'};

    while(scanner.hasNext()){
      Sentence = scanner.next();
      Sentence = Sentence.toLowerCase();
      for(int i=0;i<Sentence.length();i++){
        Word[i] = Sentence.charAt(i);
        for(int j=0;j<26;j++){
          if(Word[i]==(Alpha[j])){
            count[j]++;
          }
      }
    }
  }

    for(int i=0;i<26;i++){
      System.out.println(Alpha[i] + " : " + count[i]);
    }


  }
}



Measured memory_bytes: 26184
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>   
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>

using namespace std;
#define int  long long
 
#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(),(x).end()

// int DP[MEM_SIZE][MEM_SIZE] = {0};
// int GMEM[MEM_SIZE][MEM_SIZE] = {0};
template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);};
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; exit(0);}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
template<typename T> vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts> auto make_v(size_t a,Ts... ts){   return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...)); }
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){ for(auto &e:t) fill_v(e,v); }
template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value!=0>::type fill_v(U &u,const V... v){u=U(v...);}
template<typename T,typename U,typename... V> typename enable_if<is_same<T, U>::value==0>::type fill_v(U &u,const V... v){ for(auto &e:u) fill_v<T>(e,v...);}
//FUNCTION


void solve(void)
{
  int N;
  cin>>N;
  vector<pair<int,int> > vp ;
  for (int i = 0; i < N; i++)
  {
    int A,B;
    cin>>A>>B;
    vp.emplace_back(B,A);
  }
  sort(ALL(vp));
  int SUM = 0;
  int check = 1;
  for (int i = 0; i < N; i++)
  {
    SUM += vp[i].second;
    if(SUM > vp[i].first) check = 0;
  }
  if(check == 1)
  {
    cout<<"Yes"<<endl;
  }
  else
  {
    cout<<"No"<<endl;
  }
  
  
  return;
}

int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(9);
  solve();

  return 0;
}


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

int main(){
    string s,t;
    cin >> s >> t;
    int cnt = 0; 
    for(int i = 0; i < s.size();i++){
        if(s[i] != t[i]){
            cnt++;
        }
    }
    cout << cnt << endl;
    return 0;
}




Measured memory_bytes: 3856
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        try (Scanner scanner = new Scanner(System.in)) {
            int n = Integer.parseInt(scanner.next());
            int p = Integer.MAX_VALUE;
            int r = 0;
            for (int i = 0; i < n; i++) {
                int pp = Integer.parseInt(scanner.next());
                if (pp <= p)
                    r++;
                p = Integer.min(p, pp);
            }
            System.out.println(r);
        }
    }

}


Measured memory_bytes: 49380
package main

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

func ScanSplitIntLine(size int) []int {
    scanner := bufio.NewScanner(os.Stdin)
    scanner.Split(bufio.ScanWords)
    line := make([]int, 0, size)
    for i := 0; i < size; i++ {
        scanner.Scan()
        stringInput := scanner.Text()
        intInput, err := strconv.Atoi(stringInput)
        if err != nil {
            fmt.Println(err)
        }
        line = append(line, intInput)
    }
    return line
}

func main() {
    AB := ScanSplitIntLine(2) 
    A := AB[0]
    B := AB[1]

    if A == 2 {
        fmt.Println(B - 1)
        os.Exit(0)
    }

    if B == 1 {
        fmt.Println(0)
        os.Exit(0)
    }

    if A >= B {
        fmt.Println(1)
        os.Exit(0)
    }

    tup := B / (A-1)
    if B % (A-1) > 1 {
        tup += 1
    }
    fmt.Println(tup)
}

Measured memory_bytes: 640
#include<bits/stdc++.h>
#define ll long long
#define vi vector<int>
#define rep(i,a,n) for(int i=a;i<n;i++)
#define MOD 1000000007
#define pii pair<int,int>
#define vp vector<pair<int,int>>
#define RT long
using namespace std;



void solve(){
    int ar[3][3];
    rep(i,0,3)
    	rep(j,0,3)
    		cin>>ar[i][j];


    int n;  cin>>n;
    int b[n];

    rep(k,0,n){
    	cin>>b[k];
    	rep(i,0,3){
    		rep(j,0,3){
    			if(ar[i][j]==b[k])
    				ar[i][j]=0;
    		}
    	}
    }
    int f1=0,f2=0,f3=0;
    rep(i,0,3)
   		if(!ar[i][0]&&!ar[i][1]&&!ar[i][2])
    		f1=1;

    rep(i,0,3)
		if(!ar[0][i]&&!ar[1][i]&&!ar[2][i])
    		f2=1;

    if((!ar[0][0]&&!ar[1][1]&&!ar[2][2])||(!ar[1][1]&&!ar[0][2]&&!ar[2][0]))
    		f3=1;

    if(f1||f2||f3)
    	cout<<"Yes";
    else
    	cout<<"No";

}

int main(){

    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t=1,aa,bb,cc,dd;
    //cin>>t;
    while(t--){
        solve();
        cout<<endl;
    }



}


Measured memory_bytes: 256
#ifdef loc
    #include "codes/loc_debug.h"
#else
    #include <bits/stdc++.h>
    #define pr(...)
    #define pra(a,n)
    #define praa(a,n,m)
    #define prl()
#endif
using namespace std;

typedef long long ll;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
#define sz(a) int(a.size())
const int N = 100005;


int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int n,a,b;
    cin>>n>>a>>b;
    cout<<min(n*a,b)<<endl;
}

Measured memory_bytes: 256
package main

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

var (
	readString func() string
	readBytes  func() []byte
)

func init() {
	readString, readBytes = newReadString(os.Stdin)
}

func newReadString(ior io.Reader) (func() string, func() []byte) {
	r := bufio.NewScanner(ior)
	r.Buffer(make([]byte, 1024), int(1e+11))
	r.Split(bufio.ScanWords)

	f1 := func() string {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Text()
	}
	f2 := func() []byte {
		if !r.Scan() {
			panic("Scan failed")
		}
		return r.Bytes()
	}
	return f1, f2
}

func readInt() int {
	return int(readInt64())
}

func readInt64() int64 {
	i, err := strconv.ParseInt(readString(), 10, 64)
	if err != nil {
		panic(err.Error())
	}
	return i
}

func readFloat64() float64 {
	f, err := strconv.ParseFloat(readString(), 64)
	if err != nil {
		panic(err.Error())
	}
	return f
}

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

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

func minInt64(a, b int64) int64 {
	if a < b {
		return a
	}
	return b
}

func maxInt64(a, b int64) int64 {
	if a > b {
		return a
	}
	return b
}

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

func absInt64(a int64) int64 {
	if a < 0 {
		return -a
	}
	return a
}

func sum(a []int) int {
	var ret int
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumInt64(a []int64) int64 {
	var ret int64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func sumFloat64(a []float64) float64 {
	var ret float64
	for i := range a {
		ret += a[i]
	}
	return ret
}

func gcdInt64(m, n int64) int64 {
	for m%n != 0 {
		m, n = n, m%n
	}
	return n
}

func lcmInt64(m, n int64) int64 {
	return m / gcdInt64(m, n) * n
}

// sort ------------------------------------------------------------

type int64Array []int64

func (s int64Array) Len() int           { return len(s) }
func (s int64Array) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s int64Array) Less(i, j int) bool { return s[i] < s[j] }

type xxx struct {
	x int
}

type sortArray []xxx

func (s sortArray) Len() int           { return len(s) }
func (s sortArray) Swap(i, j int)      { s[i], s[j] = s[j], s[i] }
func (s sortArray) Less(i, j int) bool { return s[i].x < s[j].x }

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

func main() {
	s := readString()

	rindices := make([]int, 0, len(s))
	lindices := make([]int, 0, len(s))
	for i := range s {
		if s[i] == 'R' {
			rindices = append(rindices, i)
		} else {
			lindices = append(lindices, i)
		}
	}

	ans := make([]int, len(s))
	prec := byte(' ')
	prej, j := 0, 0
	for i := range s {
		if s[i] == 'R' {
			if s[i] == prec {
				j = prej
			} else {
				j = lindices[sort.SearchInts(lindices, i)]
			}
			if (j-i)%2 == 0 {
				ans[j]++
			} else {
				ans[j-1]++
			}
		} else {
			if s[i] == prec {
				j = prej
			} else {
				j = rindices[sort.SearchInts(rindices, i)-1]
			}
			if (i-j)%2 == 0 {
				ans[j]++
			} else {
				ans[j+1]++
			}
		}
		prec, prej = s[i], j
	}

	for i := range ans {
		fmt.Printf("%v ", ans[i])
	}
}


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

vector<pair<ll, ll>> prime_factorize(ll n) {
    vector<pair<ll, ll>> res;
    for(ll p = 2; p*p <= n; ++p) {
        if(n%p!=0) continue;
        int num = 0;
        while(n%p==0) {++num; n/=p;}
        res.push_back(make_pair(p, num));
    }
    if(n!=1) res.push_back(make_pair(n,1));
    return res;
}

int N;
map<ll, int> mp;// mp[p] := 素因数分解における素数 p の指数
//約数の個数を mul にするような場合の数
ll f(map<ll, int>::iterator p, ll mul) {
    if(p==mp.end()) {
        if(mul==1) return 1;
        else return 0;
    }
    ll res = 0;
    for(int i = 0; i < p->second+1; ++i) {
        if(mul%(i+1)!=0) continue;
        res+=f(++p, mul/(i+1));
        --p;
    }
    return res;
}

int main() {
    cin >> N;
    for(int i = 2; i<= N; ++i) {
        auto ps = prime_factorize(i);
        for(auto it : ps) mp[it.first] += it.second;
    }
    cout << f(mp.begin(), 75) << endl;
    return 0;
}

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

ll s[100005] = {0};

ll step(ll k){
    if(k == 1 || k == 0) return 1;
    if(s[k] !=  0) return s[k];
    return s[k] = (step(k - 2) + step(k - 1))% 1000000007;

}

int main()
{

    ll n, m;
    cin >> n >> m;
    ll a[100005];
    ll sum = 1;
    a[0] = -1;
    for(ll i = 1; i <= m; i++) {
        cin >> a[i];
        if(a[i - 1] == a[i] - 1) {
            cout << 0 << endl;
            return 0;
        }
    }
    a[m + 1] = n + 1;
    for(ll i = 0; i <= m; i++){
        sum *= step(a[i + 1] - a[i] - 2);
        sum %= 1000000007;

    }
    cout << sum << endl;

    return 0;
}

Measured memory_bytes: 2560
#include<iostream>
#include<string>
using namespace std;
int main(){
  int n,i,ans = 0;string a,b,c;cin >> n >> a >> b >> c;
  for(i=0;i<n;i++){
    if(a[i]!=b[i] && b[i]!=c[i] && a[i]!=c[i]) ans += 2;
    else if(!(a[i]==b[i] && b[i]==c[i])) ans += 1;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
// lcmとか__builtin_popcountとかはg++ -std=c++17 default.cppみたいなかんじで

#include <bits/stdc++.h>
#define mod 1000000007
#define INF LLONG_MAX
#define ll long long
#define ln cout<<endl
#define Yes cout<<"Yes"<<endl
#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl
#define No cout<<"No"<<endl
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
#define all(x) (x).begin(),(x).end()
#define rall(x) (x).rbegin(),(x).rend()
using namespace std;
ll dx[4]={1,0,-1,0};
ll dy[4]={0,1,0,-1};

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

    ll  a,b,c,d,e,n,k,maxi=0,f=0,mini=INF,sum=0,q;
	string str,stra,straa;
    ll x,y,z;
    char ca,cb,cc;
    cin>>n;
    if(n==1){
        cout<<"Hello World";
    }else{
        cin>>a>>b;
        cout<<a+b<<endl;
    }

    

    return 0;
}


Measured memory_bytes: 3556
#include <iostream>
using namespace std;
int main(void){
    int N,T;
    
    cin >> N >> T ;
    int h[N][2];
    int min =1001;
    int count =0;
    for (int i=0;i<N;i++)
    {
        cin >> h[i][0] >> h[i][1];
        if(h[i][1] <= T)
        {
            if(min > h[i][0])
            {
                min = h[i][0];
                count ++;
            }
        }
    }
    if(count >0)
    {
        cout << min << endl;
    }
    else
    {
        cout <<"TLE" << endl;
    }
    
    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define rrep(i,n) for( int i = n; i >= 0; i-- )
#define REP(i,s,t) for( int i = s; i <= t; i++ )
#define RREP(i,s,t) for( int i = s; i >= t; i-- )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N; cin >> N;
    double ans = 0;
    rep(i, N) {
        double x;
        string u;
        cin >> x >> u;
        if (u == "JPY") {
            ans += x;
        } else {
            ans += x * 380000.0;
        }
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
using System;

namespace ABC125
{
    class Program
    {
		static uint CalcGDC(uint a, uint b)
		{
			uint large, small;
			if (a < b)
			{
				large = b;
				small = a;
			} else
			{
				large = a;
				small = b;
			}
			while (small != 0)
			{
				uint tmp = large;
				large = small;
				small = tmp % small;
			}
			return large;
		}
		static Boolean judgeDivisible(uint pal, uint[] array)
		{
			if (pal == 0)
			{
				return false;
			}
			uint count = 0;
			foreach (uint item in array)
			{
				if (item % pal != 0)
				{
					count++;
					if (count > 1)
					{
						return false;
					}
				}
			}
			return true;
		}
        static void Main(string[] args)
        {
			// 入力受付
			uint N = uint.Parse(Console.ReadLine());
			uint[] A = Array.ConvertAll(Console.ReadLine().Split(' '), uint.Parse);
			if (A.Length < N)
			{
				Console.WriteLine("wrong input.");
			}
			// 計算(下から1,2番目の値を求めて、その値の約数を用いて全探索)
			uint min = A[0], nextmin = A[1];
			if (nextmin < min)
			{
				uint tmp = min;
				nextmin = min;
				min = tmp;
			}
			for (int i = 1; i < N; i++)
			{
				if (A[i] < nextmin)
				{
					if (min < A[i])
					{
						nextmin = A[i];
					} else
					{
						nextmin = min;
						min = A[i];
					}
				}
			}
			uint ans = 1;
			for (uint i = 1; i * i < min; i++)
			{
				if (min % i == 0)
				{
					uint inv = min / i;
					if (ans < inv && judgeDivisible(inv, A))
					{
						ans = inv;
						break;
					} else if (ans < i && judgeDivisible(i, A))
					{
						ans = i;
					}
				}
			}
			for (uint i = 1; i * i < nextmin; i++)
			{
				if (nextmin % i == 0)
				{
					uint inv = nextmin / i;
					if (ans < inv && judgeDivisible(inv, A))
					{
						ans = inv;
						break;
					} else if (ans < i && judgeDivisible(i, A))
					{
						ans = i;
					}
				}
			}
			// 結果出力
			Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 27100
#include <array>
#include <cmath>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <set>
#include <string>
#include <tuple>
#include <utility>
#include <vector>

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;

int main() {
    string N;
    cin >> N;
    if(N[0] == '7' || N[1] == '7' || N[2] == '7')
        cout << "Yes" << endl;
        else
        cout << "No" << endl;


    return 0;
}


Measured memory_bytes: 3628
#include <stdio.h>
#include <iostream>
#include <vector>
#include <tuple>
using namespace std;

#define NUM 100
#define NIL -1
#define INF 1000000000
#define WHITE 0
#define BLACK 1
int node_num;
vector<tuple<int, int>> G[NUM];
int V[NUM];
int color[NUM];

void init(void){
    scanf("%d", &node_num);

    for(int i = 0; i < node_num; i++){
        int u, k;
        scanf("%d", &u);
        scanf("%d", &k);

        for(int j = 0; j < k; j++){
            int v_, c;
            scanf("%d", &v_);
            scanf("%d", &c);
            G[u].push_back(make_tuple(v_, c));
        }
    }

    for(int i = 0; i < node_num; i++){
        color[i] = WHITE;
        V[i] = INF;
    }
}

void updateAround(int n){
    color[n] = BLACK;
    for(int i = 0; i < G[n].size(); i++){
        V[get<0>(G[n][i])] = min(V[get<0>(G[n][i])], V[n] + get<1>(G[n][i]));
    }

    int min_index = NIL;
    int min_value = INF;
    for(int i = 0; i < node_num; i++){
        if(color[i] == BLACK){
            continue;
        }
        if(V[i] < min_value){
            min_value = V[i];
            min_index = i;
        }
    }
    if(min_index != NIL){
        updateAround(min_index);
    }
}

int main(void){
    init();

    V[0] = 0;
    updateAround(0);

    for(int i = 0; i < node_num; i++){
        printf("%d %d\n", i, V[i]);
    }
}





Measured memory_bytes: 3212
#include <iostream>
#include <vector>
#include <cstdlib>
#include <cmath>
#include <string>
#include <algorithm>
 
using namespace std;
 
int main(){
    string s;
    cin >> s;
    if(s == "ABC"){
        cout << "ARC" << endl;
    }
    else{
        cout << "ABC" << endl;
    }
}

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

int main(){
    int a, b;
    std::cin >> a >> b;
    
    for(int i = 1; i <= 10000; i++){
        int a_val = i * 0.08;
        int b_val = i * 0.10;
        if(a == a_val && b == b_val){
            std::cout << i << std::endl;
            return 0;
        }
    }
    std::cout << -1 << std::endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fio ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
#define Mod 1000000007
#define ll long long
#define dd double
#define pb push_back
#define ff first
#define ss second
#define Mp make_pair
#define INF 999999999999999999
#define NN (ll)(1e6+5)
int mod(string s,int a) 
{ 
    int ans=0; 
    for (int i=0;i<s.length();i++) 
         ans=(ans*10+(int)s[i]-'0')%a; 
    return ans; 
}
ll min(ll x,ll y){if(x<y) return x;return y;}
ll max(ll x,ll y){if(x>y) return x;return y;}
ll power(ll x,unsigned ll y) 
{ 
    if (y==0) 
        return 1; 
    else if (y%2==0) 
        return power(x,y/2)*power(x,y/2); 
    else
        return x*power(x,y/2)*power(x,y/2); 
}
ll hcf(ll a,ll b) 
{ 
    if(b==0) 
        return a; 
    return hcf(b,a%b);  
}
int main()
{
   fio;
   /*#ifndef ONLINE_JUDGE 
    	freopen("input.txt", "r", stdin); 
    	freopen("output.txt", "w", stdout); 
    	freopen("error.txt", "w", stderr); 
   #endif*/
   ll TT=1;
   //cin>>TT;
   while(TT--)
   {    
       ll a,b,c,k,ans=0;
       cin>>a>>b>>c>>k;
       ans=min(k,a)-min(max(0,k-a-b),c);
       cout<<ans<<"\n";
   }
}

Measured memory_bytes: 3648
N = int(input())
F = [list(map(int, input().split())) for k in range(N)]
P = [list(map(int, input().split())) for k in range(N)]
B = [format(k,'b').zfill(10) for k in range(1,1024)]
ans = -10**9

for d in B:
    t = 0
    E = [0 for k in range(N)]
    for l in range(N):
        for k in range(10):
            E[l] += int(d[k])*F[l][k]
    for k in range(N):
        t += P[k][E[k]]
    ans = max(t,ans)

print(ans)

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

using namespace std;

int main()
{
	string str;
	cin >> str;
	int additional=0;

	for (int i = 0; i < 3; i++) {
		if (str[i] == 'o') {
			additional += 100;
		}
	}
	cout << 700+additional << endl;

	return 0;
}

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

using namespace std;

int main() {
    string s;
    getline(cin, s);
    
    int first = 0, second = 0;
    for (string::size_type i = 0; i < s.size(); i++)
    {
        if (i % 2 == 0)
        {
            if (s[i] == '1')
            {
                second++;
            } else {
                first++;
            }
        } else {
            if (s[i] == '0')
            {
                second++;
            } else {
                first++;
            }
        }
    }

    cout << min(first, second);
}


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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second

#define all(x) (x).begin(),(x).end()

void solve() {
  int a, b, c;
  cin >> a >> b >> c;
  if (b - a == c - b) cout << "YES" << '\n';
  else cout << "NO" << '\n';
}

signed main() {
#ifdef _DEBUG
  // freopen("in" , "r", stdin );
  // freopen("out", "w", stdout);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int T = 1;
  // cin >> T;
  while (T--) solve();
}


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

using ll = long long int;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	ll n;
	cin >> n;
	ll minimo = 1e18;
	for(ll a = 1; a*a <= n; a++){
		if(n%a != 0) continue;
		ll b = n/a;
		minimo = min(minimo, a+b-2);
	}
	cout << minimo << endl;
	return 0;
} 

Measured memory_bytes: 256
#ifdef _DEBUG
#include "MyLib.h"
#else
#define main_B main
#include "bits/stdc++.h" 
#include <regex>
#define _USE_MATH_DEFINES
#include <math.h>
#define FOR(i,s,e) for (int i = int(s); i < int(e); ++i)
#define REP(i,e) FOR(i,0,e)
#define INF (INT_MAX/2)
#define EPS (1.0e-8)
#define LINF (LONG_MAX/2)
const int MGN = 8;
const int ARY_SZ_MAX = 10000000;
using namespace std;
using ll = long long; using ull = unsigned long long;
using vi = vector<int>; using vvi = vector<vi>; using vvvi = vector<vvi>;
using vb = vector<bool>; using vvb = vector<vb>; using vvvb = vector<vvb>;
using vl = vector<ll>; using vvl = vector<vl>;
using vd = vector<double>; using vs = vector<string>;
using pii = pair<int, int>; using pll = pair<ll, ll>;
// functions

#endif



void dfs(int n, int& cnt) {
    if (n % 100 != 0) return;

    cnt++;
    dfs(n / 100, cnt);
}

int main_B() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll D, N; cin >> D >> N;

    ll M = 1;
    REP(i, D) M *= 100;

    int j = 0;
    ll ans = 0;
    FOR(i,1,M*(N+2)) {
        int cnt = 0;
        dfs(i, cnt);
        if (cnt == D) j++;
        if (j == N) {
            ans = i;
            break;
        }
    }

    cout << ans << endl;

    return 0;
}

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

int main() {
    int h, w;
    cin >> h >> w;
    vector<string> pic(h);
    rep(i,h) {
        cin >> pic[i];
    }
    rep(i,2*h) {
        cout << pic[i/2] << endl;
    }
}

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

string s, a;
int n;

int main()
{
    cin >> s >> n;
    for(int i = 0; i < s.size(); i++){
        if(i % n == 0){
            a += s[i];
        }
    }
    cout << a << endl;



    return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <cstdio>
#include <cstring>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <vector>

using namespace std;

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

int amt[3];
void solve() {
  string s;
  cin >> s;
  for(int i = 0; i < s.size(); i++) amt[s[i]-'a']++;
  sort(amt, amt+3);
  if(amt[2] - amt[0] <= 1) cout << "YES\n";
  else cout << "NO\n";
}

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL); cout.tie(NULL);
  /*
  int t;
  cin >> t;
  for(int i = 1; i <= t; i++) {
    cout << "Case #" << i << ": ";
    solve();
  }
  */
  solve();
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  
  if(N%10==2 || N%10==4 || N%10==5 || N%10==7 || N%10==9)
    cout << "hon" << endl;
  else if(N%10==0 || N%10==1 || N%10==6 || N%10==8)
    cout << "pon" << endl;
  else
    cout << "bon" << endl;
}

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

int main() {
	string s;
	int n;
	bool out = false;

	cin >> s;
	n = (int)s.size();
	for (int i = 0; i < n / 2; i++) {
		if (s[i] != s[n - 1 - i]) {
			out = true;
			break;
		}
	}
	for (int i = 0; i < n / 4; i++) {
		if (s[i] != s[(n - 1)/ 2 - 1 - i]) {
			out = true;
			break;
		}
	}
	for (int i = (n + 3) / 2; i < (3 * n / 4); i++) {
		if (s[i] != s[n - 1 - i]) {
			out = true;
			break;
		}
	}
	if (out)cout << "No" << endl;
	else cout << "Yes" << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <algorithm>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <cstdio>
#include <cmath>
#include <tuple>
#include <iomanip>
#include <numeric>
#include <unordered_map>
#include <sstream>
#include<limits.h>
#include<float.h>
#include<list>
#include <array>
#include <complex>
#include<stdio.h>
#include<string.h>
#include <bitset>
#include<assert.h>

using namespace std;
#define int long long

#define I32_MAX 2147483647
#define I64_MAX 9223372036854775807LL
#define I64_MAX2 1223372036854775807LL
#define INF I64_MAX2
#define MOD 1000000007
#define MEM_SIZE 10000
#define DEBUG_OUT true
#define ALL(x) (x).begin(), (x).end()

template<typename T> void DEBUG(T e){if(DEBUG_OUT == false)return; std::cout << e <<" ";}
template<typename T> void DEBUG(const std::vector<T>& v){if(DEBUG_OUT == false)return;for(const auto& e : v){std::cout<< e << " "; } std::cout << std::endl;}
template<typename T> void DEBUG(const std::vector<std::vector<T> >& vv){if(DEBUG_OUT == false)return;for(const auto& v : vv){ DEBUG(v); } }
template<class T,class... Ts> void DEBUG(T d, Ts... e){if(DEBUG_OUT == false)return;DEBUG(d);DEBUG(e...);}
template <class T> void corner(bool flg, T hoge) {if (flg) {cout << hoge << endl; abort();}}
template< typename T1, typename T2 > inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template< typename T1, typename T2 > inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }


void solve(void)
{
  string str;
  cin>>str;
  int N = str.size();
  int flag = 0;
  if(str.front() == str.back())flag = 1;
  if((N%2 == 1) ^ flag)
  {
    cout<<"First"<<endl;
  }
  else
  {
    cout<<"Second"<<endl;
  }
  

  

  return;
}
int32_t main(int32_t argc, const char *argv[])
{
  std::ios::sync_with_stdio(false);
  std::cin.tie(0);

  std::cout << std::fixed;
  std::cout << std::setprecision(11);
  solve();

  return 0;
}


Measured memory_bytes: 512
#define _USE_MATH_DEFINES
#include <iostream>
#include <string>
#include <list>
#include <vector>
#include <queue>
#include <algorithm>
#include <climits>
#include <cstring>
#include <cmath>
#include <stack>
#include <iomanip>
#include <tuple>
#include <functional>
#include <cfloat>
#include <map>

#define int long long
#define CONTAINS(v,n) (find((v).begin(), (v).end(), (n)) != (v).end())
#define SORT(v) sort((v).begin(), (v).end())
#define RSORT(v) sort((v).rbegin(), (v).rend())
#define ARY_SORT(a, size) sort((a), (a)+(size))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define REMOVE(v,a) (v.erase(remove((v).begin(), (v).end(), (a)), (v).end()))
#define REVERSE(v) (reverse((v).begin(), (v).end()))
#define LOWER_BOUND(v,a) (lower_bound((v).begin(), (v).end(), (a)))
#define UPPER_BOUND(v,a) (upper_bound((v).begin(), (v).end(), (a)))
#define REP(i, n) for (int (i) = 0; (i) < (n); (i)++)
#define CONTAINS_MAP(m, a) (m).find((a)) != m.end()
using namespace std;

int X, Y;

signed main()
{
	cin >> X >> Y;

	int ans = 0;
	int cur = X;
	while (true)
	{
		if (cur > Y)
		{
			break;
		}

		ans++;

		if (cur == 1)
		{
			cur = 2;
		}
		else
		{
			cur *= 2;
		}
	}

	cout << ans << endl;
}



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

string  a , b ;

int main()
{
	cin >> a >> b ;
	int x = stoi(a);
	int y = stoi(b);
	int counter =0;
		
	for ( int i=x ; i<=y ; ++i)
		if ( (i%10) == (i/10000) &&  (i%100)/10 == (i/1000)%10 )
			counter++;
	
	cout << counter ;
	
	return 0;
}


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

int main(){
  int h1, h2, k1, k2, a, b, c, d, H, K;

  cin >> h1 >> h2 >> k1 >> k2 >> a >> b >> c >> d;
  H = h1*a + (h1/10)*c + h2*b + (h2/20)*d;
  K = k1*a + (k1/10)*c + k2*b + (k2/20)*d;

  if ( H > K ) cout << "hiroshi" << endl;
  else if ( H < K ) cout << "kenjiro" << endl;
  else cout << "even" << endl;

  return 0;
}


Measured memory_bytes: 3104
#include<iostream>
#include<string>
#include<queue>
#include<map>
using namespace std;

int n;
string a[10],b[10];
string g,d;

inline string replace(string t, int id){
  int pos = t.find(a[id]);
  while(pos != -1){
    t.replace(pos,a[id].size(),b[id]);
    pos = t.find(a[id],pos + b[id].size());
  }
  return t;
}

int main(){
  while(cin >> n,n){
    for(int i=0;i<n;i++)cin >> a[i] >> b[i];
    cin >> g >> d;

    map<string,int> m;
    m[g] = 0;
    queue<string> q;
    q.push(g);

    while(q.size()){
      string s = q.front(); q.pop();
      if(s == d)break;
      int cost = m[s]+1;
      
      for(int i=0;i<n;i++){
	string t = replace(s,i);
	if(t.size()<=d.size() && m.find(t) == m.end()){
	  m[t] = cost;
	  q.push(t);
	}
      }
    }

    if(m.find(d) == m.end())cout << -1 << endl;
    else cout << m[d] << endl;
  }
}

Measured memory_bytes: 1472
#define _USE_MATH_DEFINES
#include <cassert>
#include <cstdio>
#include <cstring>
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <queue>
#include <stack>
#include <list>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <algorithm>
#include <complex>
#include <cmath>
#include <numeric>
#include <bitset>
#include <functional>
#include <random>
#include <ctime>

using namespace std;

#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << ": " << arg1 << endl;
}
template <typename Arg1, typename... Args>
void __f(const char* names, Arg1&& arg1, Args&&... args){
  const char* comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << ": " << arg1 << " |";
  __f(comma + 1, args...);
}

typedef long long int64;
typedef pair<int, int> ii;
const int INF = 1 << 29;
const int MOD = 1e9 + 7;

int64 toint(const string& s) {
  stringstream ss(s);
  int64 ret;
  ss >> ret;
  return ret;
}

int main() {
  string s;
  cin >> s;
  int n = s.size();
  int m = n - 1;
  vector<int> pos;
  int64 ret = 0;
  for (int k = 0; k < (1 << m); ++k) {
    pos.clear();
    for (int i = 0; i < m; ++i) {
      if (k & (1 << i)) pos.push_back(i + 1);
    }
    int last = 0;
    for (int i = 0; i < pos.size(); ++i) {
      ret += toint(s.substr(last, pos[i] - last));
      last = pos[i];
    }
    ret += toint(s.substr(last));
  }
  cout << ret << endl;
  return 0;
}


Measured memory_bytes: 256
N, M = map(int, input().split())


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)
        if x == y:
            return
        if self.parents[x] > self.parents[y]:
            x, y = y, x
        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r))
                         for r in self.roots())


uf = UnionFind(N + 1)
for _ in range(M):
    a, b = map(int, input().split())
    uf.union(a, b)


ans = 0
now = 1
for i in range(1, N + 1):
    if i == 1:
        continue

    if uf.same(now, i):
        continue
    else:
        uf.union(now, i)
        ans += 1
print(ans)


Measured memory_bytes: 10728
// import scala.io.StdIn._
import java.util.Scanner

object Main extends App {
  def readALine(c:Int):List[Int] = if (c > 0) sc.nextInt::readALine(c-1) else Nil
  def readLines(r:Int, c:Int):List[List[Int]] = if (r > 0) readALine(c)::readLines(r-1, c) else Nil
  val sc = new Scanner(System.in)
  val n, m, x = sc.nextInt
  val ls = readLines(n, m+1)
//  println(ls)

  def opVecs(op:(Int, Int)=>Int,a:List[Int],b:List[Int],ac:List[Int]):List[Int] = {
    (a, b) match {
      case (Nil, Nil) => ac.reverse
      case (x::xs, y::ys) => opVecs(op, xs, ys, op(x,y)::ac)
    }
  }
  def add(a:List[Int],b:List[Int]):List[Int] = opVecs((x,y)=>x+y, a, b, Nil)
  def sub(a:List[Int],b:List[Int]):List[Int] = opVecs((x,y)=>x-y, a, b, Nil)
  def sum(m:List[List[Int]]):List[Int] = {
    def iter(m:List[List[Int]],ac:List[Int]):List[Int] = {
      m match {
        case Nil => ac
        case x::xs => iter(xs, add(x, ac)) 
      }
    }
    val s = m(0).length
    iter(m, List.fill(s)(0))
  }

  def haveAchieved(v:List[Int],x:Int):Boolean = v.forall((a) => a>=x)

  def evaluate(books:List[List[Int]], cost:Int, grades:List[Int], minCost:Int):Int = {
    books match {
      case Nil => if (haveAchieved(grades, x))
                    if (cost < minCost) cost else minCost
                  else minCost
      case (c::el)::xs if (c + cost <  minCost) => {
        val newMinCost = evaluate(xs, c+cost, add(el, grades), minCost)
        evaluate(books.tail, cost, grades, newMinCost)
      }
      case _ => evaluate(books.tail,cost,grades,minCost)
    }

  }

  val bound = 12*100000+1
  val result = evaluate(ls, 0, List.fill(m)(0), bound)
  println(if (result < bound) result else -1)  
}


Measured memory_bytes: 57164
#include<bits/stdc++.h>
using namespace std;
#define ll long long
void solve(){
	ll n;
	cin>>n;
	ll ans=0;
	for(int i=1;i<=n;i++){
		if(n%i==0){
			ans=ans+n/i-1;
		}else{
			ans=ans+n/i;
		}
		
	}
	cout<<ans<<"\n";
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	long t=1;
//	cin>>t;
	while(t--)
		solve();
}

Measured memory_bytes: 3564
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
const ll mod = 1e9+7;

int main(){
    string s;
    cin >> s;
    int k = s.size();
    int cnt = 0;
    for(int i = 0; i < k; i++){
        if(s[i] == 'o') cnt++;
    }
    if(15-k+cnt >= 8) cout << "YES" << endl;
    else cout << "NO" << endl;
    
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i,b,e) for (common_type_t <decltype (b), decltype (e)> i = (b), i ## __end = (e); i < i ## __end; ++ i)
#define FORR(i,b,e) for (common_type_t <decltype (b), decltype (e)> i = (e), i ## __begin = (b); i -- > i ## __begin;)
#define rep(i,n) for (decay_t <decltype (n)> i = 0, i ## __len = (n); i < i ## __len; ++ i)
#define ALL(x) begin (x), end (x)
#define dump(x) cerr << #x " = " << boolalpha << (x) << endl;
using namespace std;
template <typename T>
inline auto input () { T a; return cin >> a ? a : throw runtime_error ("no input"); }

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

  auto a = input <int> ();
  auto b = input <int> ();
  auto t = input <int> ();

  auto ans = t / a * b;
  cout << ans << endl;
}



Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<unordered_map>
using namespace std;
typedef long long ll;
typedef double D;
const ll inf=(1ll<<61);
const ll mod=1e9+7;
const int MX=302;
int n,k,dp[MX][MX][MX];
string s,t;
int DP(int x,int y,int k){
    if(k<0)return -MX*2;
    if(x>y)return 0;
    if(x==y)return 1;
    int &ret=dp[x][y][k];if(ret!=-1)return ret;
    ret=DP(x+1,y,k);
    ret=max(ret,DP(x,y-1,k));
    if(s[x]==s[y]){
        ret=max(ret,DP(x+1,y-1,k)+2);
    }
    ret=max(ret,DP(x+1,y-1,k-1)+2);
    return ret;
}
int main(){
    cin>>s>>k;n=s.size();
    memset(dp,-1,sizeof(dp));
    cout<<DP(0,n-1,k)<<endl;
}


Measured memory_bytes: 108032