akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
#define N 110000
#define LL long long
using namespace std;
LL sta[N],a[N],t[N],s[N],ans;
int tp,n,m;
int td(LL k,int r)
{
    int l=1,res=0;
    while(l<=r)
    {
        int mid=(l+r)/2;
        if(a[mid]<=k) res=mid,l=mid+1;
        else r=mid-1;
    }
    return res;
}
int main()
{
    scanf("%d%d",&n,&m);
    sta[tp=1]=n;
    for(int i=1;i<=m;i++)
    {
        LL x;scanf("%lld",&x);
        while(x<=sta[tp]) tp--;
        sta[++tp]=x;
    }
    m=tp;
    for(int i=1;i<=m;i++) a[i]=sta[i];
    t[m]=1;
    for(int i=m;i>=1;i--)
    {
        LL k=a[i];int p=td(k,i-1);
        while(p)
        {
            t[p]+=(k/a[p])*t[i];
            k%=a[p];
            p=td(k,p-1);
        }
        s[1]+=t[i];s[k+1]-=t[i];
    }
    for(int i=1;i<=n;i++) {ans+=s[i];printf("%lld\n",ans);}
    return 0;
}

Measured memory_bytes: 4864
/**
*    author:  souzai32
*    created: 23.08.2020 18:33:00
**/

#include <bits/stdc++.h>
#define all(x) (x).begin(),(x).end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
typedef long long ll;
#define mod 1000000007
using namespace std;


int main() {

    int n,m;
    cin >> n >> m;
    vector<int> p(0);
    
    for(int i=1; i*i<=m; i++){
        if(m%i==0){
            p.push_back(i);
            if(i!=m/i) p.push_back(m/i);
        }
    }
    sort(all(p));

    // rep(i,p.size()) cout << p[i] << endl;
    // cout << p.size() << endl;

    int left=0, right=p.size()-1,mid;
    int ans=1;
    rep(i,p.size()){
        if(p[i]>=n){
            ans=p[i];
            break;
        }
    }

    cout << m/ans << endl;

    return 0;
}

Measured memory_bytes: 3604
#include<bits/stdc++.h>
using namespace std;
#define ck cout<<" xxx  "<<endl
typedef long long ll;
const int maxn=1e3+100;
const int maxc=26;
const int inf=0x3f3f3f3f;
ll n,m;
ll a[maxn];
bool cmp(ll x,ll y){
    return x>y;
}
int main()
{
    cin>>n>>m;
    double sum=0;
    for(int i=0;i<n;i++){
        scanf("%lld",&a[i]);
        sum+=a[i];
    }
    sort(a,a+n,cmp);
    double x=sum/(4*m);
    if(a[m-1]>=x)
        puts("Yes");
    else
        puts("No");
    return 0;
}
/*

*/


Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
using namespace std;
int main() {
	int n,bef=0,c=0,a;
	cin >> n;
	for (int i = 1; i <= n; i++) {
		cin >> a;
		if (a == i&&bef == 0) {
			c++;
			bef = 1;
		}
		else bef = 0;
	}
	cout <<c<< endl;
}

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

using namespace std;

int main(){
  int64_t a,b,k;
  cin >> a >> b >> k;
  if(a<=k){
    b=b-(k-a);
    a=0;
  }
  else{
    a=a-k;
  }
  if(b<0){
    b=0;
  }
  cout << a << " " << b << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, a, b) for(int i = a; i < b; i++)
#define Rep(i, a, b) for(int i = a; i <= b; i++)
#define _GLIBCXX_DEBUG
#define Vl vector<ll>
#define Vs vector<string>
#define Vp vector<pair<ll, ll>>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
using namespace std;
const double pi = acos(-1.0);
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
using Graph = vector<vector<int>>;

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

  ll n;
  cin >> n;
  Vl a(n);
  rep(i, 0, n) cin >> a[i];
  sort(ALL(a));
  cout << a[n-1] - a[0] << endl;

  return 0;
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))
b = list(map(int, input().split()))
c = list(map(int, input().split()))


a.sort()
b.sort()
c.sort()

ans = 0
j = 0
k = 0


for i in range(n):
    if j<n:
        while a[j]<b[i]:
            j+=1
            if j==n:
                break
    if k<n:
        while c[k]<=b[i]:
            k+=1
            if k==n:
                break

    ans += j*(n-k)


print(ans)

Measured memory_bytes: 105444
#include <bits/stdc++.h>
#define For( i, j, k ) for( int i = j; i <= k; ++i )
using std::cin;
using std::cout;
using std::vector;
using std::pair;
using std::string;
long long dp[ 20 ], sum[ 20 ], a[ 20 ];
string s;
int main( )
{
	std::ios::sync_with_stdio( false );
	cin >> s;
	dp[ 0 ] = 1;
	For( i, 1, ( int ) s.size( ) )
	{
		dp[ i ] = dp[ i - 1 ] * 2;
		sum[ i ] = sum[ i - 1 ] * 10 + dp[ i - 1 ] * ( s[ i - 1 ] - '0' );
		if( i != s.size( ) )
			a[ i ] = a[ i - 1 ] * 2 + sum[ i ];
		else
			a[ i ] = a[ i - 1 ] + sum[ i ];
	}
	cout << a[ s.size( ) ];
	return 0;
}

Measured memory_bytes: 3616
package main

import (
	"fmt"
	"sort"
)

const MOD = 1000000007

func ModAdd(a, b int64) int64 {
	return (a + b) % MOD
}

func ModMul(a, b int64) int64 {
	return a * b % MOD
}

func ModSub(a, b int64) int64 {
	r := (a%MOD - b%MOD) % MOD
	if r < 0 {
		r += MOD
	}
	return r
}

func ModDiv(a, b int64) int64 {
	return a % MOD * ModInv(b) % MOD
}

func ModPow(a, n int64) int64 {
	var r int64 = 1
	for n > 0 {
		if n&1 == 1 {
			r = r * a % MOD
		}
		a = a * a % MOD
		n >>= 1
	}
	return r
}

func ModInv(a int64) int64 {
	var b, u, v int64 = MOD, 1, 0
	for b > 0 {
		t := a / b
		a -= t * b
		a, b = b, a
		u -= t * v
		u, v = v, u
	}
	u %= MOD
	if u < 0 {
		u += MOD
	}
	return u
}

type Q struct {
	idx, value int
	index      int
}

type QS []*Q

func (p QS) Len() int           { return len(p) }
func (p QS) Less(i, j int) bool { return p[i].value > p[j].value }
func (pq QS) Swap(i, j int) {
	pq[i], pq[j] = pq[j], pq[i]
	pq[i].index = i
	pq[j].index = j
}

func (pq *QS) Push(x interface{}) {
	n := len(*pq)
	item := x.(*Q)
	item.index = n
	*pq = append(*pq, item)
}

func (pq *QS) Pop() interface{} {
	old := *pq
	n := len(old)
	item := old[n-1]
	old[n-1] = nil  // avoid memory leak
	item.index = -1 // for safety
	*pq = old[0 : n-1]
	return item
}

