akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define arep(i,x,n) for(int i=int(x);i<(int)(n);i++)
#define rep(i,n) for(long long i = 0;i < n;++i)
#define rrep(i,n) for(int i=int(n-1);i>=0;i--)
#define fs first
#define sc second
#define all(x) (x).begin(), (x).end()
#define pi 3.141592653589793
#define eps 0.00000001
#define INF 1e9+7  
using ll = long long;
using P = pair<int, int>;
using lP = pair<ll, ll>;
using fP = pair<double, double>;
using PPI = pair<P, int>;
ll const mod = 998244353;
//const ll mod=1e9+7;
const ll MAX = 300000;
using vi = vector<int>;
using vl = vector<ll>;
using vc = vector<char>;
using vd = vector<double>;
using vs = vector<string>;
using vp = vector<P>;
using vb = vector<bool>;
using vvi = vector<vector<int>>;
using vvl = vector<vector<ll>>;
using vvd = vector<vector<double>>;
using vvc = vector<vector<char>>;
using vvp = vector<vector<P>>;
using vvb = vector<vector<bool>>;
template <typename T>
bool chmax(T& a, const T b) { if (a < b) { a = b; return true; } return false; }
template <typename T>
bool chmin(T& a, const T b) { if (a > b) { a = b; return true; } return false; }


//////////////////////////////////////