type R []rune

func (p R) Len() int           { return len(p) }
func (p R) Less(i, j int) bool { return p[i] > p[j] }
func (p R) Swap(i, j int) {
	p[i], p[j] = p[j], p[i]
}

func main() {
	var N int
	fmt.Scanf("%d\n", &N)

	cnt := 0
	m := map[string]int{}
	for i := 0; i < N; i++ {
		var s string
		fmt.Scan(&s)
		r := R(s)
		sort.Sort(r)
		if c := m[string(r)]; c > 0 {
			cnt += c
			m[string(r)]++
		} else {
			m[string(r)]++
		}
	}

	fmt.Println(cnt)
}


Measured memory_bytes: 11136
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define stoi stoll
using ll=long long;
using vi=vector<int>;
using pii=pair<int,int>;
#define ALL(c) begin(c),end(c)
#define RALL(c) rbegin(c),rend(c)
#define ITR(i,b,e) for(auto i=(b);i!=(e);++i)
#define FORE(x,c) for(auto &x:c)
#define REPF(i,a,n) for(int i=a,i##len=(int)(n);i<i##len;++i)
#define REP(i,n) REPF(i,0,n)
#define REPR(i,n) for(int i=(int)(n);i>=0;--i)
#define SZ(c) ((int)c.size())
#define CONTAIN(c,x) (c.find(x)!=end(c))
#define INSEG(l,x,r) ((l)<=(x)&&(x)<(r))
#define dump(...)
#define pb push_back
#define _ 0
const signed INF_=1001001001; const long long INF=1001001001001001001LL;
const int DX[9]={0,1,0,-1,1,1,-1,-1,0},DY[9]={-1,0,1,0,-1,1,1,-1,0};
template<class T> ostream& operator<<(ostream &os,const vector<T> &v) {
    ITR(i,begin(v),end(v))os<<*i<<(i==end(v)-1?"":" ");return os;}
template<class T> istream& operator>>(istream &is,vector<T> &v) {
    ITR(i,begin(v),end(v)) is>>*i;return is;}
template<class T,class U> istream& operator>>(istream &is, pair<T,U> &p) {
    is>>p.first>>p.second;return is;}
template<class T, class U> bool chmax(T &a,const U &b){return a<b?a=b,1:0;}
template<class T, class U> bool chmin(T &a,const U &b){return a>b?a=b,1:0;}
template<class T> using heap=priority_queue<T,vector<T>,greater<T>>;
struct before_main_function {
    before_main_function() {
        cin.tie(0); ios::sync_with_stdio(false);
        cout << setprecision(15) << fixed;
        #define endl "\n"
    }
} before_main_function;
//------------------8<------------------------------------8<--------------------

// 1-indexed
struct BIT {
    vector<int> data;
    int size;
    BIT(int n): size(n + 1), data(n + 1, 0) {}
    void add(int i, int x) {
        while (i <= size) {
            data[i] += x;
            i += i & -i;
        }
    }
    int sum(int i) {
        int ret = 0;
        while (i > 0) {
            ret += data[i];
            i -= i & -i;
        }
        return ret;
    }
};

signed main() {
    int N, K;
    cin >> N >> K;
    vi a(N);
    cin >> a;
    
    vi S(N), T(N);
    S[0] = a[0];
    REPF(i, 1, N) S[i] = S[i - 1] + a[i];
    REP(i, N) T[i] = S[i] - K * (i + 1);

    auto tmp = T;
    tmp.pb(0);
    sort(ALL(tmp));
    auto get = [&](int x) { return lower_bound(ALL(tmp), x) - begin(tmp); };

    BIT bit(N + 1);
    bit.add(get(0) + 1, 1);
    int ans = 0;
    REP(i, N) {
        int idx = get(T[i]);
        ans += bit.sum(idx + 1);
        bit.add(idx + 1, 1);
    }
    cout << ans << endl;
    return (0^_^0);
}



Measured memory_bytes: 9472
import java.util.*;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] W = new int[N];
		int total = 0;
		for(int i = 0; i < N; i++) {
			W[i] = sc.nextInt();
			total += W[i];
		}
		int ans = Integer.MAX_VALUE;
		int ruiseki = 0;
		for(int i = 0; i < N; i++) {
			total -= W[i];
			ruiseki += W[i];
			ans = Math.min(ans, Math.abs(total-ruiseki));
		}
		System.out.println(ans);

	}

}

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

#############
# Libraries #
#############

import sys
input = sys.stdin.readline

import math
from collections import deque
from fractions import gcd
from functools import lru_cache


#############
# Constants #
#############

MOD = 10**9+7
INF = float('inf')

#############
# Functions #
#############

######INPUT######
def inputI(): return int(input().strip())
def inputS(): return input().strip()
def inputIL(): return list(map(int,input().split()))
def inputSL(): return list(map(str,input().split()))
def inputILs(n): return list(int(input()) for _ in range(n))
def inputSLs(n): return list(input().strip() for _ in range(n))
def inputILL(n): return [list(map(int, input().split())) for _ in range(n)]
def inputSLL(n): return [list(map(str, input().split())) for _ in range(n)]

#####Inverse#####
def inv(n): return pow(n, MOD-2, MOD)

######Combination######
kaijo_memo = []
def kaijo(n):
  if(len(kaijo_memo) > n):
    return kaijo_memo[n]
  if(len(kaijo_memo) == 0):
    kaijo_memo.append(1)
  while(len(kaijo_memo) <= n):
    kaijo_memo.append(kaijo_memo[-1] * len(kaijo_memo) % MOD)
  return kaijo_memo[n]

gyaku_kaijo_memo = []
def gyaku_kaijo(n):
  if(len(gyaku_kaijo_memo) > n):
    return gyaku_kaijo_memo[n]
  if(len(gyaku_kaijo_memo) == 0):
    gyaku_kaijo_memo.append(1)
  while(len(gyaku_kaijo_memo) <= n):
    gyaku_kaijo_memo.append(gyaku_kaijo_memo[-1] * pow(len(gyaku_kaijo_memo),MOD-2,MOD) % MOD)
  return gyaku_kaijo_memo[n]

def nCr(n,r):
  if(n == r):
    return 1
  if(n < r or r < 0):
    return 0
  ret = 1
  ret = ret * kaijo(n) % MOD
  ret = ret * gyaku_kaijo(r) % MOD
  ret = ret * gyaku_kaijo(n-r) % MOD
  return ret

######Factorization######
def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n**0.5//1))+1):
        if temp%i==0:
            cnt=0
            while temp%i==0:
                cnt+=1
                temp //= i
            arr.append([i, cnt])
    if temp!=1:
        arr.append([temp, 1])

    if arr==[]:
        arr.append([n, 1])
    return arr

#####LCM#####
def lcm(a, b):
    return a * b // gcd (a, b)

#############
# Main Code #
#############

N,M = inputIL()
H = inputIL()

graph = [[] for _ in range(N)]
for _ in range(M):
    u, v = inputIL()
    graph[u-1].append(v-1)
    graph[v-1].append(u-1)
    
ans = 0
for i in range(N):
  flag = 1
  h = H[i]
  if len(graph[i]) ==  0:
    pass
  else:
    for j in graph[i]:
       if H[j] >= h:
        flag = 0
        break
  ans += flag
  
print(ans)

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

#define For(i, j, k) for (int i = j; i <= k; i++)
#define Forr(i, j, k) for (int i = j; i >= k; i--)

using namespace std;

const int N = 1e5 + 10;

int L[N], R[N], n;
int rkl[N], rkr[N];

bool cmpl(int x, int y) { return L[x] > L[y]; }
bool cmpr(int x, int y) { return R[x] < R[y]; }

long long sum;
bool vis[N];

void go(int &x, int i) {
	vis[i] = true;
	if (L[i] <= x && x <= R[i]) return;
	if (x < L[i]) {
		sum += L[i] - x; x = L[i];
	}
	if (x > R[i]) {
		sum += x - R[i]; x = R[i];
	}
}

int main() {

	scanf("%d", &n);
	For(i, 1, n) scanf("%d%d", &L[i], &R[i]), rkl[i] = i, rkr[i] = i;

	sort(rkl + 1, rkl + n + 1, cmpl);
	sort(rkr + 1, rkr + n + 1, cmpr);

	long long ans = 0;

	sum = 0;
	int now = 0;
	For(i, 1, n) {
		int x = rkl[i], y = rkr[i];
		if (vis[y]) break;
		go(now, y);
		if (vis[x]) break;
		go(now, x);
	}
	go(now, 0);
	ans = sum;

	memset(vis, false, sizeof vis);
	sum = 0;
	now = 0;
	For(i, 1, n) {
		int x = rkl[i], y = rkr[i];
		if (vis[x]) break;
		go(now, x);
		if (vis[y]) break;
		go(now, y);
	}
	go(now, 0);
	ans = max(ans, sum);

	printf("%lld\n", ans);

	return 0;
}

Measured memory_bytes: 1920
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define rep(i,m,n) for(int i=m;i<n;i++)
const ll mod=1e9+7;

int main(){
  int n,k;
  cin>>n>>k;
  int p[n],c[n];
  rep(i,0,n) {
    cin>>p[i];
    p[i]--;
  }
  ll ans=-1e18;
  rep(i,0,n) cin>>c[i];
  rep(i,0,n){
    int cur=i;
    int cnt=0;
    ll point=0;
    vector<ll> v;
    //set<int> s;
    while(cnt<k){
      cur=p[cur];
      point+=c[cur];
      v.push_back(point);
      cnt++;
      if(cur==i) break;
    }
    if(cnt==k){
      sort(v.begin(),v.end());
      reverse(v.begin(),v.end());
      ans=max(ans,v[0]);
    }
    else{
      if(point>0){
        rep(j,0,cnt){
          ans=max(ans,point*((k-j-1)/cnt)+v[j]);
        }
        /*sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        ans=max(ans,v[0]);
        ans=max(ans,point*(k/cnt)+v[0]);*/
      }
      else{
        sort(v.begin(),v.end());
        reverse(v.begin(),v.end());
        ans=max(ans,v[0]);
      }
    }
  }
  cout<<ans<<endl;
}

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

typedef long long ll;
typedef long double ld;
#define size(a) int((a).size())
#define present(c, x) (c.find(x) != c.end()) 
#define printArray(arr) for (int i = 0; i<size(arr); i++) cout << arr[i] << " ";cout << '\n'
#define printVerdict(verdict) cout << (verdict ? "YES": "NO") << '\n'
#define printDecimal(d) printf("%.9f\n", d)
#define inrange(val, start, end) (val >= start && val <= end)

template <class T1, class T2, class T3> 
void printTuple(tuple<T1, T2, T3> t) {cout << get<0>(t) << " " << get<1>(t) << " " << get<2>(t) << '\n';}
template <class T1, class T2>
void printPair(pair<T1, T2> p) {cout << p.first << " " << p.second << '\n';}

const int mod = 1e9+7;

int main() {
	std::ios_base::sync_with_stdio(false);
	cin.tie(0);
	int n,m; cin >> n >> m;
	char grid[n][m];
	ll dp[n][m];
	for (int i = 0; i<n; i++) {
		string s; cin >> s;
		for (int j = 0; j<m; j++) grid[i][j] = s[j];
	}
	dp[0][0] = 1;
	for (int i = 1; i<n; i++) {
		dp[i][0] = grid[i][0] != '#' ? dp[i-1][0] : 0;
	}
	for (int i = 1; i<m; i++) {
		dp[0][i] = grid[0][i] != '#' ? dp[0][i-1] : 0;
	}
	for (int i = 1; i<n; i++) {
		for (int j = 1; j<m; j++) {
			dp[i][j] = 0;
			if (grid[i][j] != '#') {
				dp[i][j] += dp[i-1][j];
				dp[i][j] %= mod;
				dp[i][j] += dp[i][j-1];
				dp[i][j] %= mod;
			}
		}
	}
	cout <<dp[n-1][m-1]<<'\n';
}



Measured memory_bytes: 12416
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int c,b,a,re;
    string s,t,u;
    cin>>s>>t>>a>>b>>u;
    if(s==u){
        cout<<a-1<<" "<<b<<endl;
    }
    else{
        cout<<a<<" "<<b-1<<endl;
    }
    return 0;
}


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

#define REP(i,n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define all(x) (x).begin(),(x).end()
using ll = long long;
string char_to_string(char val) {
  return string(1, val);
}
int char_to_int(char val) {
  return val - '0';
}
template<class T> inline bool chmin(T& a, T b) {
  if (a > b) {
    a = b;
    return true;
  }
  return false;
}
template<class T> inline bool chmax(T& a, T b) {
  if (a < b) {
    a = b;
    return true;
  }
  return false;
}
int vector_finder(std::vector<ll> vec, int number) {
  auto itr = std::find(vec.begin(), vec.end(), number);
  size_t index = std::distance( vec.begin(), itr );
  if (index != vec.size()) { // 発見できたとき
    return 1;
  }
  else { // 発見できなかったとき
    return 0;
  }
}