map< ll, ll > prime_factor(ll n) {
    map< ll, ll > ret;
    for (ll i = 2; i * i <= n; i++) {
        while (n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if (n != 1) ret[n] = 1;
    return ret;
}


int main() {
    ll n;
    cin >> n;
    
    map<ll, ll>mp;
    mp = prime_factor(n);
    
    ll ans = 0;
    for (auto x : mp) {
        ll cnt = 1;
        while (x.second > 0) {
            x.second -=cnt;
            cnt++;
            ans++;
            if (x.second - cnt < 0)break;
        }
    }
    cout << ans << endl;
    return 0;
}

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

const int N = 5010;
int n, ans = 0;
char s[N], t[N];
vector<int> a, b;
int check(int x, int y) {
  int i = 0, j = 0, ret = 0;
  while (i < x) ret += a[i++];
  while (j < y) ret += b[j++];
  while (i < (int) a.size() && j < (int) b.size()) ret += abs(a[i++] - b[j++]);
  while (i < (int) a.size()) ret += n - a[i++];
  while (j < (int) b.size()) ret += n - b[j++];
  return ret;
}
int main() {
  scanf("%d%s%s", &n, s + 1, t + 1);
  s[0] = t[0] = '0';
  for (int i = 0; i < n; i++) {
    if (s[i + 1] != s[i]) a.push_back(i);
    if (t[i + 1] != t[i]) b.push_back(i);
  }
  for (int i = 0; i < (int) a.size(); i += 2) {
    if (i + 1 < (int) a.size()) ans += min(a[i] + a[i + 1], n - a[i] + n - a[i + 1]);
    else ans += n - a[i];
  }
  for (int j = 0; j < (int) b.size(); j += 2) {
    if (j + 1 < (int) b.size()) ans += min(b[j] + b[j + 1], n - b[j] + n - b[j + 1]);
    else ans += n - b[j];
  }
  for (int i = 0; i < (int) a.size(); i += 2) {
    for (int j = 0; j < (i ? 1 : (int) b.size()); j += 2) {
      ans = min(ans, check(i, j));
    }
  }
  printf("%d\n", ans);
}


Measured memory_bytes: 384
import java.util.*;

public class Main {
    public static void main(String[] args) throws Exception {
        
        Scanner sc=new Scanner(System.in);
        int n=sc.nextInt();
        int count=0;
  		int[] h=new int[n];
		for(int c=0;c<n;c++){
		    
    		h[c]=sc.nextInt();
            if(c==0){
                
                count+=h[c];
                
            }else if(h[c-1]<h[c]){
                
                count+=h[c]-h[c-1];
            }
    	}
        
    	System.out.println(count);
        
    }
}


Measured memory_bytes: 36004
/**
*
* Author: MARS
* Lang: GNU C++14
*
**/

#include<bits/stdc++.h>
using namespace std;

#define F first
#define S second
#define ii pair<int,int>

typedef long double ldbl;
typedef long long ll;
typedef double dbl;

const ldbl pi = acos(-1);
const ll inf = 1LL<<30;
const dbl eps = 1e-9;
const ll mod = 1e9+7;

/** /////////// ** Code ** /////////// **/

const int N=0;

int main(){
    int x,y,z;
    cin>>x>>y>>z;
    int w=(x+z-1)/z;
    if(w <= y) cout<<"Yes"<<endl;
    else cout<<"No"<<endl;
}


Measured memory_bytes: 3632
using System;
using System.Collections.Generic;
using System.Linq;
 
namespace at
{
    class Program
    {
        static void Main(string[] args)
        {
            var x = Console.ReadLine().Split(' ');
            var a = int.Parse(x[0]);
            var b = int.Parse(x[1]);
            var c = int.Parse(x[2]);

            if(a<b && b<c)
            {
                Console.WriteLine("Yes");
            }
            else
            {
                Console.WriteLine("No");
            }
        }
    }
}



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

#define int long long
#define double long double
#define rep(i, n) for (int i = 0; i < (n); i++)
#define reps(i, n) for (int i = 1; i <= (n); i++)
#define all(x) (x).begin(), (x).end()
#define uniq(x) (x).erase(unique(all(x)), (x).end())
#define bit(n) (1LL << (n))
#define dump(x) cerr << #x " = " << (x) << endl
using vint=vector<int>;
using vvint=vector<vint>;
using pint=pair<int, int>;
using vpint=vector<pint>;
template<typename T> using priority_queue_rev=priority_queue<T, vector<T>, greater<T>>;
constexpr double pi = 3.1415926535897932384626433832795028L;
constexpr int dy[8] = {0, 1, 0, -1, 1, 1, -1, -1};
constexpr int dx[8] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b) {
    while (b) { swap(a %= b, b); }
    return a;
}
int lcm(int a, int b) { return a / gcd(a, b) * b; }
template<typename T> void fin(T mes) {
    cout << mes << endl;
    exit(0);
}
template<typename T1, typename T2> bool chmax(T1 &a, const T2 &b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> bool chmin(T1 &a, const T2 &b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}
template<typename T1, typename T2> ostream &operator<<(ostream &os, const pair<T1, T2> &rhs) {
    os << "(" << rhs.first << ", " << rhs.second << ")";
    return os;
}
template<typename T> ostream &operator<<(ostream &os, const vector<T> &rhs) {
    os << "{";
    for (auto itr = rhs.begin(); itr != rhs.end(); itr++) {
        os << *itr << (next(itr) != rhs.end() ? ", " : "");
    }
    os << "}";
    return os;
}
struct setup {
    static constexpr int PREC = 20;
    setup() {
        cout << fixed << setprecision(PREC);
        cerr << fixed << setprecision(PREC);
    };
} setup;

int N, K;
int V[55];
signed main() {
    cin >> N >> K;
    rep(i, N) { cin >> V[i]; }
    int ans = 0;
    for (int i = 0; i <= K; i++) {
        for (int j = 0; j <= K; j++) {
            if (i + j > K || i + j > N) { continue; }
            int cur = 0;
            vint minus;
            rep(l, i) {
                cur += V[l];
                if (V[l] < 0) { minus.push_back(V[l]); }
            }
            rep(r, j) {
                cur += V[N - r - 1];
                if (V[N - r - 1] < 0) { minus.push_back(V[N - r - 1]); }
            }
            sort(all(minus));
            rep(m, minus.size()) {
                if (m >= K - i - j) { break; }
                cur -= minus[m];
            }
            chmax(ans, cur);
        }
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <vector>
#include <algorithm>
#include <cstdio>
#include <random>
#include <ctime>
#include <string>
#include <iomanip>
#include <set>
#include <map>
#include <queue>
#include <stack>

using namespace std;

typedef long long li;
typedef unsigned long long uli;
typedef pair<int, int> pii;
typedef long double ld;

#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define fr first
#define sc second
#define pb push_back
#define forn(i, n) for(int i = 0; i < int(n); ++i)
#define fore(i, l, r) for(int i = int(l); i < int(r); ++i)
#define forb(i, n) for(int i = int(n) - 1; i >= 0; --i)

const int INF = 1e9 + 1000;
const li INF64 = 1e15 + 1000;
const int M = 100 + 10;
const int N = 3 * 1000 + 100;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = 3.14159265359;

li gcd(li a, li b) {
    return a == 0 ? b : gcd(b % a, a);
}

double dp[N][N];

int main() {
#ifdef _DEBUG
    freopen("input.txt", "r", stdin);
    freopen("output.txt", "w", stdout);
#endif

    ios_base::sync_with_stdio(0);
    cin.tie(0);

    int n;
    cin >> n;

    vector<double> p(n);
    forn(i, n) {
        cin >> p[i];
    }

    dp[0][0] = 1;

    fore(i, 1, n + 1) {
        dp[i][0] = dp[i - 1][0] * (1 - p[i - 1]);
    }

    fore(i, 1, n + 1) {
        fore(j, 1, n + 1) {
            dp[i][j] = dp[i - 1][j] * (1 - p[i - 1]) + dp[i - 1][j - 1] * p[i - 1];
        }
    }

    double ans = 0;

    fore(j, (n + 1) / 2, n + 1) {
        ans += dp[n][j];
    }

    cout << setprecision(9) << fixed;
    cout << ans << '\n';

}


Measured memory_bytes: 73984
# include <iostream>
# include <algorithm>
# include <vector>
# include <string>
# include <set>
# include <map>
# include <cmath>
# include <iomanip>
# include <functional>
# include <utility>
# include <stack>
# include <queue>
# include <list>
# include <tuple>
# include <unordered_map>
# include <numeric>
# include <complex>
# include <bitset>
# include <random>
# include <chrono>
# include <cstdlib>
# include <tuple>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
constexpr int INF = 2147483647;
constexpr int HINF = INF / 2;
constexpr double DINF = 100000000000000000.0;
constexpr double HDINF = 50000000000000000.0;
constexpr long long LINF = 9223372036854775807;
constexpr long long HLINF = 4500000000000000000;
const double PI = acos(-1);
template <typename T_char>T_char TL(T_char cX) { return tolower(cX); };
template <typename T_char>T_char TU(T_char cX) { return toupper(cX); };
const int vy[] = { -1, -1, -1, 0, 1, 1, 1, 0 }, vx[] = { -1, 0, 1, 1, 1, 0, -1, -1 };
const int dx[4] = { 0,1,0,-1 }, dy[4] = { 1,0,-1,0 };
# define ALL(x)      (x).begin(),(x).end()
# define UNIQ(c)     (isok).erase(unique(ALL((isok))),(isok).end())
# define LOWER(s)    transform(ALL((maze)),(maze).begin(),TL<char>)
# define UPPER(s)    transform(ALL((maze)),(maze).begin(),TU<char>)
# define FOR(i,a,b)  for(LL i=(a);i<(b);i++)
# define RFOR(i,a,b) for(LL i=(a);i>=(b);i--)
# define REP(i,n)    FOR(i,0,n)
# define INIT        std::ios::sync_with_stdio(false);std::cin.tie(0)

int n;
std::vector<int> prime;
void MakePrime(int n) {
	prime.emplace_back(1);
	for (int i = 2; i <= n; i ++) {
		if (!(i % 7 == 1 || i % 7 == 6))continue;
		bool a = false;
		for (int j = 3; j <= std::sqrt(i); j ++) {
			if (!(j % 7 == 1 || j % 7 == 6))continue;
			if (i%j == 0) {
				a = true;
			}
		}
		if (a == false) {
			prime.emplace_back(i);
		}
	}
}

int main() {
	MakePrime(303030);
	while (cin >> n&&n!=1) {
		set<int>ans;
		int pos = upper_bound(ALL(prime), n) - 1 - prime.begin();
		int cop = n;
		for (int i = pos; i >= 1; i--) {
			if (n%prime[i] == 0)ans.insert(prime[i]);
		}
		cout << cop << ":";
		for (auto a : ans) {
			cout << " " << a;
		}
		cout << endl;
	}
}


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

int main(){
        vector<int> N={0,2,0,1,0,1,0,0,1,0,1,0};
        int x,y;
        cin>>x>>y;
        cout <<(N[--x]==N[--y]?"Yes":"No");
        return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<limits.h>
int main(){
	int n,temp,a,i;
	long sum=0,min=LONG_MAX,max=LONG_MIN;
	scanf("%d",&n);
	for(i=0;i<n;i++){
		scanf("%d",&a);
		sum+=a;
		if(min>a){
			min=a;
		}
		if(max<a){
			max=a;
		}	
	}
	printf("%ld %ld %ld\n",min,max,sum);
}


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

using namespace std;


int main(int argc, char* argv[])
{
	int n;
	vector<int> v;
	double d = 0.0;

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

	std::sort(v.begin(), v.end());

	d = (v[0] + v[1]) / 2.0;
	for (int i = 2; i < n; i++) {
		d = (d + v[i]) / 2;
	}
	cout << d << endl;
	return 0;
}

Measured memory_bytes: 256
from math import gcd
from functools import reduce
def main():
    N = int(input())
    A = list(map(int, input().split()))

    M = 10**6+1
    mp = [0]*M
    for a in A:
        mp[a] += 1

    pairwise = 1
    for i in range(2,M):
        if sum(mp[i::i])>1:
            pairwise = 0
            break

    if pairwise:
        print('pairwise coprime')
    elif reduce(gcd, A) == 1:
        print('setwise coprime')
    else:
        print('not coprime')

if __name__ == '__main__':
    main()


Measured memory_bytes: 127744
N=int(input())
A=list(map(int,input().split()))
h=[0]
for a in A:
    h.append(a+h[-1])
h.pop(0)
def spl_l(i,b):
    while abs(h[i]-2*h[b])>abs(h[i]-2*h[b+1]):
        b+=1
    return b
def spl_r(i,b):
    while abs(h[-1]-2*h[b]+h[i])>abs(h[-1]-2*h[b+1]+h[i]):
        b+=1
    return b
def calc(j,i,k):
    pqrs=[h[j],h[i]-h[j],h[k]-h[i],h[-1]-h[k]]
    ans=max(pqrs)-min(pqrs)
    return ans

j=0
k=2
ans=18**20
for i in range(1,N-2):
    j=spl_l(i,j)
    k=spl_r(i,k)
    ans=min(ans,calc(j,i,k))
print(ans)


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

int main() {
	int N;
	int sum = 0;
	cin >> N;
	vector<int> L(N * 2);
	for (int i = 0; i < N * 2; i++) {
		cin >> L[i];
	}
	sort(L.begin(), L.end());
	for (int i = 0; i < N; i++) {
		sum += L[i * 2];
	}
	cout << sum << endl;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
#define ll long long
using namespace std;
ll  a[6];
ll n;
int main()
{

        cin>>n;
        ll sum=0,rest;
        ll t=0,maxs=0;
        for(int i=0;i<5;i++)
           {
              scanf("%lld",&a[i]);
               rest=n/a[i]+(n%a[i]==0?0:1);
              maxs=max(maxs,rest);
           }
          cout<<maxs+4<<endl;
        /*if(n>sum)
        {
             t+=(n-sum)/a[5];
             n=(n-sum)%a[i];
        }
        while(1)
        {

        }*/
        return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<list>
#include<algorithm>
#include<string>

using namespace std;

list<int> l;

int main()
{
	cin.tie(0);
	ios::ios_base::sync_with_stdio(false);
	int orders, x; cin >> orders;
	string order;
	for (int i = 0; i < orders; ++i) {
		cin >> order;
		if (order[0] == 'i') {
			cin >> x;
			l.emplace_front(x);
		}
		else if (order[6] == 'F')l.pop_front();
		else if(order[6]=='L')l.pop_back();
		else{
			cin >> x;
			auto ite = find(l.begin(), l.end(), x);
			if (ite != l.end())l.erase(ite);
		}
	}
	auto ite = l.begin();
	cout << *ite; ++ite;
	while (ite != l.end()) {
		cout <<" " << *ite;
		++ite;
	}cout << endl;
}

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

int main(){
  long n,sum;
  cin >> n;
  sum=0;
  for(int i=1;i<=n;i++){
    if(i%3!=0 && i%5!=0){
      sum+=i;
    }
  }
  cout << sum << endl;
}


Measured memory_bytes: 3596
#include <stdio.h>

int n,k;
long long int w[100000];
int search(long long int mid){
  int a,b;
  int c=0;
  int count=0;
  
  for(a=0;a<n;a++){
    if(c+w[a]<=mid)c=c+w[a];
    else {c=w[a];count++;}
    
    if(count==k) return 0;
  }

  
  return 1;
}
int main(){
  int a;
  long long int mini=1,maxi=1000000000;
  long long int mid;
  
  scanf("%d %d",&n,&k);
  for(a=0;a<n;a++){
    scanf("%d",&w[a]);
    if(mini<w[a])mini=w[a];
  }
  while(mini<maxi){
    mid=(mini+maxi)/2;
    if(search(mid))maxi=mid;
    else mini=mid+1;
  }
  printf("%lld\n",mini);

  
  return 0;
}



Measured memory_bytes: 2484
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;

#define ll long long
#define db long double
#define ii pair<int,int>
#define vi vector<int>
#define fi first
#define se second
#define sz(a) (int)(a).size()
#define all(a) (a).begin(),(a).end()
#define pb push_back
#define mp make_pair
#define FN(i, n) for (int i = 0; i < (int)(n); ++i)
#define FEN(i,n) for (int i = 1;i <= (int)(n); ++i)
#define rep(i,a,b) for(int i=a;i<b;i++)
#define repv(i,a,b) for(int i=b-1;i>=a;i--)
#define SET(A, val) memset(A, val, sizeof(A))
typedef tree<int ,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set ;
// order_of_key (val): returns the no. of values less than val
// find_by_order (k): returns the kth largest element.(0-based)
#define TRACE
#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char* name, Arg1&& arg1){
  cerr << name << " : " << arg1 << std::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...);
}
#else
#define trace(...)
#endif
const int N=1000005;
int d[N];
bool vis[N];
int main()
{
  std::ios::sync_with_stdio(false);
  cin.tie(NULL) ; cout.tie(NULL) ;
  int k;
  cin>>k;
  rep(i,0,k+1) d[i]=k+100;
  deque<int> q;
  q.pb(1);
  d[1]=0;
  while(!q.empty())
    {
      int u=q.front();
      q.pop_front();
      if(vis[u]) continue;
      vis[u]=true;
      d[(u*10)%k]=min(d[u],d[(u*10)%k]);
      q.push_front((u*10)%k);
      d[(u+1)%k]=min(d[u]+1,d[(u+1)%k]);
      q.pb((u+1)%k);
    }
  cout<<d[0]+1<<endl;
  return 0 ;
}


Measured memory_bytes: 1152
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time,copy,functools

sys.setrecursionlimit(10**7)
inf = 10**20
eps = 1.0 / 10**10
mod = 10**9+7
dd = [(-1,0),(0,1),(1,0),(0,-1)]
ddn = [(-1,0),(-1,1),(0,1),(1,1),(1,0),(1,-1),(0,-1),(-1,-1)]

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI_(): return [int(x)-1 for x in sys.stdin.readline().split()]
def LF(): return [float(x) for x in sys.stdin.readline().split()]
def LS(): return sys.stdin.readline().split()
def I(): return int(sys.stdin.readline())
def F(): return float(sys.stdin.readline())
def S(): return input()
def pf(s): return print(s, flush=True)


def main():
    n = I()
    a = [LI() for _ in range(n)]
    m = 2**n

    b = [None] * m
    b[0] = 0
    ii = [2**i for i in range(n+1)]
    dd = {}
    for i in range(n):
        dd[ii[i]] = i
    c = 0
    for i in range(1,m):
        if i >= ii[c+1]:
            c += 1
        t = i - ii[c]
        k = b[t]
        d = a[c]
        while t:
            u = t ^ t - 1 & t
            t ^= u
            k += d[dd[u]]
        b[i] = k

    d = b[:]
    c = 0
    for i in range(1,m):
        if i >= ii[c+1]:
            c += 1
        k = d[i - ii[c]]
        t = i
        while t:
            u = d[t] + d[i^t]
            if k < u:
                k = u
            t = t-1 & i
        d[i] = k

    # print('b',b)
    # print('d',d)

    return d[-1]



print(main())



Measured memory_bytes: 67820
#include<bits/stdc++.h>
using namespace std;
const int maxn = 1e5+7;
int n;
long long a[maxn],b[maxn],sum;
int main()
{
    scanf("%d",&n);
    for(int i=0;i<n;i++)
        scanf("%lld",&a[i]),sum+=a[i];
    long long t=1ll*n*(n+1)/2;
    if(sum%t){
        cout<<"NO"<<endl;
        return 0;
    }
    long long cnt = sum/t;
    for(int i=0;i<n;i++){
        b[i]=(a[(i+1)%n]-a[i]-cnt);
    }
    bool flag = true;
    for(int i=0;i<n;i++){
        if(b[i]>0||(-b[i])%n)
            flag = false;
    }
    puts(flag?"YES":"NO");
}


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

int main() {
  string s; cin >> s;
  int count=0;
  for (int i = 0; i < 4; i++)
  {
    if (s.at(i) == '+') {
      count++;
    }
    else {
      count--;
    }
  }
  cout << count << endl;
}


Measured memory_bytes: 256
N, K = [int(i) for i in input().split(' ')]
As = [int(i) for i in input().split(' ')]

r = 0
f = 1
for i in sorted(As):
    K -= i
    if K < 0:
        f = 0
        break
    r += 1

if f == 1 and K != 0:
    print(r-1)
else:
    print(r)


Measured memory_bytes: 38256
#pragma region Macros
#include <bits/stdc++.h>
#define rep(x,to) for(int (x)=0;(x)<(to);(x)++)
#define rep2(x,fr,to) for(int (x)=(fr);(x)<(to);(x)++)
#define sz(v) (int)(v).size()

using namespace std;
typedef long long ll;
#pragma endregion
int main()
{
	cin.tie(0);
	ios_base::sync_with_stdio(false);
	int H, A;
	cin >> H >> A;

	cout <<  (H + A - 1 )/ A << '\n';

	return 0;
}


Measured memory_bytes: 256
#include <cstdio>
#include <vector>

constexpr int MOD = 1e9+7;

int main() {
  int N;
  scanf("%d", &N);

  std::vector<int> B(N);
  for (int i = 0; i < N; ++i) {
    int A;
    scanf("%d", &A);
    if ((A % 2) == (N % 2))
      return puts("0"), 0;

    ++B[A];
    if (B[A] > 2)
      return puts("0"), 0;

    if (A == 0 && B[A] > 1)
      return puts("0"), 0;
  }

  int res = 1;
  for (int i = 1; i < N; i += 2)
    (res *= 2) %= MOD;

  printf("%d\n", res);
}


Measured memory_bytes: 640
#include<stdio.h>
#include<algorithm>
using namespace std;
int cnt[100005],num[100005];
int main()
{
    int a[20005],n,sum=0;
    scanf("%d",&n);
    for(int i=0;i<n;i++)
    {
        scanf("%d",&a[i]);
    }
    sort(a,a+n);
    for(int i=0;i<n-2;i++)
    {
        int k=i+2;
        for(int j=i+1;j<=n-2;j++)
        {
            while(k<n&&a[k]<a[i]+a[j])
            {
                k++;
            }
            if(k>j)
            {
                sum+=k-j-1;
            }
        }
    }
    printf("%d",sum);
    return 0;
}

Measured memory_bytes: 128
#include <cstdio>
#include <bits/stdc++.h>
#include <algorithm>
#include <iostream>
#include <string>
#include <cmath>
#include <functional>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#define rep(i,n) for (int i=0;i<n;i++)
using ll = long long;
using namespace std;


void solve(){

}
int main (){
    ios::sync_with_stdio(0);
    cin.tie(0);
    string s;
    cin >> s;
    s[3] = '8';
    cout << s;

    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;
import java.util.StringTokenizer;

class Main {
  public static void main(String[] args) {
    Scanner s = new Scanner(System.in);
    StringTokenizer st = new StringTokenizer(s.next(), ",");
    String a = st.nextToken();
    String b = st.nextToken();
    String c = st.nextToken();
    System.out.println(a + " " + b + " " + c);
  }
}


Measured memory_bytes: 21972
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define Max(a, b) (a > b ? a : b)
#define Min(a, b) (a < b ? a : b)
#define ii pair<int, int>
#define fi first
#define se second
const int MAX = 200000; //2 * 10^5
const int MOD = 1000000007; //10^9 + 7
const int OO = 0x3f3f3f3f; // 0x3f3f3f3f;

int32_t main()
{
	int n;
  	cin >> n;
  	int q = ((n + 999) / 1000);
  	cout << 1000 * q - n << '\n';

	return 0;
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#include <algorithm>
#include <string>
#include <math.h>
#include <cstdlib>
#include <cmath> 
#include <vector> 
#include <queue>
using ll = long long;
using namespace std;
ll gcd(ll a,ll b){
    if(b==0)return a;
    if(a>b){
        swap(a,b);
    }
    return gcd(a,b%a);
}
ll lcm(ll a,ll b){
    return a*b/gcd(a,b);
}
int main() {
    ll A;ll B;ll C;ll D;
    cin>>A>>B>>C>>D;
    A=A-1;
    ll lcmOfCD;lcmOfCD =lcm(C,D);
    ll ans;
    //cout<<B/C-A/C<<endl;
    //cout<<B/D-A/D<<endl;
    //cout<<B/lcmOfCD-A/lcmOfCD<<endl;
    //cout<<<<endl;
    ans=B-A-(B/C-A/C+B/D-A/D-(B/lcmOfCD-A/lcmOfCD));
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
#include <unordered_map>
#include <unordered_set>
#define pb push_back
#define mpr make_pair
#define pii pair<int, int>
#define pll pair<ll, ll>
#define ll long long
#define ld long double
#define all(arr) arr.begin(), arr.end()
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define fo(i, l, r) for (int i = l; i <= r; i++)
#define INF 1000000001
#define inf1 1000000000000000001
#define MOD 1000000007
#define pie 3.14159265358979323846264338327950L
#define N 200009
#define M 1e6+9
#define mid(l, r) l + (r - l) / 2
#define vec vector<int>
#define vecl vector<ll>
#define umap unordered_map<ll,ll>
#define yes cout << "Yes" << endl;
#define no cout << "No" << endl;
#define endl "\n"
#define int long long
using namespace std;

int dx[4]={1,0,-1,0},dy[4]={0,1,0,-1};  
int ddx[8]={1,1,0,-1,-1,-1,0,1},ddy[8]={0,1,1,1,0,-1,-1,-1};
ll gcd(ll a,ll b){ if(!a)return b;return gcd(b%a,a);}
ll lcm(ll a, ll b) { return (a*b)/ gcd(a,b);}

// ll n,k,a,b,c,d,x,y,z,m,l;
// ll ans;
// vecl arr(N);
// ll dp[509][509];
// ll pre[N];



void test_case() {
	
   
   int n ;
   cin>>n;

    vec arr(n);
    rep(i,n) {
        cin>>arr[i];
    }

    int ans = 1;
    int ma = arr[0];

    for(int i=1; i<n; i++) {
        if(arr[i] <= ma) {
            ans++;
        }
        ma = min(ma, arr[i]);
    }

    cout<<ans<<endl;

   


    



}


signed main()
{
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cout<<fixed<<setprecision(20);

    // freopen("input.txt", "r", stdin);
    // freopen("output.txt", "w", stdout);


    int t = 1;
    // cin >> t;
    while(t--)
    {   
        test_case();
    }
}

Measured memory_bytes: 4764
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  string N;
  cin>>N;
  
  if(N[0]==N[1]&&N[1]==N[2]
     ||N[1]==N[2]&&N[2]==N[3]){
    cout<<"Yes"<<endl;
  }
  else{
  	cout<<"No"<<endl;
  }
}

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

#include <bits/stdc++.h>
using namespace std;

#define MIN(a, b) (((a) < (b)) ? (a) : (b))
#define MAX(a, b) (((a) > (b)) ? (a) : (b))
#define TRUE (0)
#define FALSE (1)

// This value shold be close to used maximum value.  
#define NUM_MAX 20000000005

// void sort(uint32_t *num, uint32_t size);

int main()
{
    vector<vector<uint64_t>> arr(0);
    vector<uint64_t> temp_vec(0);
    vector<uint64_t> num_vec(0), red_vec(0), green_vec(0), white_vec(0);
    // string result;
    // vector<long long> res_vec(0);
    // uint64_t res_arr[NUM_MAX];
    // uint32_t sum = 0;
    uint64_t num1, white;
    uint64_t num, result2;
    // uint64_t result;
    double length, mass, result;

    // uint32_t res_i = 0;
    // string str_temp, str_temp2;
    int64_t temp, temp2, temp3;
    int64_t i, j, k, l, count, n, x, y, o, size, a, b, c;
    // uint32_t count = 0;
    // string str;
    // uint8_t k_flag;
    
    cin >> count;

    vector<uint64_t> joshi(count);   
    for (k = 0; k < count - 1; k++) {
        cin >> temp;
        joshi.at(temp - 1)++;
    }

    for (k = 0; k < count; k++) {
        cout << joshi.at(k) << endl;
    }

    return 0;
}

// void sort(uint32_t *num, uint32_t size) {
//     uint32_t i, j, k;
//     uint32_t sorted_num;
//     uint32_t array[NUM_MAX] = {0};

//     for (i = 1; i < size + 1; i++) {
//         array[num[i - 1]]++;
//     }

//     sorted_num = 0;

//     for (i = 0; i < NUM_MAX; i++) {
//         for (j = 0; j < array[i]; j++) {
//             num[j + sorted_num] = i;
//         }
//         sorted_num += j;
//         j = 0;
//     }

//     return;
// }


Measured memory_bytes: 4776
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define pp pair<int,int>
#define ll long long
int inf=100000000;
ll INF=5000000000000000000;
ll MOD=1000000007;

int main() {
    int n;
    cin >> n;
    string s1,s2;
    cin >> s1 >> s2;
    int t,p;
    ll ans;
    if (s1.at(0)==s2.at(0)) {ans=3,t=0;p=1;}
    else {ans=6;t=1;p=2;}
    for (int i=p;i<n;i++){
        if (s1.at(i)==s2.at(i) && t==0) {ans=ans*2%MOD;t=0;}
        else if (s1.at(i)==s2.at(i) && t==1) t=0;
        else if (t==0) {ans=ans*2%MOD;t=1;i++;}
        else if (t==1) {ans=ans*3%MOD;i++;}
    }
    cout << ans << endl;
}


Measured memory_bytes: 256
while True:
    n=input()
    if n==0:break
    sa,sb=0,0
    for i in range(n):
        a,b=map(int,raw_input().split())
        if a>b:
            sa+=a+b
        elif a<b:
            sb+=a+b
        elif a==b:
            sa+=a
            sb+=b
    print "%d %d"%(sa,sb)

Measured memory_bytes: 4468
#include <iostream>
#include <string>
#include <unordered_map>

using namespace std;

int main(void){
  string n;
  cin >> n;
  
  int nn = stoi(n);
  
  unordered_map<string, int> m;
  string s;
  bool y = true;
  for (int i = 0; i < nn; i++) {
    cin >> s;
    if (m.find(s) == m.end()){
      m[s] = 1;
    }
    else {
      y = false;
      break;
    }
  }
  
  if (y){
    cout << "YES";
  }
  else {
    cout << "NO";
  }
  
  return 0;
}

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

using namespace std;
typedef long long ll;
typedef pair<ll, ll> p_ll;

template<class T>
void debug(T itr1, T itr2) { auto now = itr1; while(now<itr2) { cout << *now << " "; now++; } cout << endl; }
#define repr(i,from,to) for (ll i=(ll)from; i<(ll)to; i++)
#define all(vec) vec.begin(), vec.end()
#define rep(i,N) repr(i,0,N)
#define per(i,N) for (ll i=(ll)N-1; i>=0; i--)

const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const ll INF = pow(2,30)-1;

vector<ll> fac;
void c_fac(ll x=pow(10,6)+10) { fac.resize(x,true); rep(i,x) fac[i] = i ? (fac[i-1]*i)%MOD : 1; }
ll inv(ll a, ll m=MOD) { ll b = m, x = 1, y = 0; while (b!=0) { ll d = a/b; a -= b*d; swap(a,b); x -= y*d; swap(x,y); } return (x+m)%m; }
ll nck(ll n, ll k) { return fac[n]*inv(fac[k]*fac[n-k]%MOD)%MOD; }
ll modpow(ll x, ll p) { ll result = 1, now = 1, pm = x; while (now<=p) { if (p&now) { result = result * pm % MOD; } now*=2; pm = pm*pm % MOD; } return result; }
ll gcd(ll a, ll b) { if (a<b) swap(a,b); return b==0 ? a : gcd(b, a%b); }
ll lcm(ll a, ll b) { return a/gcd(a,b)*b; }

vector<vector<ll>> adj;

void dfs(vector<ll> &dis, ll n=0, ll p=-1) {
  for (auto x: adj[n]) {
    if (x==p) continue;
    dis[x] = dis[n]+1;
    dfs(dis,x,n);
  }
}

ll calc_d() {
  ll N = adj.size();
  vector<ll> dis(N,-1); dis[0] = 0; dfs(dis,0);
  ll from = 0; rep(i,N) if (dis[from]<dis[i]) from = i;
  dis.assign(N,-1); dis[from] = 0; dfs(dis,from);
  ll result = 0; rep(i,N) result = max(result,dis[i]);
  // cout << result << endl;
  return result;
}


int main() {
  ll N; cin >> N;
  adj.resize(N);
  rep(i,N-1) {
    ll a, b; cin >> a >> b; a--; b--;
    adj[a].push_back(b);
    adj[b].push_back(a);
  }
  ll d = calc_d();
  string result = d%3!=1 ? "First" : "Second";
  cout << result << endl;
  return 0;
}

Measured memory_bytes: 28104
a, b , c = input().split()
ans = 0

n = int(a)
blue = int(b)
red = int(c)

if blue == 0:
  print("0")
elif red == 0:
  print(n)
else:
  if n%(blue+red) >= blue:
  	ans += (n//(blue+red))*blue + blue
  else:
  	ans += (n//(blue+red))*blue + n%(blue+red)
  print(ans)


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

int main() {
  int N;
  cin >> N;
  int64_t ans = 0;
  
  for (int i=1; i<N+1; i++) {
    if ((i%3!=0) && (i%5!=0)) {
      ans +=i;
    }
  }
  cout << ans;
}

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


int main()
{
	int a,b,h;
	cin>>a>>b>>h;
	cout<<(a+b)*h/2<<endl;
	return 0;
}


Measured memory_bytes: 3592
#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"

#define MOD 1000000007 // 1e9+7
#define PI acos(-1.0)
#define ll long long int // 10^18
#define INF 1000000001 // 1e9+1

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------

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

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  int n;cin>>n;
  int alpha_min[26];
  REP(i,26)alpha_min[i]=INF;
  REP(i,n){
    string s;cin>>s;
    int alpha[26]={};
    REP(j,(int)s.size()){
      alpha[(int)(s[j]-97)]++;
    }
    REP(j,26){
      alpha_min[j]=min(alpha_min[j], alpha[j]);
    }
  }
  REP(i,26){
    REP(j,alpha_min[i]){
      cout<<(char)(i+97);
    }
  }
  cout<<"\n";
  return 0;
}


Measured memory_bytes: 256
N = gets.to_i
a = gets.split.map(&:to_i)
 
ans = 0
 
30.times do |i|
  
  f = true
  
  a.each do |j|
    
    if j % 2 == 1
      f = false
      break
    end
  end
  
  if f
    ans += 1
    a = a.map{ |j| j / 2 }
  end
  
  break if !f
 
end
 
puts ans

Measured memory_bytes: 1788
#import sys
#import numpy as np
import math
#from fractions import Fraction
import itertools
from collections import deque
from collections import Counter
#import heapq
#from fractions  import gcd
#input=sys.stdin.readline
import bisect
n=int(input())
xyh=[list(map(int,input().split())) for _ in range(n)]
xyh=sorted(xyh,key=lambda x:x[2])
for cx in range(101):
    for cy in range(101):
        h_a=h_b=10**10
        minh=10**10
        for i in range(n):
            x,y,h=xyh[i]
            if h!=0:
                h_a=h+abs(cx-x)+abs(cy-y)
                if h_a>minh:
                  break
                elif h_b!=10**10 and h_a!=h_b:
                    break
                else:
                    h_b=h_a
            else:
                minh=min(minh,abs(cx-x)+abs(cy-y))
                if minh==0:
                  break
        else:
            if minh==1 and h_a==10**10:
              print(cx,cy,1)
              exit()
            else:
                print(cx,cy,h_a)
                exit()


Measured memory_bytes: 75316
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
const ll MOD = 1e9 + 7;
const ll INF = 1LL << 60;
int R[100000], L[100000];
int ans[100000];
int main() {
	string S;
	cin >> S;
	int N = S.size();
	R[0] = 0;
	for (int i = 1; i < N; i++) {
		if (S[i] == 'R') R[i] = i;
		else R[i] = R[i - 1];
	}
	L[N - 1] = N - 1;
	for (int i = N - 2; i >= 0; i--) {
		if (S[i] == 'L') L[i] = i;
		else L[i] = L[i + 1];
	}
	for (int i = 0; i < N; i++) {
		if (S[i] == 'L') {
			if ((i - R[i]) % 2 == 0) ans[R[i]]++;
			else ans[R[i] + 1]++;
		}
		else {
			if ((L[i] - i) % 2 == 0) ans[L[i]]++;
			else ans[L[i] - 1]++;
		}
	}
	for (int i = 0; i < N; i++) cout << ans[i] << " ";
	cout << endl;
}


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


int main() {
  string s,n;
  
  cin >> s >> n;
  
  bool flag = true;
  
  for(int i =0;i<s.size();i++){
    if(s.at(i)!=n.at(i)){
      flag = false;
      break;
    }
    
  }
  if(flag)
    cout << "Yes";
  else
    cout << "No";
}


Measured memory_bytes: 3620
s = sorted(input())
t = sorted(input())[::-1]
flag = -1
for i,j in zip(s,t):
    if ord(i) < ord(j):
        flag = 1
        break
    elif ord(i) == ord(j):
            flag = 0
    else:
        flag = -1
        break

if flag ==1:
    print("Yes")
elif flag == -1:
    print("No")
else:
    if len(s) < len(t):
        print("Yes")
    elif len(s) >= len(t):
        print("No")

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


int main(){
    int N;
    cin >> N;
    ll sum = 0;
    int cnt = 0;
    vector<int> s;
    if (N == 3) {
        cout << "2 5 63\n";
        return 0;
    }
    
    for (int i = 2; i <= 30000; i++) {
        if (i % 2 == 0 || i % 3 == 0 || i % 5 == 0) {
            s.push_back(i);
            sum += i;
            cnt++;
        }
        if (cnt == (N - 2)) break;
    }
    for (int i = 29900; i <= 29999; i++) {
        bool check = false;
        for (int j = i+1; j <= 30000; j++) {
            if ((sum+i+j) % 30 != 0) continue;
            if ((i % 2 == 0 || i % 3 == 0 || i % 5 == 0) && (j % 2 == 0 || j % 3 == 0 || j % 5 == 0)){
                s.push_back(i);
                s.push_back(j);
                check = true;
                break;
            }
        }
        if (check) break;
    }
    for (int i = 0; i < N; i++) {
        if (i < N-1) printf("%d ", s[i]);
        else printf("%d\n", s[i]);
    }
}


Measured memory_bytes: 512
n = int(input().strip())
a = list(map(int, input().strip().split(" ")))
a.append(0)
a.insert(0, 0)
s = [abs(j - i) for i, j in zip(a, a[1:])]
base = sum(s)
for i in range(1, n + 1):
    if min(a[i - 1], a[i + 1]) <= a[i] <= max(a[i - 1], a[i + 1]):
        print(base)
    elif max(a[i - 1], a[i + 1]) < a[i]:
        print(base - 2 * abs(a[i] - max(a[i - 1], a[i + 1])))
    else:
        print(base - 2 * abs(a[i] - min(a[i - 1], a[i + 1])))


Measured memory_bytes: 14048
S = input()

Frag_1 = True
Frag_2 = True
for a in range(len(S)):
    if a % 2 == 0:

        if S[a] == "R" or S[a] =="U" or S[a] == "D":
            continue
        else:
            Frag_1 = False
    
    elif S[a] == "L" or S[a] =="U" or S[a] == "D":
        continue
    else:
        Frag_2 = False

if Frag_2 == True and Frag_1 == True:
    print("Yes")
else:
    print("No")

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

typedef long long ll;

int main() {
    int N, M;
    cin >> N >> M;
    vector<bool> isac(N,false);
    vector<int> ac(N),wa(N);
    for (int i=0;i<M;i++){
        int p;
        string S;
        cin >> p >> S;
        p--;
        if (S=="AC" && !isac[p]) {
            isac[p] = true;
            ac[p]++;
        }else if (S == "WA" && !isac[p]){
            wa[p]++;
        }
    }
    int sumac = 0, sumwa = 0;
    for (int i=0;i<N;i++){
        if (ac[i] == 0) wa[i] = 0;
        sumac += ac[i];
        sumwa += wa[i];
    }
    cout << sumac << " " << sumwa << endl;

    return 0;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define rep(i,n) for(int64_t i=0;i < (int64_t)(n);i++)
#define invrep(i,n) for(int64_t i=n-1;i >= 0;i--)
#define _GLIBCXX_DEBUG
using namespace std;

int main(){
  string s;
  cin >> s;
  bool ok = false;
  string hi = "";
  rep(i,10){
    hi += "hi";
    if(hi == s){
      ok = true;
    }
  }
  if(ok){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
    
    
}
    
    
  

Measured memory_bytes: 256
#include <algorithm>
#include <array>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#define REP(X, Y, Z) for (ll(X) = (Y); (X) < (Z); (X)++)
#define REV(X, Y, Z) for (ll(X) = (Y); (X) > (Z); (X)--)

using namespace std;
using ll = long long;
using dll = deque<ll>;
using pll = pair<ll, ll>;
using qll = queue<ll>;
using usll = unordered_set<ll>;
using umll = unordered_map<ll, ll>;
using sll = stack<int>;
using vll = vector<ll>;
using vvll = vector<vll>;

constexpr ll kMod = 1e9 + 7;

ll gcd(ll a, ll b) {
  if (a < b) {
    return gcd(b, a);
  }
  ll c = a % b;
  while (c != 0) {
    a = b;
    b = c;
    c = a % b;
  }
  return b;
}

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

void init() {
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
}

int main() {
  init();

  ll H, W;
  cin >> H >> W;
  vector<vll> A(H);
  REP(i, 0, H) {
    string w;
    cin >> w;
    vll a(W);
    REP(j, 0, W) {
      if (w[j] == '#') {
        a[j] = 1;
      } else {
        a[j] = 0;
      }
    }
    A[i] = a;
  }

  ll first = -1;
  ll last = -1;
  REP(w, 0, W) {
    if (first == -1 && A[0][w] == 1) {
      first = w;
    }
    if (last == -1 && A[0][w] == 1) {
      last = w;
    }
    if (last != -1 && A[0][w] == 1) {
      if (w - last > 1) {
        cout << "Impossible" << endl;
        return 0;
      }
      last = w;
    }
  }

  REP(h, 1, H) {
    bool is_f = false;
    ll f = last;
    ll l = 0;
    REP(w, 0, W) {
      if (!is_f && A[h][w] == 1) {
        f = w;
        l = w;

        is_f = true;
        if (last != f) {
          cout << "Impossible" << endl;
          return 0;
        }
      }
      if (A[h][w] == 1) {
        if (w - l > 1) {
          cout << "Impossible" << endl;
          return 0;
        }
        l = w;
      }
    }
    last = l;
  }
  cout << "Possible" << endl;

  return 0;
}


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

using ll=long long;
#define int ll

#define FOR(i,a,b) for(int i=int(a);i<int(b);i++)
#define REP(i,b) FOR(i,0,b)

int read(){
	int i;
	scanf("%lld",&i);
	return i;
}

signed main(){
	int a[3]={read(),read(),read()};
	
	sort(a,a+3);
	
	cout << a[0]+a[1] << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <iomanip>
#include <limits>
#include <string>
#include <vector>
#include <algorithm>
#include <stack>
#include <queue>
#include <map>
#include <list>
#include <cctype>
using namespace std;
typedef long long ll;
#define rep(i,n) for(ll i=0;i<(n);i++)
double PI=acos(-1);

int main(){
    cout << fixed << setprecision(5);
    double a,b,c;
    cin >> a >> b >> c;
    double theta=c*PI/180;
    cout << (a*b*sin(theta))/2 << endl;
    cout << a+b+sqrt(a*a+b*b-2*a*b*cos(theta)) << endl;
    cout << b*sin(theta) << endl;
}


Measured memory_bytes: 3608
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define rep(i, n) for(int i = 0; i < (n); ++i)
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define ALL(v) (v).begin(), (v).end()
#define ios() ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
using ll = long long;
using ull = unsigned long long;
using vi = vector<int>;
using vvi = vector<vi>;
using pii = pair<int,int>;
constexpr ll MOD = 10e9+7;
constexpr ll INF = 1LL << 60;
constexpr int Inf = 1e9;
inline int in() {int x; cin >> x; return x;}
template <typename T> inline void out(const T& x) {cout << x << endl;}
template <class T> inline bool chmin(T &a, T b){if (a > b){a = b;return 1;}return 0;}
template <class T> inline bool chmax(T &a, T b){if (a < b){a = b;return 1;}return 0;}
//UP = 0;RIGHT = 1; DOWN = 2; LEFT =3;
const int dx[] = {0, 1, 0, -1, 1, -1, 1, -1}, dy[] = {1, 0, -1, 0, 1, -1, -1, 1};
int gcd(int a, int b)
{
  if (a < b)
    gcd(b, a);
  int r;
  while ((r = a % b))
  {
    a = b;
    b = r;
  }
  return b;
}
void eratos(bool * isPrime,int max){
  fill(isPrime,isPrime + max,true);
  isPrime[0] = false; 
  isPrime[1] = false; 
  for(int i=2; i<=max/i; ++i) 
      if(isPrime[i]) 
          for(int j=2; j<=max/i; ++j) 
              isPrime[i*j] = false;    
}
//

signed main()
{
  ios();
  string S;
  cin >> S;
  int cnt = 0;
  int ans = 0;
  int l = S.length();
  rep(i,l)
  {
    if(S[i] != 'A' && S[i] != 'C' && S[i] != 'G' && S[i] != 'T')
    {
      ans = max(cnt,ans);
      cnt = 0;
    } else
    {
      cnt++;
    }
  }
  ans = max(cnt,ans);
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
using namespace std;
int main()
{
    ll s;
    cin>>s;
    const int factor=1000000000;
    int x=(factor-s%factor)%factor;
    int y=(s+x)/factor;
    cout<<"0 0 1000000000 1 "<<x<<" "<<y;
    return 0;
}







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

int ns[100];
int ms[100];
int n;
int m;

#define ABS(x) ((x) >= 0 ? (x) : (-x))

int sum(int arr[], int size) {
    int r=0;
    for(int i=0;i<size;i++) r+=arr[i];
    return r;
}

int main(void) {
    while(1) {
        cin >> n >> m;
        if (n==0 && m==0) {
            break;
        }
        for(int i=0; i<n; i++) {
            cin >> ns[i];
        }
        for(int i=0; i<m; i++) {
            cin >> ms[i];
        }
        sort(ns, ns+n);
        sort(ms, ms+m);
        int dif = sum(ns,n) - sum(ms,m);
        int result_n = -1;
        int result_m = -1;
        for(int in=0; in<n; in++) {
            for(int im=0; im<m; im++) {
                //cout << "[d:" << dif << " n:" << ns[in] << " m:" << ms[im] << " d:" << ns[in] - ms[im] << "]" << ((ns[in] - ms[im])*2 == dif) << endl;
                if ((ns[in] - ms[im])*2 == dif) {
                    if (result_n == -1 || (result_n + result_m > ns[in] + ms[im]) ) {
                        result_n = ns[in];
                        result_m = ms[im];
                    }
                }
            }
        }
        if (result_n == -1) {
            cout << -1 << endl;
        } else {
            cout << result_n << " " << result_m << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 1180
#include <iostream>
#include <iomanip>
#include <vector>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1)/ (y))
#define MOD 1000000007ULL

int N, A, B, C, D;
char *S;

void init();

bool check(int b, int e);
bool check_change(int b, int e);

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

    cin >> N >> A >> B >> C >> D;

    S = new char[N + 1];
    cin >> S;

    bool ok = true;
    if (check(A, C) && check(B, D))
    {
        if (D < C)
        {
            if (!check_change(B, D))
            {
                ok = false;
            }
        }
    }
    else
    {
        ok = false;
    }

    cout << ((ok) ? "Yes\n" : "No\n");

    delete[] S;

    return 0;
}

bool check(int b, int e)
{
    for (int i = b - 1; i + 1 < e; ++i)
    {
        if (S[i] == '#' && S[i + 1] == '#')
        {
            return false;
        }
    }
    return true;
}

bool check_change(int b, int e)
{
    for (int i = b - 1; i < e; ++i)
    {
        if (S[i - 1] == '.' && S[i] == '.' && S[i + 1] == '.')
        {
            return true;
        }
    }
    return false;
}



Measured memory_bytes: 512
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

using namespace std;

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

const ll mod = 1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;

struct UnionFind{
    vector<int> rank,p,size;
    UnionFind(int n){
        rank.resize(n,0);
        p.resize(n,0);
        size.resize(n,0);
        for(int i = 0; i < n; i++){
            p[i] = i;
            rank[i] = 0;
            size[i] = 1;
        }
    }
    bool same(int x,int y){
        return root(x) == root(y);
    }
    int root(int x){
        if(x != p[x]){
            p[x] = root(p[x]);
        }
        return p[x];
    }
    void unite(int x,int y){
        int rx = root(x);
        int ry = root(y);
        if(rank[rx] > rank[ry]){
            p[ry] = rx;
            size[rx] += size[ry];
        }else{
            p[rx] = ry;
            size[ry] += size[rx];
            if(rank[rx] == rank[ry]){
                rank[ry]++;
            }
        }
    }
    int tree_size(int x){
        return (size[root(x)]);
    }
};


int main()
{
    int n,m,k;
    cin >> n >> m >> k;
    UnionFind uf(n);
    vector<int> fr,bl;
    fr.resize(n,0);
    int aa[m],bb[m],cc[k],dd[k];
    int sub[n];
    for(int i = 0; i < n; i++){
        sub[i] = 1;
    }
    for(int i = 0; i < m; i++){
        int a,b;
        cin >> a >> b;
        a--; b--;
        if(!uf.same(a,b)) uf.unite(a,b);
        aa[i] = a;
        bb[i] = b;
    }
    for(int i = 0; i < m; i++){
        if(uf.same(aa[i],bb[i])){
            sub[aa[i]]++;
            sub[bb[i]]++;
        }
    }

    for(int i = 0; i < k; i++){
        int c,d;
        cin >> c >> d;
        c--; d--;
        cc[i] = c;
        dd[i] = d;
    }
    for(int i = 0; i < k; i++){
        if(uf.same(cc[i],dd[i])){
            sub[cc[i]]++;
            sub[dd[i]]++;
        }
    }
    for(int i = 0; i < n; i++){
        cout << uf.tree_size(i) - sub[i] << ' ';
    }
}

Measured memory_bytes: 4352
import scipy.misc
import math

n,m = map(int, input().split())

M = m
lst, count = [],[]

for i in range(2,int(math.sqrt(m))+1):
    while M % i == 0:
        M = M // i
        if i not in lst:
            count.append(1)
            lst.append(i)
        else:
            count[-1] += 1
if M > 1:
    lst.append(M)
    count.append(1)       

ans = 1
for i in count:
    ans = ans * scipy.misc.comb(i+n-1,i, exact=1)
    ans = ans % (10**9+7) 

print(int(ans))

Measured memory_bytes: 14996