int main() {
  int N, M; cin >> N >> M;
  ll ans = 0;
  ll MOD = pow(10, 9) + 7;
  if(abs(N - M) > 1) {
    ans = 0;
  } else {
    ll n_mod = 1;
    ll m_mod = 1;
    for(int i = 1; i <= N; ++i) {
      n_mod = n_mod * i;
      n_mod = n_mod % MOD;
    }
    for(int i = 1; i <= M; ++i) {
      m_mod = m_mod * i;
      m_mod = m_mod % MOD;
    }
    if(N == M) ans = n_mod * m_mod * 2;
    else ans = n_mod * m_mod;
    ans = ans % MOD;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
N = int(raw_input())
Ts = []
As = []
for t in xrange(N):
    T, A = map(int, raw_input().split())
    Ts.append(T)
    As.append(A)
    
leastT= Ts[0]
leastA= As[0]

for i in xrange(1,len(Ts)):
    maxcoeff = max( (leastA + As[i] - 1) / As[i], 
                    (leastT + Ts[i] - 1) /Ts[i])
    leastT = Ts[i] * maxcoeff
    leastA = As[i] * maxcoeff

print leastT+leastA

Measured memory_bytes: 2692
#include <bits/stdc++.h>
 
using namespace std;
 
typedef long long int LL;
typedef LL ll;
typedef string str;
typedef pair<ll,ll> pll;
typedef vector<ll> vll;
typedef stringstream strs;
 
#define X first
#define Y second
#define PB push_back
#define For(i,a,b) for (int i=a;i<b;i++)
#define Ford(i,a,b) for (int i=a;i>=b;i--)
#define smax(a,b) a=max(a,b)
#define smin(a,b) a=min(a,b)
#define SZ(a) ((ll)a.size())
#define ER(a) cout << #a << ' ' << a << endl
#define LB(a,n,x) (lower_bound(a,(a)+(n),x)-(a))
#define RET(x) { cout << x; exit(0); } 
const ll M=2e5+5,LG=19,SM=4000+5,inf=1e18+1;
ll mod=924844033;

ll n;
ll p[M];
ll a[M];
ll b[M];
ll s=5e8;

int main()
{
	ios::sync_with_stdio(0);
	cin >> n;
	For(i,0,n)
	{
	    ll x;
	    cin >> x;
	    x--;    
	    p[x]=i;
    }
    a[0]=1;
    b[0]=s;
    For(i,1,n)
    {
        if (p[i]<p[i-1])
        {
            a[i]=a[i-1]+1;
            b[i]=b[i-1]-p[i-1]+p[i]-1;
        }
        else
        {
            b[i]=b[i-1]-1;
            a[i]=a[i-1]+1+p[i]-p[i-1];
        }
    }
    For(i,0,n) cout << a[i] << ' ';
    cout << '\n';
    For(i,0,n) cout << b[i] << ' ';
    cout << '\n';
}    

Measured memory_bytes: 2944
h, w = map(int, input().split())
a = [''] * h
for i in range(h):
    a[i] = input()

row = [False] * h
side = [False] * w

for i in range(h):
    for j in range(w):
        if a[i][j] == '#':
            row[i] = True
            side[j] = True

for i in range(h):
    if row[i]:
        for j in range(w):
            if side[j]:
                print(a[i][j], end='')
        print()

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

int len(int num) {
	int count = 0;
	while (num > 0) {
		count++;
		num /= 10;
	}
	return count;
}

int main(void)
{
	int i;
	int N;
	int count = 0;

	cin >> N;
	for (i = 1; i <= N; i++) {
		if (len(i) % 2 == 1)count++;
	}
	cout << count << endl;

	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i=0; i<(int)n; i++)
#define REPR(i, n) for(int i=(int)n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=(int)m; i<(int)n; i++)
#define FORR(i, m, n) for(int i=(int)m-1; i>=(int)n; i--)
#define ALL(x) (x).begin(), (x).end()
#define ASC(v) sort(ALL(v));
#define DESC(v) sort(ALL(v), greater<int>());
#define UNIQ(a) sort(ALL(a));(a).resize(unique(ALL(a)) - a.begin());
#define DEBUG(x) cout<<#x<<": "<<x<<"\n"
typedef long long ll;
const double PI = acos(-1);
ll lcm(ll a, ll b) { return a / __gcd(a, b) * b; }
bool isprime(int x){ int i; if(x<2)return 0; else if(x==2) return 1; if(x%2==0) return 0; for(i=3; i*i<=x; i+=2) if(x%i==0) return 0; return 1; }
int digsum(int n) { int r=0; while(n>0) { r+=n%10; n/=10; } return r; }
//struct nya{ nya(){ cin.tie(0); ios::sync_with_stdio(false); } }nyan;


void solve(long long r){
	ll res = r*r;
	cout << res << "\n";
}

int main(){
    long long r;
    scanf("%lld",&r);
    solve(r);
    return 0;
}


Measured memory_bytes: 256
#include<unordered_map>
#include<iostream>
#include<algorithm>
#include<utility>
#include<climits>
#include<fstream>
#include<cstring>
#include<cstdlib>
#include<iomanip>
#include<cstdio>
#include<string>
#include<vector>
#include<stack>
#include<queue>
#include<deque>
#include<cmath>
#include<list>
#include<map>
#include<set>
#define inf 0x7f7f7f
#define p(x) (x)*(x)
using namespace std;

typedef vector<vector<int> > vtype;
typedef long long ll;

int main()
{
	//ios::sync_with_stdio(false);
	int a = 0, b = 0;
	cin >> a >> b; 
	if(b >= a)
		cout << "1" << endl;
	else if(!(a % b))
		cout << a / b << endl;
	else
		cout << a / b + 1 << endl; 
    return 0;
}















Measured memory_bytes: 256
import java.util.*;
import java.io.*;
import java.text.*;
//Solution Credits: Taranpreet Singh
public class Main{
    //SOLUTION BEGIN
    void pre(){}
    void solve(int TC) throws Exception {
        long a = nl(), b = nl(), k = nl();
        long m = Math.min(a, k);
        a -= m;
        k -= m;
        m = Math.min(b, k);
        b -= m;
        k -= m;
        pn(a+" "+b);
    }
    //SOLUTION ENDS
    long mod = (int)1e9+7, IINF = (long)3e18;
    final int MAX = (int)1e6+1, INF = (int)1e9, root = 3;
    DecimalFormat df = new DecimalFormat("0.00000000000");
    double PI = 3.141592653589793238462643383279502884197169399375105820974944, eps = 1e-8;
    static boolean multipleTC = false, memory = true;
    FastReader in;PrintWriter out;
    void run() throws Exception{
        long ct = System.currentTimeMillis();
        in = new FastReader();
        out = new PrintWriter(System.out);
        pre();
        int T = (multipleTC)?ni():1;
//      Solution Credits: Taranpreet Singh
        for(int i = 1; i<= T; i++)solve(i);
        out.flush();
        out.close();
        System.err.println(System.currentTimeMillis()-ct);
    }
    public static void main(String[] args) throws Exception{
        if(memory)new Thread(null, new Runnable() {public void run(){try{new Main().run();}catch(Exception e){e.printStackTrace();}}}, "1", 1 << 28).start();
        else new Main().run();
    }
    long gcd(long a, long b){return (b==0)?a:gcd(b,a%b);}
    int gcd(int a, int b){return (b==0)?a:gcd(b,a%b);}
    int bit(long n){return (n==0)?0:(1+bit(n&(n-1)));}
    void p(Object o){out.print(o);}
    void pn(Object o){out.println(o);}
    void pni(Object o){out.println(o);out.flush();}
    String n(){return in.next();}
    String nln(){return in.nextLine();}
    int ni(){return Integer.parseInt(in.next());}
    long nl(){return Long.parseLong(in.next());}
    double nd(){return Double.parseDouble(in.next());}

    class FastReader{
        BufferedReader br;
        StringTokenizer st;
        public FastReader(){br = new BufferedReader(new InputStreamReader(System.in));}
        public FastReader(String s) throws Exception{br = new BufferedReader(new FileReader(s));}
        String next(){
            while (st == null || !st.hasMoreElements()){
                try{
                    st = new StringTokenizer(br.readLine());
                }catch (IOException  e){
                    e.printStackTrace();
                }
            }
            return st.nextToken();
        }
        String nextLine(){
            String str = "";
            try{str = br.readLine();}catch (IOException e){e.printStackTrace();}
            return str;
        }
    }
}

Measured memory_bytes: 24404
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <ctime>
#include <cstring>
#include <functional>
#include <iostream>
#include <iomanip>
#include <limits>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <regex>
#include <vector>

#define fix(n)          cout<<fixed<<setprecision(n)
#define rep(i,n)        for (int i = 0; i < (n); ++i)
#define sort(a)         sort((a).begin(), (a).end())
#define uniq(a)         sort(a);(a).erase(unique((a).begin(), (a).end()), (a).end())
#define reverse(a)      reverse((a).begin(), (a).end())
#define ctos(c)         string(1, (c))
#define out(d)          cout << (d)
#define outl(d)         std::cout<<(d)<<"\n"
#define YES()           cout << "YES" << endl
#define NO()            cout << "NO" << endl
#define Yes()           cout << "Yes" << endl
#define No()            cout << "No" << endl
#define ceil(x, y)      ((x + y - 1) / (y))
#define debug(x)        cerr << #x << ": " << (x) << '\n'
#define debug2(x, y)    cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << '\n'
#define debug3(x, y, z) cerr << #x << ": " << (x) << ", " << #y << ": " << (y) << ", " << #z << ": " << (z) << '\n'
#define dbg(v)          for (size_t _ = 0; _ < v.size(); ++_){ cerr << #v << "[" << _ << "] : " << v[_] << '\n'; }

using namespace std;
using ll = long long;
using ld = long double;
using P = pair<ll,ll>;

const ll MOD = 1000000007; // 10^9 + 7
const int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
const int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};

void solve() {
  int n, k; cin >> n >> k;
  const int MAX = 200000;
  int b[MAX + 5] = {0};
  rep(i, n) {
    int a; cin >> a;
    b[a]++;
  }

  priority_queue<pair<int, int>> pq;
  int s = 0;
  for (int i = 1; i <= MAX; i++) {
    if (b[i] > 0) {
      pq.push(make_pair(-b[i], i));
      s++;
    }
  }

  int ans = 0;
  while (s > k && !pq.empty()) {
    pair<int, int> p = pq.top(); pq.pop();
    // debug2(-p.first, p.second);
    ans += -p.first;
    s--;
  }
  outl(ans);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  srand((unsigned)time(NULL));
  fix(12);

  solve();
}


Measured memory_bytes: 3188
N = int(input())
a = list(map(int, input().split()))

hako = [0] * (N+1)

for i in range(1,N+1)[::-1]:
    count = 0
    for j in range(i,N+1,i):
        if j%i == 0:
            count += hako[j]

    if count % 2 == a[i-1]:
        hako[i] = 0
    else:
        hako[i] = 1

print(sum(hako))

if sum(hako):
    ans = []
    for i, bin in enumerate(hako):
        if bin:
            ans.append(i)
    print(*ans)

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

int main(void) {

    string s; cin >> s;
    bool flagC = false;
    bool flagF = false;
    for (int i = 0; i < s.size(); i++) {
        if (s[i] == 'C') {
            flagC = true;
        } else if (s[i] == 'F' && flagC)  {
            flagF = true;
        }
    }

    if (flagF) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
const int INF = 1e9;
const int MOD = 1e9+7;
const long long LINF = 1e18;
#define dump(x)  cout << 'x' << ' = ' << (x) << ` `;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) for(int i=0;i<(n);++i)
#define REPR(i,n) for(int i=n;i>=0;i--)
#define FOREACH(x,a) for(auto& (x) : (a) )
typedef long long ll;
using namespace std;
typedef pair<ll, ll> P;

template<typename T>
void print(const vector<T> &x) {
    int n = x.size();
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x) {
    int n = x.size();
    rep(i,n) {
        rep(j,x[i].size()) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

template<typename T>
void print(const vector<T> &x, int n) {
    rep(i,n) {
        cout << x[i];
        if (i!=n-1) cout<<" ";
        else cout << endl;
    }
}

template<typename T>
void print(const vector<vector<T>> &x, int n, int m) {
    rep(i,n) {
        rep(j,m) {
            cout << x[i][j] << " ";
        }
        cout << endl;
    }
}

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; }

void input_init() {
    cin.tie(0); ios::sync_with_stdio(false);
}

struct In {
    ll l, r, c;
    In(){}
    In(ll l, ll r, ll c):l(l),r(r),c(r){}
};


typedef struct Edge {
    ll to, cost;
} Edge;

typedef struct Info {
    ll dist, from;
} Info;


void dijkstra(vector<Info> &dp, int s, const vector<vector<Edge>> &g) {
    priority_queue<P,vector<P>,greater<P>> pq;
    dp[s].dist = 0;
    // P(dist, v)
    pq.push({0,s});

    while (!pq.empty()) {
        P p = pq.top(); pq.pop();
        int v = p.second;
        for (auto &&e: g[v]) {
            if (dp[e.to].dist > dp[v].dist+e.cost) {
                dp[e.to].dist = dp[v].dist+e.cost;
                dp[e.to].from = v;
                pq.push({dp[e.to].dist, e.to});
            }
        }
    }
}



int main(int argc, char const *argv[]) {
    int n,m;
    cin>>n>>m;
    vector<In> a(m);
    rep(i,m) cin>>a[i].l>>a[i].r>>a[i].c;

    vector<vector<Edge>> g(n+10);
    rep(i,m) {
        g[a[i].l].push_back({a[i].r,a[i].c});
    }
    
    for (int i = 1; i <= n; ++i) g[i].push_back({i-1,0});

    vector<Info> dp(n+10,{LINF,INF});
    dijkstra(dp,1,g);

    if (dp[n].dist == LINF) cout << -1 << endl;
    else cout << dp[n].dist << endl;
    return 0;
}

Measured memory_bytes: 12284
#include<iostream>
#include<cstdio>
#include<string>
#include<math.h>

using namespace std;

int main()
{
	long N,X[100],i,j,V,M;
	cin >> N;
	for(i=0;i<N;i++){
		cin >> X[i];
	}
	
	for(j=0;j<101;j++){
		V=0;
		for(i=0;i<N;i++){
			V=V+ pow(X[i]-j,2);
		}
		if(j==0){
				M=V;
		}
		M=min(M,V);
	}		
	cout<<M<<endl;

}

Measured memory_bytes: 256
N, M = [int(i) for i in input().split()]
L = 1
R = 100000
for _ in range(M):
    l, r = [int(i) for i in input().split()]
    L = max(L, l)
    R = min(R, r)
if L > R:
    print(0)
else:
    print(R-L+1)

Measured memory_bytes: 3060
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
#define rng(i, a, b) for (int i = int(a); i < int(b); i++)
#define rep(i, b) rng(i, 0, b)
#define gnr(i, a, b) for (int i = int(b) - 1; i >= int(a); i--)
#define per(i, b) gnr(i, 0, b)
#define bg begin()
#define ed end()
#define all(x) x.bg, x.ed
#define vi vector<int>
template <class t, class u>
bool chmax(t &a, u b)
{
    if (a < b)
    {
        a = b;
        return true;
    }
    return false;
}
template <class t, class u>
bool chmin(t &a, u b)
{
    if (b < a)
    {
        a = b;
        return true;
    }
    return false;
}

ll mod = 1000000007;

signed main()
{
    ll n, k;
    cin >> n >> k;
    map<int, ll> m;
    rep(i, n)
    {
        int a, b;
        cin >> a >> b;
        m[a] += b;
    }
    ll sum = 0;
    int ans = 0;
    for (auto &i : m)
    {
        sum += i.second;
        if (sum >= k)
        {
            ans = i.first;
            break;
        }
    }
    cout << ans << endl;

    // int n, k;
    // vector<ll> c(100000);
    // cin >> n >> k;
    // rep(i, n)
    // {
    //     int a, b;
    //     cin >> a >> b;
    //     c[a - 1] += b;
    // }
    // vector<ll> d(100000);
    // d[0] = c[0];
    // rep(i, 100000 - 1)
    // {
    //     d[i + 1] = d[i] + c[i + 1];
    // }
    // int ans = lower_bound(all(d), k) - d.begin();
    // cout << ans + 1 << endl;
    return 0;
}

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

int main()
{
	int x,y,z,fff=0;
	scanf("%1d%1d%1d",&x,&y,&z);
	if(x==1)fff++;
	if(y==1)fff++;
	if(z==1)fff++;
	cout<<fff<<endl;
	return 0;
}

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) begin(n),end(n)

template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }

#define DEBUG

int main()
{
	ios::sync_with_stdio(false); cin.tie(0);
	string s, t;
	cin >> s >> t;

	map<string, int> m;
	cin >> m[s] >> m[t];

	string u;
	cin >> u;

	m[u]--;
	cout << m[s] << ' ' << m[t] << endl;
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<iostream>
#include<cmath>
#include<string>
#include<set>
using namespace std;
#define rep(i, a, n) for (int i = a; i < n; i++)
typedef long long ll;
#define big 1000000007
#define all(a) sort((a).begin(),(a).end()) //ソートのマクロ
#define Re(a) reverse((a).begin(),(a).end())
#define YN(a) if(a){cout<<"Yes"<<endl;}else cout<<"No"<<endl;//条件によってYes、Noを出力する
//累積和
int main(){
    int x;cin>>x;
    if(x==0) cout<<1<<endl;
    else cout<<0<<endl;
}

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

int main(){
  int X,Y; cin >> X >> Y;
  bool f=false;
  for(int i=0; i<=X; i++){
    if(i*2+(X-i)*4==Y) f=true;
  }
  cout << (f?"Yes":"No") << endl;
}

Measured memory_bytes: 3632
#include <iostream>
#include <vector>
#include <string>
#include <map>
#include <numeric>
#include <algorithm>
#include <math.h>

using namespace std;

int N, K;
vector<int> A(100000);

int main(){
    cin >> N >> K;
    for(int i=0;i<N;i++)    cin >> A[i];

    int ans = 0, left = 0, right = left + K - 1;
    while ( right < N )
    {
        ans++;
        left = right;
        right = left + K - 1;
    }

    if( left < N - 1 ) ans++;

    cout << ans << endl;
    
}

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

#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define FOR(i ,a, b) for (int i = a ; i <= b ; i++)
#define sz(a) int(a.size())
#define cuti(a) cout << a << endl;
#define cutii(a,b) cout << a << " " << b << endl;
#define vec(a) vector<int > a;

template<typename T,typename U> inline void chmin(T &x,U y){ if(y<x) x = y; }

typedef pair<int ,int > pii;
typedef long long LL;
const long long oo = 1e9 + 7;

int a,b,c;

int main() {
  //  freopen("test.txt","r",stdin);
    cin >> a >> b >> c;
    int sum = 0;
    for (int i =1 ; i<= b * (b+1)/2; i++) {
                sum = a * i;
                if ( (sum - c) % b == 0 ) {
                    cout << "YES";
                    return 0;
                }
    }
    cout << "NO";
}


Measured memory_bytes: 256
N, x = map(int, input().split())
MAX = 2*N - 1
if x in [1, MAX]:
    print('No')
else:
    print('Yes')
    great = [i for i in range(x + 1, MAX + 1)]
    small = [i for i in range(1, x)]
    if len(great) > N - 1:
        small = great[N - 1:] + small
        great = great[:N - 1]
    elif len(small) > N - 1:
        great = great + small[N - 1:]
        small = small[:N - 1]
    ans = small + [x] + great
    print(*ans, sep='\n')

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

#define pb(n) push_back(n)
#define fi first
#define se second
#define all(r) begin(r),end(r)
#define vmax(ary) *max_element(all(ary))
#define vmin(ary) *min_element(all(ary))
#define debug(x) cout<<#x<<": "<<x<<endl
#define fcout(n) cout<<fixed<<setprecision((n))
#define scout(n) cout<<setw(n)
#define vary(type,name,size,init) vector< type> name(size,init)
#define vvl(v,w,h,init) vector<vector<ll>> v(w,vector<ll>(h,init))
#define mp(a,b) make_pair(a,b)

#define rep(i,n) for(int i = 0; i < (int)(n);++i)
#define REP(i,a,b) for(int i = (a);i < (int)(b);++i)
#define repi(it,array) for(auto it = array.begin(),end = array.end(); it != end;++it)
#define repa(n,array) for(auto &n :(array))

using ll = long long;
using pii = pair<int,int> ;
using pll = pair<ll,ll> ;

template<typename T>
void O(T t){
  cout << t << endl;
}

const ll mod = 1e9+7;
constexpr ll inf = ((1<<30)-1)*2+1 ;
constexpr double PI = acos(-1.0) ;
double eps = 1e-10 ;
const int dy[] = {-1,0,1,0,1,-1,1,-1};
const int dx[] = {0,-1,0,1,1,-1,-1,1};

inline bool value(int x,int y,int w,int h){
  return (x >= 0 && x < w && y >= 0 && y < h);
}

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll n,m;
  cin >> n >> m;
  ll N = min(n,m);
  ll M = max(n,m);
  if(abs(N-M) > 1){
    cout << 0 << endl;
  }
  else{
    ll ans = (N == M) ? 2 : 1;
    rep(i,M){
      ans = (ans * (i+1)) % mod;
    }
    rep(i,N){
      ans = (ans * (i+1)) % mod;
    }
    std::cout << ans << std::endl; 
  }
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
using namespace std;
using Graph = vector<vector<int>>;

signed main(){
  string S;
  cin >> S;
  int N = (int)S.size();
  bool fg = true;
  for( int i = 0; i < N/2; i++ ){
    if( S.at(i) != S.at(N-1-i) ) fg = false;
  }
  
  if( N == 3 ){
    if( fg ) cout << "Yes" << endl;
    else cout << "No" << endl;
    return 0;
  }
  
  int gen;
  for( int i = 0; i < (N-1)/4; i++ ){
    if( S.at(i) != S.at((N-1)/2-1-i) ) fg = false;
  }
  
  for( int i = (N+3)/2-1; i < N; i++ ){
    if( S.at(i) != S.at(N-1-i) ) fg = false;
  }
  
  if( fg ) cout << "Yes" << endl;
  else cout << "No" << endl;
    
  
}


Measured memory_bytes: 256
//#define MYDEBUG
#include <iostream>
#include <vector>
#include <chrono>
#include <random>
#include <algorithm>
#include <map>
#include <unordered_map>
#include <cstdio>
#include <queue>
#include <stack>

#ifdef MYDEBUG
#define debug(x) cout<<#x<<": "<<x<<endl
#else
#define debug(x)
#endif
#define ll long long
#define ull unsigned long long
#define eps 1e-14
#define all(x) x.begin(), x.end()
#define umap unordered_map
using namespace std;

template<typename T>
ostream& operator<<(ostream& out, const vector<T>& v) {
  out << "[";
  size_t last = v.size() - 1;
  for (size_t i = 0; i < v.size(); ++i) {
    out << v[i];
    if (i != last)
      out << ",";
  }
  out << "]";
  return out;
}

ll x, y;
void solve() {
  cin >> x >> y;
  if (abs(x - y) <= 1)
    cout << "Brown" << endl;
  else
    cout << "Alice" << endl;
}

int main() {
  solve();
  return 0;
}


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

int main(void)
{
	int n, m;
	int criteria[1001];
	int cost[1001];
	int vote[1001];
	int i, j;
	int max;

	scanf("%d%d", &n, &m);
	for (i = 1; i <= n; i++){
		scanf("%d", &cost[i]);
	}
	for (i = 1; i <= m; i++){
		scanf("%d", &criteria[i]);
	}
	
	memset(vote, 0, sizeof(vote));
	
	for (i = 1; i <= m; i++){
		j = 1;
		while (cost[j] > criteria[i]){
			j++;
		}
		vote[j]++;
	}
	
	max = vote[1];
	for (i = 1; i <= n; i++){
		if (vote[max] < vote[i]){
			max = i;
		}
	}
	printf("%d\n", max);
	
	return (0);
}

Measured memory_bytes: 608
#include <stdio.h>
#include <string>
#include <cstring>
#include <stdlib.h>
#include <math.h>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <list>
#include <iterator>
#include <assert.h>
#pragma warning(disable:4996) 
 
typedef long long ll;
#define MIN(a, b) ((a)>(b)? (b): (a))
#define MAX(a, b) ((a)<(b)? (b): (a))
#define LINF 9223300000000000000
#define INF 2140000000
const long long MOD = 1000000007;
using namespace std;

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


vector<int> pp;
void preparePrime( int maxp )
{
    int i;
    vector<int> a(maxp+1);
    for(i=2; i<=maxp; i++) {
        int k=i+i;
        while(k<=maxp) {
            a[k]=1;
            k+=i;
        }
    }
    for(i=2; i<=maxp; i++) {
        if(a[i]==0) pp.push_back( i );
    }
    return;
}

void decompositPrime( ll a, vector<pair<ll,ll> >& vv )
{
    preparePrime( (int)sqrt((double)a)+1 );

    int i;
    for(i=0; i<(int)pp.size(); i++) {
        int count = 0;
        while(a % pp[i] == 0 ) {
            a /= pp[i];
            count ++;
        }
        if(count>0) vv.push_back( make_pair( pp[i], count ) );
        if (a==1) break;
    }
    if(a>1) {
        vv.push_back( make_pair( a, 1 ) );
    }

    return;
}

int main(int argc, char* argv[])
{
    ll a,b;
    scanf("%lld%lld", &a, &b);

    ll c = gcd(a,b);
    vector<pair<ll,ll> > vv;
    decompositPrime( c, vv);

    printf("%d\n", (long)vv.size()+1);



    return 0;
}


Measured memory_bytes: 4732
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;

int N;
ll dp[440][440];
ll psum[440];
int a[440];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cin >> N;
	for (int i = 0; i < N; i++) {
		cin >> a[i];
		psum[i + 1] = psum[i] + a[i];
	}
	for (int w = 2; w <= N; w++)
		for (int l = 0; l + w <= N; l++) {
			int r = l + w;
			dp[l][r] = 2e18;
			for (int t = l + 1; t <= r; t++)
				dp[l][r] = min(dp[l][r], dp[l][t] + dp[t][r] + psum[r] - psum[l]);
		}
	cout << dp[0][N] << '\n';
	return 0;
}

Measured memory_bytes: 1664
/*Template by hemnath_d(Enlightened by chamow)*/
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define ld long double
#define vec vector<ll>
#define pll pair<ll,ll>
#define fastread ios_base::sync_with_stdio(false); cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define fx first
#define sx second
#define inf 100000000000000
#define minf -100000000000000
#define maxi 100005

int main()
{
    fastread;
    long long x;
    cin>>x;
    bool flag = false;
    for(long long i = 0; i <= 1000; i++){
        long long ipow = i * i * i * i * i;
        for(long long j = i; j <= 1000; j++) {
            long long jpow = j * j * j * j * j;
            long long apos = ipow + jpow;
            long long bpos = -ipow + jpow;
            long long cpos = ipow - jpow;
            if(apos == x) {
                cout<<i<<" "<<-j<<endl;
                flag = true;
                break;
            }
            else if(bpos == x) {
                cout<<-i<<" "<<-j<<endl;
                flag = true;
                break;
            }
            else if(cpos == x) {
                cout<<i<<" "<<j<<endl;
                flag = true;
                break;
            }
        }
        if(flag) {
            break;
        }
    }
    return 0;
}

Measured memory_bytes: 3652
#include<bits/stdc++.h>
using namespace std;
int main(){
  int n,c,k;
  cin >> n >> c >> k;
  vector<int> t(n);
  for(int i=0;i<n;i++){
    cin >> t[i];
  }
  sort(t.begin(),t.end());
  int cnt=0;
  int a;
  int ans=1;
  for(int i=0;i<n;i++){
    if(cnt==0){
      a=t[i];
      cnt++;
      continue;
    }
    if(cnt==c){
      cnt=1;
      a=t[i];
      ans++;
      continue;
    }
    if(t[i]<=a+k){
      cnt++;
    }
    else{
      a=t[i];
      cnt=1;
      ans++;
    }
  }
  cout << ans << endl;
}

Measured memory_bytes: 640
#include <iostream>
#include <set>
#include <map>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <climits>
#include <numeric>
#include <cmath>
#include <queue>
#include <sstream>
#include <string.h>
#include <bitset>

using namespace std;
typedef long long ll;
const ll mod = 1e9 + 7;
map<int, int> m;

void prime_factor(int n) {
  for(int i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      m[i]++;
      n /= i;
    }
  }
  if (n != 1) {
    m[n]++;
  }
  return;
}

int main()
{
  ll n;
  cin >> n;
  
  for (int i = 1; i <= n; i++) {
    prime_factor(i);
  }
  
  ll ans = 1;
  for (int i = 1; i <= n; i++) {
    ans = ans * (m[i] + 1) % mod;
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<cstdio>
#include<cstring>
#include<vector>
#include<queue>
#include<algorithm>
#include<cmath>
#include<climits>
#include<string>
#include<set>
#include<map>
#include<iostream>
using namespace std;
#define rep(i,n) for(int i = 0;i<((int)(n));i++)
#define reg(i,a,b) for(int i = ((int)(a));i<=((int)(b));i++)
#define irep(i,n) for(int i = ((int)(n)-1);i>=0;i--)
#define ireg(i,a,b) for(int i = ((int)(b)-1);i>=((int)(a));i--)
typedef long long int lli;
typedef pair<int, int> mp;
#define fir first
#define sec second
#define IINF INT_MAX
#define LINF LLONG_MAX
#define eprintf(...) fprintf(stderr,__VA_ARGS__)
#define pque(type) priority_queue<type,vector<type>,greater<type> >
#define memst(a,b) memset(a,b,sizeof(a))

int main(void){
	int a,b;
	cin >> a >> b;
	
	if(a == b) cout << "Draw" << endl;
	else{
		if(a==1) a+=13; if(b==1) b+=13;
		cout << (a>b?"Alice":"Bob") << endl;
	}
	
	
	return 0;
}

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

#define rep(i, s, n) for(int i=(s);i<(int)n;i++)
int INF=1e9;

bool prime(int p) {
  bool b=true;
  for(int i=2;i*i<p;i++) {
    if(p%i==0) {
      b=false;
      break;
    }
  }
  return b;
}

int main() {
  int X;
  cin >> X;
  while(!prime(X++)){}
  cout << X-1 << endl;
}

Measured memory_bytes: 256
import java.util.ArrayList;
import java.util.Arrays;
import java.util.Scanner;

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

	double EPS = 1e-11;

	void solver() {
		Scanner sc = new Scanner(System.in);
		while (true) {
			double w = sc.nextDouble(), h = sc.nextDouble();
			int n = sc.nextInt();
			if (w == 0 && h == 0 && n == 0)
				break;
			n *= 2;
			double[] x = new double[n + 2];
			double[] y = new double[n + 2];
			for (int i = 0; i < n; i++) {
				x[i] = sc.nextDouble();
				y[i] = sc.nextDouble();
			}
			x[n] = w;
			y[n] = 0;
			x[n + 1] = w;
			y[n + 1] = h;
			ArrayList<Double> y1 = new ArrayList<>();
			for (int i = 0; i < n + 2; i++) {
				for (int j = i + 1; j < n + 2; j++) {
					if (x[i] != x[j]) {
						double tmp = (y[i] - y[j]) / (x[i] - x[j]) * (-x[j]) + y[j];
						if (0 < tmp && tmp < h)
							y1.add(tmp);
					}
				}
			}
			y1.add(0.0);
			y1.add(h);
			y1.sort(null);
			for (int i = 0; i < y1.size() - 1; i++) {
				while (i < y1.size() - 1 && y1.get(i) == y1.get(i + 1)) {
					y1.remove(i);
				}
			}

			double ans = 0;

			for (int i = 0; i < y1.size() - 1; i++) {
				double[] y2 = new double[n];
				if (Math.abs(y1.get(i) - y1.get(i + 1)) < EPS)
					continue;
				double y_mid = (y1.get(i) + y1.get(i + 1)) / 2;
				for (int j = 0; j < n; j++) {
					double tmp = (y[j] - y_mid) / ((x[j] + EPS) - 0) * w + y_mid;
					if (tmp < 0)
						tmp = 0;
					if (tmp > h)
						tmp = h;
					y2[j] = tmp;
				}
				Arrays.sort(y2);
				ans += (y2[n / 2] - y2[n / 2 - 1]) * (y1.get(i + 1) - y1.get(i));
				// System.out.println(ans / (h * h));
			}
			System.out.println(ans / (h * h));
		}
	}

	void tr(Object... o) {
		System.out.println(Arrays.deepToString(o));
	}
}

Measured memory_bytes: 166120
from collections import defaultdict

def cumsum(ls):
    for i in range(1,len(ls)):
        ls[i] += ls[i-1]
    ls.insert(0,0)
    return ls

def main():
    n,w = map(int,input().split())
    dc = defaultdict(list)
    W1,V1 = map(int,input().split())
    dc[W1].append(V1)
    for _ in range(1,n):
        wk,vk = map(int,input().split())
        dc[wk].append(vk)

    #　下準備
    dc = sorted(dc.items(),key=lambda x:x[0],reverse=True)
    for i in range(len(dc)):
        dc[i] = list(dc[i])
        dc[i][1] = cumsum(sorted(list(dc[i][1]),reverse=True))
    
    for i in range(4-len(dc)):
        dc.append([0,[0]])
    can = [0,0] # [w,v]
    ans = 0
    for i in range(len(dc[0][1])):
        for j in range(len(dc[1][1])):
            for k in range(len(dc[2][1])):
                for l in range(len(dc[3][1])):
                    can[0] = dc[0][0]*i + dc[1][0]*j + dc[2][0]*k + dc[3][0]*l
                    can[1] = dc[0][1][i] + dc[1][1][j] + dc[2][1][k]+ dc[3][1][l]
                    if can[0]<=w:
                        ans = max(ans,can[1])
                    can = [0,0]
    print(ans)
if __name__ == "__main__":
    main()

Measured memory_bytes: 42284
a, b, c = map(int, input().split(' '))
k = int(input())

count = 0
while True:
    if a >= b:
        b *= 2
        count += 1
        continue
    elif b >= c:
        c *= 2
        count += 1
        continue
    else:
        break

if count <= k:
    print('Yes')
else:
    print('No')

Measured memory_bytes: 9172
#include <iostream>
#include <string>
#include <cstring>
#include <algorithm>
#include <functional>
#include <cmath>
#include <set>
#include <queue>
#include <vector>
#include <climits>
#include <sstream>
#include <iomanip>
#include <map>
#include <stack>
using namespace std;

int main()
{
	int N;
	cin >> N;
	vector<long long> H(N);
	for (auto i = 0; i < N; ++i)
	{
		cin >> H[i];
	}

	auto valid = true;
	for (auto i = N - 1; i > 0; --i)
	{
		if (H[i] >= H[i - 1])
		{
			continue;
		}
		if (H[i] < H[i - 1] - 1)
		{
			valid = false;
			break;
		}
		--H[i - 1];
	}

	if (valid)
	{
		cout << "Yes" << endl;
	}
	else
	{
		cout << "No" << endl;
	}

	return 0;
}

Measured memory_bytes: 1152