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

using namespace std;

#define INF 1000000007
#define LINF (1LL << 62)
#define PI 3.14159265358979

typedef long long i64;
typedef pair<i64,i64> P;

inline i64 mod(i64 a, i64 m) { return (a % m + m) % m; }

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



int n, m, a[101010];
bool b[101010];
i64 dp[101010];
void solve(){
	cin >> n >> m;
	for(int i = 0; i < m; i++){
		cin >> a[i];
		b[a[i]] = 1;
	}
	dp[0] = 1;
	for(int i = 0; i < n; i++){
		if(b[i]) continue;
		dp[i+1] = mod(dp[i+1]+dp[i],INF);
		dp[i+2] = mod(dp[i+2]+dp[i],INF);
	}
	cout << dp[n] << endl;
}

int main(){
	std::cin.tie(0);
	std::ios::sync_with_stdio(false);
	int t = 1;
	//cin >> t;
	while(t--){
		solve();
	}
	
	return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <iomanip>
#include <functional> // std::function<void(int)>
using namespace std;
#define int long long
#define All(v) (v).begin(),(v).end()
int dy[4] = {-1,0,1,0};
int dx[4] = {0,1,0,-1};
int Dy[8] = {-1,-1,0,1,1,1,0,-1};
int Dx[8] = {0,1,1,1,0,-1,-1,-1};
const int mod = 1000000007;
const int inf = mod*mod;
const int d5 = 111111;
signed main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n;
    cin>>n;
    int res=0;
    vector<int> a(n);
    for(int i=0;i<n;i++)cin>>a[i];
    for(int i=0;i<n;i++)a[i]--;
    for(int i=0;i<n;i++){
        if(a[a[i]]==i&&a[a[a[i]]]==a[i])res++;
    }
    cout<<res/2<<endl;
}

Measured memory_bytes: 1024
#include <bits/stdc++.h>
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl "\n"
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = ((int)(n)-1); i >= 0; i--)
#define all(x) (x).begin(),(x).end()
 
using namespace std;
using ll = long long;
 
struct edge { int to, cost; };
 
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> P;
 
const int INF = 1e9;
const double EPS = 1e-10;
const int MOD = 1e9+7;
const double PI = acos(-1.0);

const int mx4[] = {0,1,0,-1};
const int my4[] = {1,0,-1,0};
const int mx8[] = {0,1,1,1,0,-1,-1,-1};
const int my8[] = {1,1,0,-1,-1,-1,0,1};



int main(){
	int a,b,t;
	cin >> a >> b >> t;
	int cnt = 0;
	for(int i = 1; i <= t; i++){
		if(i%a == 0) cnt++;
	}
	cout << b * cnt << endl;
	return 0;
}


Measured memory_bytes: 256
import numpy as np

n, m, x = map(int, input().split())
c = [None]*n
a = []
for i in range(n):
	tmp = list(map(int, input().split()))
	c[i] = tmp[0]
	a.append(np.array(tmp[1:]))

min_cost = float('inf')

for i in range(2**n):
	cost = 0
	skill = np.array([0]*m)
	for j in range(n):
		if i>>j & 1 == 1:
			cost += c[j]
			skill += a[j]
	
	if(np.all(skill >= x)):
		min_cost = min(cost, min_cost)

if(min_cost == float('inf')):
	print(-1)
else:
	print(min_cost)






Measured memory_bytes: 27336
from fractions import gcd
from math import ceil,sqrt
a, b = map(int, input().split())

g = gcd(a,b)

s = set()
for i in range(2,ceil(sqrt(g))+1):
    while g % i == 0:
        g //= i
        s.add(i)
if g != 1:
    s.add(int(1e14))
#print(g)
#print(s)
print(len(s)+1)

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

void trace(int a[], int n)
{
  for ( int i = 0; i < n; i++ )
  {
    cout <<a[i];
	if ( i < n-1)
	{
		cout << " ";
	}
	else
	{
      cout << "\n";
	}
}
}
int main()
{	
	int n;
	int k=0;
	int a[100] = {0};
	cin >> n;
	for ( int i = 0; i < n; i++ )
	{
		cin >> a[i];
	}

	trace (a, n);
	for ( int i = 1; i < n; i++)
	{
		for ( int j = i-1; j >= 0; j-- )
		{
			if ( a[j+1] < a[j] )
			{
				k = a[j+1];
			    a[j+1] = a[j];
				a[j] = k;
			}
		}
		trace (a, n);
	}
	return 0;
}


Measured memory_bytes: 3136
#include<bits/stdc++.h>
using namespace std;
int main()
{
    int n,i,k,j,m;
    cin>>n>>k;
    int h[n];
    long long dp[n];
    for(i=0;i<n;i++)
        cin>>h[i];
    for(i=2;i<n;i++)
        dp[i]=INT_MAX;
    dp[0]=0;dp[1]=fabs(h[1]-h[0]);
    for(i=2;i<n;i++)
    {
        if(i-k<0)
            m=0;
        else
            m=i-k;
        for(j=m;j<i;j++)
        {
            if((dp[j]+fabs(h[i]-h[j]))<dp[i])
                dp[i]=dp[j]+fabs(h[i]-h[j]);
        }
    }
    cout<<dp[n-1];
}

Measured memory_bytes: 1408
# https://drken1215.hatenablog.com/entry/2020/05/16/005300

def main():
    from itertools import tee

    N, K = map(int, input().split())
    S = input()

    s1, s2 = tee(S, 2)
    next(s2)

    cnt = 0
    for c1, c2 in zip(s1, s2):
        if c1 != c2:
            cnt += 1

    ans = N - 1 - max(cnt - K * 2, 0)

    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 9292
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <numeric>

using namespace std;

long long modinv(long long a, long long m) {
    long long b = m, u = 1, v = 0;
    while (b) {
        long long t = a / b;
        a -= t * b; swap(a, b);
        u -= t * v; swap(u, v);
    }
    u %= m;
    if (u < 0) u += m;
    return u;
}

int main(void) {
    int X, Y;
    cin >> X >> Y;
    if((X+Y)%3 != 0) {
        cout << 0 << endl;
    } else {
        int N = (X+Y) / 3;
        if(X < N || Y < N) {
            cout << 0 << endl;
        } else {
            int p = (2*Y-X) / 3;
            int q = (2*X-Y) / 3;
            int j_max = min(p, q);
            long long int ans = 1;
            for(int j=1; j<=j_max; j++) {
                ans = ((ans * (N - j_max + j)) % 1'000'000'007 * modinv(j, 1'000'000'007)) % 1'000'000'007;
            }
            cout << ans << endl;
        }
    }
    return 0;
}

Measured memory_bytes: 256
N, M = [int(n) for n in input().split()]
K = []
A = []
for i in range(N):
    L = [int(n) for n in input().split()]
    K.append(L[0])
    A.append(L[1:])

counter = [0] * M

for i in range(N):
    L = A[i]
    for l in L:
        counter[l - 1] += 1

indices = [i for i, c in enumerate(counter) if c == N]

print(len(indices))


Measured memory_bytes: 3064
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
#include <bits/stdc++.h>
/*#pragma GCC optimize("Ofast","unroll-loops","omit-frame-pointer","inline") //Optimization flags
#pragma GCC option("arch=native","tune=native","no-zero-upper") //Enable AVX
#pragma GCC target("avx2")  //Enable AVX*/

using namespace std;

using ll = long long;

#define mp make_pair

const int p = 998244353;


int mul(int a, int b) {
    return (1LL * a * b) % p;
}

int add(int a, int b) {
    int s = (a+b);
    if (s>=p) s-=p;
    return s;
}

int sub(int a, int b) {
    int s = (a+p-b);
    if (s>=p) s-=p;
    return s;
}

int po(int a, int deg)
{
    if (deg==0) return 1;
    if (deg%2==1) return mul(a, po(a, deg-1));
    int t = po(a, deg/2);
    return mul(t, t);
}

int inv(int n)
{
    return po(n, p-2);
}

/*struct DSU {
    vector<int> sz;
    vector<int> parent;

    void make_set(int v) {
        parent[v] = v;
        sz[v] = 1;
    }

    int find_set(int v) {
        if (v == parent[v])
            return v;
        return parent[v] = find_set(parent[v]);
    }

    void union_sets(int a, int b) {
        a = find_set(a);
        b = find_set(b);
        if (a != b) {
            if (sz[a] < sz[b])
                swap(a, b);
            parent[b] = a;
            sz[a] += sz[b];
        }
    }

    DSU(int n) {
        sz.resize(n);
        parent.resize(n);
        for (int i = 0; i < n; i++) make_set(i);
    }
};*/

/*const int N = 1000000;

vector<int> facs(N), invfacs(N);

void init()
{
    facs[0] = 1;
    for (int i = 1; i<N; i++) facs[i] = mul(facs[i-1], i);
    invfacs[N-1] = inv(facs[N-1]);
    for (int i = N-2; i>=0; i--) invfacs[i] = mul(invfacs[i+1], i+1);
}

int C(int n, int k)
{
    return mul(facs[n], mul(invfacs[k], invfacs[n-k]));
}*/



int main() {
    ios_base::sync_with_stdio(0);
    cin.tie(nullptr);

    int n, k;
    cin>>n>>k;
    vector<ll> a(n);
    for (int i = 0; i<n; i++) cin>>a[i];

    ll cursum = 0;
    for (int i = 0; i<k; i++) cursum+=a[i];

    ll L = 0;
    ll R = 0;
    for (int i = k; i<n; i++) R+=max(0ll, a[i]);

    ll res = L + R + max(cursum, 0ll);
    for (int i = k; i<n; i++)
    {
        L+=max(0ll, a[i-k]);
        R-=max(0ll, a[i]);
        cursum-=a[i-k];
        cursum+=a[i];
        //cout<<L<<' '<<R<<' '<<cursum<<endl;
        //cout<<L + R + max(cursum, 0ll)<<endl;
        res = max(res, L + R + max(cursum, 0ll));
    }
    cout<<res;
}




Measured memory_bytes: 1024
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Math;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            A();
        }

        static void A()
        {
            var xy = ReadSplitInt();
            var a = new List<int> { 1, 3, 5, 7, 8, 10, 12 };
            var b = new List<int> { 4, 6, 9, 11 };
            YesOrNo((a.Contains(xy[0]) && a.Contains(xy[1])) || (b.Contains(xy[0]) && b.Contains(xy[1])) || (xy.All(x => x == 2)));
        }

        static List<long> ReadLines(long n)
        {
            var l = new List<long>();
            for (long i = 0; i < n; i++)
            {
                l.Add(ReadLong());
            }
            return l;
        }

        static void YESOrNO(bool e)
        {
            if (e) Println("YES");
            else Println("NO");
        }

        static void YesOrNo(bool e)
        {
            if (e) Println("Yes");
            else Println("No");
        }

        static IEnumerable<int> Range(int start, int stop)
        {
            if (start < 0 || stop < 0 || start > stop || (start <= 0 && stop <= 0))
                return new List<int>();

            return Enumerable.Range(start, stop - start);
        }

        static bool IsDigit(string str)
        {
            var i = 0;
            return int.TryParse(str, out i);
        }

        static int SumDigits(long num)
        {
            return num.ToString().Select(x => x.ToString()).Sum(int.Parse);
        }

        static int[] ToIntArray(string str)
        {
            return str.Select(x => x.ToString()).Select(int.Parse).ToArray();
        }

        static long Gcd(long a, long b) => b == 0 ? a : Gcd(b, a % b);
        static long Lcm(long a, long b) => a / Gcd(a, b) * b;

        static bool IsPrime(int x)
        {
            if (x <= 1 || (x != 2 && x % 2 == 0)) return false;
            if (x == 2) return true;

            for (int i = 3; i < x; i += 2)
                if (x % i == 0) return false;

            return true;
        }

        static string Read() => Console.ReadLine();
        static int ReadInt() => int.Parse(Read());
        static long ReadLong() => long.Parse(Read());

        static List<string> ReadSplit() => Read().Split().ToList();
        static List<int> ReadSplitInt() => Read().Split().Select(int.Parse).ToList();
        static List<long> ReadSplitLong() => Read().Split().Select(long.Parse).ToList();

        static void Print(object value) => Console.Write(value.ToString());
        static void Println(object value) => Console.WriteLine(value.ToString());

        static string Join<T>(IEnumerable<T> list) => string.Join("", list);
    }

    public static class MyExtensions
    {
        public static string Slice(this string str, int start = 0, int stop = 0)
        {
            if (start > str.Length || stop > str.Length || start < 0 || stop < 0)
                return "";

            if (stop == 0) stop = str.Length;
            return str.Substring(start, stop - start);
        }
    }
}


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

typedef long long ll;
typedef unsigned long long ull;
typedef string st;
typedef double db;
typedef vector<long long> vecll;
typedef vector<char> vechar;
typedef vector<string> vecst;

int main(){
    ll N, K;
    cin >> N >> K;
    vecll l(N);
    for(auto& i : l) cin >> i;
    sort(l.begin(), l.end(), greater<ll>());
    ll ans = 0;
    for(ll i = 0; i < K; i++) ans += l.at(i);
    cout  << ans <<endl;
}

Measured memory_bytes: 764
#include<bits/stdc++.h>
using namespace std;
#define MOD 1000000007
#define BIG 1000000010
#define EPS 1e-9
#define fst first
#define scd second

#define debug(x) cout<<x<<endl;
#define repi(i,x,n) for(int i=x;i<n;i++)
#define rep(i,n) repi(i,0,n)
#define repn(i,n) for(int i=n;i>=0;i--)
#define int long long


signed main(){
  cin.tie(0);	
  ios::sync_with_stdio(false);
  int n;
  cin>>n;
  pair<int,int> a[200000];
  rep(i,n){
    int x,y;
    cin>>x>>y;
    a[i]=make_pair(y,x);
  }
  int nowt=BIG;
  sort(a,a+n);
  repn(i,n-1){
    nowt=min(nowt-a[i].scd , a[i].fst-a[i].scd);
    if(nowt<0){cout<<"No"<<endl;return 0;}
  }
  cout<<"Yes"<<endl;
  

  return 0;
}


Measured memory_bytes: 3328
sx, sy, tx, ty = map(int, input().split())
result = ""
result = result+"R"*(tx-sx)
result = result+"U"*(ty-sy)
result = result+"L"*(tx-sx)
result = result+"D"*(ty-sy)
result = result+"D"
result = result+"R"*(tx-sx+1)
result = result+"U"*(ty-sy+1)
result = result+"L"
result = result+"U"
result = result+"L"*(tx-sx+1)
result = result+"D"*(ty-sy+1)
result = result+"R"
print(result)

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using Graph = vector<vector<int>>;
const int INF = 1e9 + 1;
const ll LLINF = 1e18;
const int MOD = 1e9 + 7;
using Complex = complex<double>;
const double PI = acos(-1);

vector<Complex> dft(vector<Complex> A, int inverse = 1) {
    int n = A.size(), mask = n - 1;
    vector<Complex> tmp(n);
    for (int i = n >> 1; i >= 1; i >>= 1) {
        double theta = 2 * PI * i * inverse / n;
        Complex zeta(cos(theta), sin(theta));
        Complex powzeta = 1;
        for (int j = 0; j < n; j += i) {
            for (int k = 0; k < i; ++k) {
                // a[jk] = a[j0k] + powzeta * a[j1k]
                tmp[j | k] = A[((j << 1) | k) & mask] +
                             powzeta * A[((j << 1) | i | k) & mask];
            }
            powzeta *= zeta;
        }
        swap(A, tmp);
    }
    if (inverse == -1)
        for (int i = 0; i < n; ++i)
            A[i] /= n;
    return A;
}

vector<Complex> conv(vector<Complex> A, vector<Complex> B) {
    int siz = A.size() + B.size() + 1, n = 1;
    while (n < siz)
        n <<= 1;
    A.resize(n), B.resize(n);
    A = dft(A), B = dft(B);
    for (int i = 0; i < n; ++i)
        A[i] *= B[i];
    A = dft(A, -1);
    return A;
}

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

    int N, maxA = 0;
    ll M;
    cin >> N >> M;
    vector<int> cnt(100001);
    for (int i = 0; i < N; ++i) {
        int a;
        cin >> a;
        maxA = max(maxA, a);
        cnt[a]++;
    }

    vector<Complex> A(maxA + 1);
    for (int i = 0; i <= maxA; ++i)
        A[i] = cnt[i];

    vector<Complex> f = conv(A, A);
    ll ans = 0;
    for (int i = 2 * maxA; i >= 1; --i) {
        ll tmp = f[i].real() + 0.5;
        if (tmp > 0) {
            if (M > tmp) {
                ans += (ll)i * tmp;
                M -= tmp;
            } else {
                ans += i * M;
                M = 0;
                break;
            }
        }
    }

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


Measured memory_bytes: 18632
def resolve():
    import sys
    input = sys.stdin.readline
    # 整数 1 つ
    n = int(input())
    A = list(map(int, input().split()))
    # 整数複数個
    # a, b = map(int, input().split())
    # 整数 N 個 (改行区切り)
    # N = [int(input()) for i in range(N)]
    # 整数 N 個 (スペース区切り)
    #A = list(map(int, input().split()))
    # 整数 (縦 H 横 W の行列)
    #BC = [list(map(int, input().split())) for i in range(q)]

    List = [0] * (10**5 +1)
    sumlist = 0
    for a in A:
        List[a] += 1
        sumlist += a

    q = int(input())
    for _ in range(q):
        b, c = map(int, input().split())
        sumlist = sumlist - (b * List[b]) + (c * List[b])
        print(sumlist)
        List[c] += List[b]
        List[b] = 0

resolve()

Measured memory_bytes: 84008
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <queue>
#include <climits>
#include <set>
#include <map>
#include <stack>
#include <iomanip>
#include <tuple>
#define ll long long
#define rep(i,s,n) for(ll i = (ll)(s); i < (ll)(n); i++)
#define all(a) (a).begin(),a.end()
#define mod 1000000007
using namespace std;
using graph =vector<vector<ll>>;
/*階乗*/
ll factorial(ll n){
    if(n==0){
        return 1;
    }
    else{
        return (n%mod)*(factorial(n-1)%mod);
    }
}

/* ユークリッドの互除法 最大公約数*/
ll gcd(ll a, ll b) {
	return b ? gcd(b,a%b) : a;
}



/*最小公倍数*/

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


/*二点間の距離*/
double dist(pair<double,double> a,pair<double,double> b){
	return sqrt(pow((a.first - b.first) ,2) + pow((a.second - b.second),2));
}

//繰り返し自乗法
double ism(double aa,ll p){
    double ap=aa;
    double ans=1;
    while(p>0){
        //cout<<"p="<<p<<",ap="<<ap<<endl;
        if(p&1){//奇数が真
            ans*=ap;
        }
        p/=2;
        ap=ap*ap;
    }
    return ans;

}
//繰り返し自乗法(アマリトリバージョン)
ll ismm(ll aa,ll p,ll m){
    ll ap=aa;
    ll ans=1;
    while(p>0){
        //cout<<"p="<<p<<",ap="<<ap<<endl;
        if(p&1){//奇数が真
            ans=(ans*ap)%m;    
        }
        p/=2;              
        ap=(ap*ap)%m;
    }
    return ans;

}
/*
ll solve(ll i,ll m,vector<ll>t,ll n){
    if(m==0){
        return 1;
    }
    if(i>=n){
        return 0;
    }
    
    
    cout<<i+1<<" "<<m<<endl;
    cout<<i+1<<" "<<m-t[i]<<endl;
    ll res=solve(i+1,m,t,n)||solve(i+1,m-t[i],t,n);
    return res;
}
*/
//組み合わせの数nCrを計算
    ll calcNumOfCombination(ll n, ll r){
        return factorial(n) / (factorial(r) * factorial(n-r));
    }

//小数点12桁
struct all_init
{
    all_init()
    {
        cout << fixed << setprecision(12);
    }
} All_init;


int main()
{
    ll n,m;
    cin>>n>>m;
    cout<<n*(n-1)/2+m*(m-1)/2<<endl;


    
}


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

const int MOD = 1e9 + 7;
const int iINF = 1000000000;
const long long int llINF = 1000000000000000000;

using namespace std;
using ll = long long int;
using P = pair<int, int>;
using edge = struct {
  int to;
  int cost;
};
#define REP(i, n) for (ll i = 0; i < (n); i++)
#define FOR(i, n, m) for (ll i = (n); i < (m); i++)
#define ALL(a) (a).begin(), (a).end()
#define MAX(vec) *std::max_element(vec.begin(), vec.end())
#define MIN(vec) *std::min_element(vec.begin(), vec.end())
#define MAXI(vec)                                                              \
  std::distance(vec.begin(), *std::max_element(vec.begin(), vec.end()))
#define MINI(vec)                                                              \
  std::distance(vec.begin(), *std::min_element(vec.begin(), vec.end()))

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

template <typename T, typename U> U READ(ll V, T a, U b) {
  REP(i, V) {
    cin >> a;
    b.push_back(a);
  }
  return b;
}

int main() {
  ll N = 0;
  vector<ll> A;
  ll sum = 0;
  ll po = 0;
  cin >> N;
  REP(i, N) {
    cin >> po;
    po -= i + 1;
    A.push_back(po);
    sum += po;
  }
  ll ave = sum / N;
  ll ans1 = 0, ans2 = 0;
  sort(ALL(A));
  REP(i, N) { ans1 += abs(A[i] - A[A.size() / 2]); }
  REP(i, N) { ans2 += abs(A[i] - A[1 + A.size() / 2]); }

  cout << min(ans1, ans2) << endl;
  return 0;
}


Measured memory_bytes: 2420
#include <bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define re return
typedef vector<int> vi;
typedef long long ll;
typedef pair<int, int> pii;
int n;
pair< pair<string,int> ,int > p[111];
bool cmp(pair< pair<string,int> ,int > a,pair< pair<string,int> ,int > b){
	if(a.first.first!=b.first.first)return a.first.first<b.first.first;
	return a.first.second>b.first.second;
}
int main() { 
    //freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	cin>>n;
	for(int i=0;i<n;i++){
		cin>>p[i].first.first>>p[i].first.second;
		p[i].second=i+1;
	}
	sort(p,p+n,cmp);
	for(int i=0;i<n;i++)cout<<p[i].second<<endl;
    return 0; 
}

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

public class Main {

	static Scanner scanner;
	static int[] C;
	static int[][] A;
	public static void main(String[] args) {
	    scanner = new Scanner(System.in);

	    int[] a=new int[3];
	    a[0]=gi();
	    a[1]=gi();
	    a[2]=gi();
	    Arrays.parallelSort(a);
        System.out.println(a[2]-a[0]);
//        if (a<b) {
//        	System.out.print(Math.max(b-a-w, 0));
//        }else {
//        	System.out.print(Math.max(a-b-w, 0));
//        }


	}

	// 文字列として入力を取得
	public static String gs() {
		return scanner.next();
	}

	// intとして入力を取得
	public static int gi() {
		return Integer.parseInt(scanner.next());
	}

	// longとして入力を取得
	public static long gl() {
		return Long.parseLong(scanner.next());
	}

	// doubleとして入力を取得
	public static double gd() {
		return Double.parseDouble(scanner.next());
	}
}

Measured memory_bytes: 35588
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define fo(a,b) for(int a=0;a<b;a++)
#define Sort(a) sort(a.begin(),a.end())
#define rev(a) reverse(a.begin(),a.end())
#define fi first
#define se second
#define co(a) cout<<a<<endl
#define sz size()
#define bgn begin()
#define en end()
#define pb(a) push_back(a)
#define pp() pop_back()
#define V vector
#define P pair
#define V2(a,b,c) V<V<int>> a(b,V<int>(c))
#define V2a(a,b,c,d) V<V<int>> a(b,V<int>(c,d))
#define incin(a) int a; cin>>a
#define yuko(a) setprecision(a)
#define uni(a) a.erase(unique(a.begin(),a.end()),a.end())
//#define min min<int>
//#define max max<int>
template<class T>
 void cou(vector<vector<T>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}
/*template<>
 void cou(vector<vector<char>> a){
  int b=a.size();
  int c=a[0].size();
  fo(i,b){
    fo(j,c){
      cout<<a[i][j];
      if(j==c-1)
        cout<<endl;
      else
        cout<<' ';
    }
  }
}*/
 int wari(int a,int b) {
   if(a%b==0)
     return a/b;
   else
     return a/b+1;
 }
 int keta(int a){
  double b=a;
  b=log10(b);
  int c=b;
  return c+1;
 }
 int souwa(int a){
  return a*(a+1)/2;
 }
 /*int lcm(int a,int b){
  int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return d*e/f;
    }
  int gcm(int a,int b){
      int d=a,e=b,f;
  if(a<b)
    swap(a,b);
  int c,m=1;
  while(m){
    c=a%b;
    if(c==0){
       f=b;
      m--;
    }
    else{
      a=b;
      b=c;
 }
  }
  return f;
  }*/
 bool prime(int a){
   if(a<2)
     return false;
   else if(a==2)
     return true;
   else if(a%2==0)
     return false;
   double b=sqrt(a);
    for(int i=3;i<=b;i+=2){
      if(a%i==0){
        return false;
      }
    }
   return true;
 }
struct Union{
  vector<int> par;
  Union(int a){
  par= vector<int>(a,-1);
  }
  int find(int a){
    if(par[a]<0)
      return a;
    else
      return par[a]=find(par[a]);
  }
  bool same(int a,int b){
    return find(a)==find(b);
  }
  int Size(int a){
    return -par[find(a)];
  }
  void unite(int a,int b){
    a=find(a);
    b=find(b);
    if(a==b)
      return;
    if(Size(b)>Size(a))
      swap<int>(a,b);
    par[a]+=par[b];
    par[b]=a;
  }
};
int ketas(int a){
  string b=to_string(a);
  int c=0;
  fo(i,keta(a)){
    c+=b[i]-'0';
  }
  return c;
}
int gcm(int a,int b){
    if(b==0)
        return a;
    return gcm(b,a%b);
}
int lcm(int a,int b){
    return a/gcm(a,b)*b;
}
/*struct aa{
  vector<int> gt;
  aa(int n){
  gt= vector<int>(n, 1);
  }
  void c(V<int> d,int b){
  if(d[b]==0){
    gt[d[b]-1]++;
    gt[gt.sz-1]++;
  }
  else{
    gt[d[b]-1]++;
    c(d,d[d[b]]-1);
  }
}
void cok(int a){
  cout<<gt[a-1]<<endl;
  fo(i,a-1)
  cout<<gt[i]<<endl;
}
};
*/
/*struct dfs(){

}*/
signed main(){
  int a,b;
  cin>>a>>b;
  if(a%b==0)
    cout<<a/b<<endl;
  else
    cout<<a/b+1<<endl;
}

Measured memory_bytes: 256
#include <algorithm>
#include <assert.h>
#include <iostream>
#include <cstring>
#include <vector>
#include <cstdio>
#include <cmath>

using namespace std;

template <typename T> void chmax(T &x, const T &y)
{
	if(y > x) x = y;
}

template <typename T> void read(T &x)
{
	x = 0; char c = getchar(); bool f = 0;
	while(!isdigit(c) && c!='-') c = getchar();
	if(c == '-') f = 1, c = getchar();
	while(isdigit(c)) x = x*10+c-'0', c = getchar();
	if(f) x = -x;
}

const int MX = 200005;

char s[MX];
int f[MX][3];

int main()
{
	scanf("%s", s+1);
	int n = strlen(s+1);
	f[1][1] = 1;
	f[2][2] = 1;
	for(int i=2; i<=n; i++)
	{
		chmax(f[i][2], f[i-2][1]+1);
		chmax(f[i][1], f[i-1][2]+1);
		if(s[i] != s[i-1]) chmax(f[i][1], f[i-1][1]+1);
	}
	printf("%d\n", max(f[n][1], f[n][2]));
	return 0;
}


Measured memory_bytes: 3324
#include <algorithm>
#include <bitset>
#include <climits>
#include <cmath>
#include <cstdio>
#include <functional>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <vector>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
#define REP(var, a, b) for (int var = (a); var < (b); var++)
#define rep(var, n) for (int var = 0; var < (n); ++var)
#define ALL(c) (c).begin(), (c).end()
#define rALL(c) (c).rbegin(), (c).rend()
ll MOD = 1000000007;
const ll INF = 1LL << 60;

struct mint {
  ll x;
  mint(ll x = 0) : x(x % MOD) {}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += MOD - a.x) >= MOD) x -= MOD;
    return *this;
  }
  mint& operator*=(const mint a) {
    (x *= a.x) %= MOD;
    return *this;
  }
  mint operator+(const mint a) const {
    mint res(*this);
    return res += a;
  }
  mint operator-(const mint a) const {
    mint res(*this);
    return res -= a;
  }
  mint operator*(const mint a) const {
    mint res(*this);
    return res *= a;
  }
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t >> 1);
    a *= a;
    if (t & 1) a *= *this;
    return a;
  }

  // for prime MOD
  mint inv() const { return pow(MOD - 2); }
  mint& operator/=(const mint a) { return (*this) *= a.inv(); }
  mint operator/(const mint a) const {
    mint res(*this);
    return res /= a;
  }
};

int main() {
  //
  ll n;
  cin >> n;
  vl a(n);
  vector<vector<pll>> xy(n);
  rep(i, n) {
    cin >> a[i];
    rep(j, a[i]) {
      ll x, y;
      cin >> x >> y;
      x--;
      xy[i].push_back({x, y});
    }
  }
  ll ans = 0;
  for (ll x = 1; x < (1LL << n); x++) {
    bool ok = true;
    ll cnt = 0;
    rep(i, n) {
      if (((x >> i) & 1) == 0) continue;
      cnt++;
      rep(j, a[i]) {
        pll p = xy[i][j];
        ll k = p.first;
        ll v = p.second;
        if (((x >> k) & 1) != v) {
          // cerr << x << ":" << i << "," << k << "," << v << endl;
          ok = false;
        }
      }
    }
    if (ok) ans = max(ans, cnt);
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main()
{
    int N; cin >> N;
    vector<int> L(N); for (int& l : L) cin >> l;
    int M = *max_element(begin(L), end(L));
    int sum = accumulate(begin(L), end(L), 0);
    cout << (M < sum - M ? "Yes" : "No") << endl;
    return 0;
}

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

using namespace std;

vector<int> v;

int solve(int s, int n) {
  map<int, int> count;
  int mx1 = 0, mx2 = 0, i1;
  for (int i = s; i < n; i+=2) {
    count[v[i]]++;
    if (mx1 < count[v[i]]) {
      mx1 = count[v[i]];
      i1 = i;
    }
  }
  count.clear();
  for (int i = 1-s; i < n; i+=2) {
    count[v[i]]++;
    if (mx2 < count[v[i]] && v[i] != v[i1]) {
      mx2 = count[v[i]];
    }
  }
  return n - mx1 - mx2;
}

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

  int n; 
  cin >> n;
  v.resize(n);

  for (int i = 0; i < n; ++i) {
    cin >> v[i];
  }
  cout << min(solve(0, n), solve(1, n)) << endl;

  return 0;
}



Measured memory_bytes: 2944
/*
--------------              |   /
      |                     |  /
      |                     | /
      |             *       |/          |    |         ------            *
      |                     |           |    |        /      \
      |             |       |\          |    |       |       |\          |
   \  |             |       | \         |    |       |       | \         |
    \ |             |       |  \        |    |        \     /   \        |
     V              |       |   \        \__/|         -----     \       |
*/
#include <bits/stdc++.h>
using namespace std;

#define EmiliaMyWife ios::sync_with_stdio(0); cin.tie(NULL);
#define mem(i,j) memset(i,j,sizeof (i));
#define F first
#define S second
#define lowbit(x) ((x)&(-(x)))
#define siz(v) (int)(v).size()
typedef int64_t ll;
typedef uint64_t ull;
typedef long double ld;
const double EPS  = 1e-8;
const int INF     = 0x3F3F3F3F;
const ll LINF     = 4611686018427387903;
const int MOD     = 1e9+7;
/*-----------------------------------------------------------------------------------------------------*/

signed main() {
	EmiliaMyWife

	int n;
	cin >> n;
	vector<ll> arr(n+1), sum(n+1);
	vector<vector<ll>> dp(n+2, vector<ll>(n+2));
	for(int i = 1; i <= n; i++)
		cin >> arr[i], sum[i] = arr[i]+sum[i-1];
	for(int j = 1; j <= n; j++)
		for(int i = j; i; i--){
			if(i == j)
				dp[i][j] = arr[i];
			else
				dp[i][j] = sum[j]-sum[i-1]-min(dp[i+1][j], dp[i][j-1]);
		}
	cout << 2*dp[1][n]-sum[n] << '\n';
	

	return 0;
}


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

int main(){
    ll N, M;
    cin >> N >> M;

    if(N > M/2) cout << M /2 << endl;
    else{
        ll tmp = N * 2 + M;
        cout << tmp/ 4 << endl;
    }

    return 0;
}

Measured memory_bytes: 256
function Main(input) {

	// 1行目がinput[0], 2行目がinput[1], …に入る
	input = input.split("\n");
    
    let [D, T, S] = [...input[0].split(" ")].map(Number);
    
    if (D / S <= T) console.log("Yes");
    else console.log("No");
    
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));

Measured memory_bytes: 29676
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <numeric>
#include <bitset>
#include <cmath>

static const int MOD = 1000000007;
using ll = long long;
using u32 = uint32_t;
using namespace std;

template<class T> constexpr T INF = ::numeric_limits<T>::max()/32*15+208;

class UnionFind {
    int n;
    vector<int> uni;
public:
    explicit UnionFind(int n) : uni(static_cast<u32>(n), -1) , n(n){};

    int root(int a){
        if (uni[a] < 0) return a;
        else return (uni[a] = root(uni[a]));
    }

    bool unite(int a, int b) {
        a = root(a);
        b = root(b);
        if(a == b) return false;
        if(uni[a] > uni[b]) swap(a, b);
        uni[a] += uni[b];
        uni[b] = a;
        return true;
    }

    int size(int i){ return -uni[root(i)]; }
    bool same(int a, int b) { return root(a) == root(b); }
};

int main() {
    int n, m;
    cin >> n >> m;
    UnionFind uf(n);
    for (int i = 0; i < m; ++i) {
        int x, y, z;
        scanf("%d%d%d", &x, &y, &z);
        x--; y--;
        uf.unite(x, y);
    }
    set<int> s;
    for (int i = 0; i < n; ++i) {
        s.insert(uf.root(i));
    }
    cout << s.size() << "\n";
    return 0;
}

Measured memory_bytes: 5376
#include<set>
#include<map>
#include<deque>
#include<queue>
#include<stack>
#include<cmath>
#include<ctime>
#include<bitset>
#include<string>
#include<vector>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<climits>
#include<complex>
#include<iostream>
#include<algorithm>
#define ll long long
#define inf 1e9
using namespace std;

const int maxn = 101000;

int n,m;

struct edge
{
	int y,nex;
	edge(){}
	edge(const int _y,const int _nex){y=_y;nex=_nex;}
}a[maxn<<1]; int len, fir[maxn];
bool e[maxn<<1];
inline void ins(const int x,const int y){a[++len]=edge(y,fir[x]);fir[x]=len;}

int cir[maxn],cn;
bool inc[maxn];
int t[maxn],tp;
bool v[maxn];
bool f_cir(const int x,const int pre)
{
	if(v[x])
	{
		int la=0;
		while(la!=x) inc[cir[++cn]=la=t[tp--]]=true;
		return true;
	}
	v[x]=true; t[++tp]=x;
	if(x==6||x==15)
	{
		int ii=1;
	}
	for(int k=fir[x];k;k=a[k].nex) if(k!=(pre^1))
	{
		if(f_cir(a[k].y,k)) return true;
	}
	tp--;
	return false;
}

int col[maxn],num[2];
void Color(const int x,const int ff)
{
	num[col[x]==1]++;
	for(int k=fir[x];k;k=a[k].nex)
	{
		const int y=a[k].y;
		if(inc[y]||y==ff) continue;
		
		col[y]=-col[x];
		Color(y,x);
	}
}
int s[maxn],o[maxn];
int dfs(const int x,const int ff)
{
	s[x]=0;
	int re=col[x];
	for(int k=fir[x];k;k=a[k].nex)if(!e[k])
	{
		const int y=a[k].y;
		if(inc[y]||y==ff) continue;
		int tmp=dfs(y,x);
		s[x]+=s[y]+abs(tmp);
		re+=tmp;
	}
	return re;
}

int solve()
{
	t[tp=1]=0;
	int la=0;
	for(int i=2;i<=cn;i++)
	{
		la+=o[cir[i]];
		t[++tp]=-la;
	}
	int mid=(1+tp)>>1;
	std::nth_element(t+1,t+mid,t+tp+1);
	int ans=0,A=t[mid];
	for(int i=1;i<=tp;i++) ans+=abs(A-t[i]);
	return ans;
}

int main()
{
	int T; T=1; int ti=0;
	while(T--)
	{
		ti++;
		len=1; memset(fir,0,sizeof fir);
		
		scanf("%d%d",&n,&m);
		for(int i=1;i<=n;i++) inc[i]=false;
		for(int i=1;i<=m;i++)
		{
			int x,y; scanf("%d%d",&x,&y);
			ins(x,y); ins(y,x);
		}
		
		num[0]=num[1]=0;
		if(n==m+1)
		{
			col[1]=-1; Color(1,0);
			if(num[0]!=num[1]) { printf("-1\n"); continue; }
			int k=dfs(1,0);
			printf("%d\n",s[1]);
		}
		else
		{
			cn=0; tp=0; for(int i=1;i<=n;i++) v[i]=false;
			bool flag=f_cir(1,0);
			
			for(int i=1;i<=cn;i++) col[cir[i]]=(i&1)?1:-1,Color(cir[i],0);
			if(cn&1)
			{
				if((num[0]&1)!=(num[1]&1)) { printf("-1\n"); continue; }
				if(num[0]<num[1])
				{
					swap(num[0],num[1]);
					for(int i=1;i<=n;i++) col[i]=-col[i];
				}
				int ek,re=0;
				for(int k=fir[cir[1]];k;k=a[k].nex) if(a[k].y==cir[cn])
				{
					e[ek=k]=true; e[ek^1]=true;
					int tmp=(num[0]-num[1])>>1;
					col[cir[1]]+=tmp;
					col[cir[cn]]+=tmp;
					re+=tmp;
					break;
				}
				for(int i=1;i<=cn;i++) inc[cir[i]]=false;
				int k=dfs(1,0);
				e[ek]=false; e[ek^1]=false;
				printf("%d\n",re+s[1]);
			}
			else
			{
				if(num[0]!=num[1]) { printf("-1\n"); continue; }
				int re=0;
				for(int i=1;i<=cn;i++) o[cir[i]]=dfs(cir[i],0),re+=s[cir[i]];
				
				printf("%d\n",re+solve());
			}
		}
	}
	
	return 0;
}


Measured memory_bytes: 9472
// ###### Sat Mar 28 14:19:29 IST 2020
#include <bits/stdc++.h>  
#include <ext/pb_ds/tree_policy.hpp>
#include <ext/pb_ds/assoc_container.hpp>
#define forn(i,a,b)        for( i = a ; i < b  ; i++ )
#define debug(x)           cout << #x << " " << x << " -- \n"
#define I__O               ios::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
#define ll                 long long    
#define MOD                998244353
#define pi                 pair<int,int>
#define vi                 vector <int>
#define pb                 push_back
#define vp                 vector <pair<ll,ll>>
#define endl               cout << "\n"  
#define f1                 first 
#define s1                 second    
#define in                 insert
#define all(x)             (x).begin(),(x).end() 
using namespace std ; 
using namespace __gnu_pbds;
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update> indexed_set ; 
const int N = 2e5+7;
vector <vector <int>> adj(N);
vector <int> dp((N/2),-1);
int best_distance(int n){
  if(dp[n] != -1)
    return dp[n];
  int best = -1 ;
  for(auto &x : adj[n])
    best = max(best,best_distance(x));
  return dp[n] = 1+best;
}
int tests(){ 
  // 3/30/2020 6:49:44 PM
  // We will use codeforces api and download a JSON file
  int n,m;
  cin >> n >> m ; 
  int x,y ; 
  while(m--){
    cin >> x >> y ; 
    adj[x].push_back(y);
  }
  int i ; 
  int ok = 0 ; 
  forn(i,1,n+1)
    if(dp[i] == -1)
      best_distance(i);
  forn(i,1,n+1)
    ok = max(ok,dp[i]);  
  cout << ok << '\n' ;   
  return 0 ;
} 
int32_t main(){
    I__O ;            
    int cases = 1 ; 
    // cin >> cases ;  
    while(cases--){   
    // cout << "Case #" << cases << ": ";
      tests(); 
    }
    return 0 ; 
}

// -Wall -Wextra -O2
// -pedantic -std=c++11
// -D_GLIBCXX_DEBUG -D_GLIBCXX_DEBUG_PEDANTIC

Measured memory_bytes: 10496
#include<bits/stdc++.h>
using namespace std;
bitset<30010>a;
int n,x,y,w[3001];
vector<int> p[3001];
inline void bs(int k,int b){
    a[k]=false;
    for(int v:p[k])
        if(v!=b&&w[v]<w[k]){
            bs(v,k);
            if(a[v]==false){
                a[k]=true;
                break;
            }
        }
}
int main(){
    scanf("%d",&n);
    for(register int i=1;i<=n;i++) scanf("%d",w+i);
    for(register int i=1;i<n;i++) scanf("%d%d",&x,&y),p[x].push_back(y),p[y].push_back(x);
    for(register int i=1;i<=n;i++){
        bs(i,0);
        if(a[i])
        printf("%d ",i);
    }
    puts("");
}

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

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);cout.tie(NULL);

    ll n;
    cin >> n;
    vector<ll> a(n);
    for(ll i = 0; i < n; i++) cin >> a[i];

    unordered_map<ll,ll> mp;

    ll now = 0;
    ll ans = 0;

    mp[0]++;

    for(ll i = 0; i < n; i++){
        now += a[i];
        ans += mp[now];
        mp[now]++;
    }

    cout << ans << endl;

    return 0;
}

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

#define REP(i, n) for(ll i = 0; i < n; i++)
#define ALL(x) (x).begin(),(x).end()
#define MSG(x) cout << x << endl;
#define YN(x) x ? cout << "YES" << endl : cout << "NO" << endl;
#define Yn(x) x ? cout << "Yes" << endl : cout << "No" << endl;
#define yn(x) x ? cout << "yes" << endl : cout << "no" << endl;

using namespace std;
using ll = long long;

int main(int argc, char *argv[]) {
    string s;
    cin >> s;

    ll head = 0;
    ll tail = s.size() - 1;

    while (s.at(head) != 'A') head++;
    while (s.at(tail) != 'Z') tail--;

    MSG(tail - head + 1)

    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <vector>
#define rep(i, n)   for(int i = 0; i < (n); i++)
using namespace std; 
typedef long long ll;

int main(){
    //input
    int n;  cin >> n;
    vector<int>t(n);
    rep(i, n)	cin >> t[i];
    int m;  cin >> m;
    vector<int>p(m);
    vector<int>x(m);
    rep(i, m)	cin >> p[i] >> x[i];
    //solve
    rep(i, m){
	int ans = 0;
	rep(j, n){
	    if(p[i]-1 == j){
		ans += x[i];
	    }else{
		ans += t[j];
	    }
	}
	cout << ans << endl;
    }
}


Measured memory_bytes: 256
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=b-1LL;i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

int main() {
	ll n;
	cin>>n;
	vector<pair<ll,ll> > v;
	rep(i,0,n){
		ll a,b;
		cin>>a>>b;
		v.pb(mp(a,b));
	}
	ll mx = 0;
	rep(i,0,v.sz){
		rep(j,0,v.sz){
			if(i==j)continue;
			ll p = v[i].fi-v[j].fi;
			ll q = v[i].se-v[j].se;
			ll c = 0;
			rep(k,0,v.sz){
				rep(l,0,v.sz){
					if(k==l)continue;
					ll p1 = v[k].fi-v[l].fi;
					ll q1 = v[k].se-v[l].se;
					if(p==p1&&q==q1)c++;
				}
			}
			mx = max(mx,c);
		}
	}
	cout << n-mx << endl;
	return 0;
}

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

using namespace std;

int main(){
 int n;
  cin>>n;
  set<int> st;
  for(int i=0;i<n;i++){
   int x;
    cin>>x;
    st.insert(x);
  }
  if(st.size()==n)
    cout<<"YES\n";
  else
    cout<<"NO\n";
  
}

Measured memory_bytes: 9600
#include<iostream>
using namespace std;
int main(){
  int N,M,sum=0;
  cin >> N;
  M=N;
  while(M>0){
    sum+=M%10;
    M/=10;
  }
  if(N%sum==0){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
}

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


int main() {
    int N,M,C;
    cin>>N>>M>>C;

    int b[M];
    rep(i,M)cin>>b[i];

    vector<vector<int>>a(N,vector<int>(M));
    rep(i,N){
        rep(j,M){
            cin>>a[i][j];
        }
    }

    int ans;
    int cnt =0;

    rep(i,N){
        ans=C;
        rep(j,M){
            ans+=a[i][j]*b[j];
        }
    
        if(ans>0)cnt++;
    }
    cout<<cnt<<endl;
}

Measured memory_bytes: 256
from math import sin, cos, pi
A, B, H, M = map(int, input().split())

theta_h = (H % 12 + M/60)*30*pi/180
theta_m = (M % 60)*6*pi/180

Ax, Ay = A*sin(theta_h), A*cos(theta_h)
Bx, By = B*sin(theta_m), B*cos(theta_m)


d = ((Ax-Bx)**2 + (Ay-By)**2)**0.5
print(d)


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

int main () {

        int n=0,i, a1=0,a2=0 ,ans;
        char s[100000]="", tmp[2]="";

        scanf("%s", s);
        n = strlen(s);

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

                tmp[0] = s[i];

                if(atoi(&tmp[0]) == (i+1)%2)
                {
                        a1++;
                }
                else
                {
                        a2++;
                }
        }

        if( a1 <= a2 )
        {
                ans = a1;
        }
        else
        {
                ans = a2;
        }

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

        return 0;
}

Measured memory_bytes: 256
// Ver19.03
#include <math.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#define INF (1 << 29) * 2
#define LLINF 4545454545454545454
#define MOD 1000000007
#define ll long long
#define ull unsigned long long
#define MAX(a, b) ((a) > (b) ? (a) : (b))
#define MIN(a, b) ((a) < (b) ? (a) : (b))
int upll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? -1 : *(ll *)a > *(ll *)b ? 1 : 0; }
int downll(const void *a, const void *b) { return *(ll *)a < *(ll *)b ? 1 : *(ll *)a > *(ll *)b ? -1 : 0; }
void sortup(ll *a, int n) { qsort(a, n, sizeof(ll), upll); }
void sortdown(ll *a, int n) { qsort(a, n, sizeof(ll), downll); }

int main()
{
  ll n, v[1010];
  double ans;
  scanf("%lld", &n);
  for (int i = 0; i < n; i++)
  {
    scanf("%lld", &v[i]);
  }
  sortup(v, n);
  ans = (double)(v[0] + v[1]) / 2.0;
  for (int i = 2; i < n; i++)
  {
    ans = (ans + (double)v[i]) / 2.0;
  }
  printf("%lf\n", ans);
}

Measured memory_bytes: 128
s = input()
point = 0
count_g = 0
count_p = 0
for enemy_move in s:
  if enemy_move == "g":
    if count_g > count_p:
      point += 1
      count_p += 1
    else:
      count_g += 1
  else:
    if count_g > count_p:
      count_p += 1
    else:
      count_g += 1
      point -= 1
print(point)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define rep(i,n) for(ll (i)=0; (i)<(n); (i)++)
#define rrep(i,n) for(ll i = 1; i <= (n); ++i)
#define pll pair<ll,ll> 
#define Yes cout << "Yes" << endl
#define No cout << "No" << endl
int inf=1000001000;
ll INF=100000000000000000;
ll MOD=1000000007;
//g++ code.cpp   ./a.out 

int main() {
   ll x,y,z;
   cin >> x >> y >> z;
   swap(x,y);
   swap(x,z);
   cout << x<<" " << y<<" " << z<<" " << endl;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int N;
  cin >> N;
  const long int lim = pow(10,9)+7;
  long int output = 1;
  for(int i=1;i<N+1;i++){
    output *= i;
    output %= lim;
  }
  cout << output << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std ; 
#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define fast ios_base:: sync_with_stdio(0);cin.tie(0);cout.tie(0);
#define int long long int
#define endl "\n"
#define pb push_back
#define bs binary_search
#define lb lower_bound
#define ub upper_bound
#define f first
#define s second
#define pii pair<int,int> 
long long M  = 1e9+7;
 
 
signed main(){
    fast;
    int n,m,k; cin >> n >> m >> k;
    char a[n][m];
    for(int i=0 ; i<n ; i++){
    	for(int j=0 ; j<m ; j++){
    		cin >> a[i][j];
    	}
    }

    int curr[n], temp[n];
    int ans = 1e9;
    for(int mask = 0 ; mask<(1<<(n-1)); mask++){
    	int cuts = __builtin_popcount(mask);
    	memset(curr , 0 , sizeof curr);
    	int flag = 1;
    	for(int j=0 ; j<m && flag; j++){
    		int idx = 0;
    		memset(temp , 0 ,sizeof temp);
    		for(int i=0 ; i<n ; i++){
    			temp[idx] += (a[i][j] - '0');
    			if((mask>>i)&1)
    				idx++;
    		}

    		for(int j=0 ; j<n ; j++){
    			if(temp[j] > k){
    				flag = 0;
    				break;
    			}
    		}

    		bool mark = false;
    		for(int j=0 ; j<n ; j++){
    			if(curr[j] + temp[j] > k)
    				mark = true;
    		}
    		cuts += mark;

    		if(mark){
    			for(int j=0 ; j<n ; j++){
    				curr[j] = temp[j];
    			}
    		}
    		else{
    			for(int j=0 ; j<n ; j++){
    				curr[j] += temp[j];
    			}
    		}
    	}
    	if(flag)
    		ans = min(ans, cuts);
    }
    cout << ans << endl;
}


Measured memory_bytes: 384
fun main(array: Array<String>) {
    val a = readLine()!!.toInt()
    val b = readLine()!!.toInt()
    val c = readLine()!!.toInt()
    val x = readLine()!!.toInt()
    var cnt = 0
    for(i in 0 until a+1) {
        for(j in 0 until b+1) {
            for(k in 0 until c+1) {
                if(500*i + 100*j + 50*k == x) cnt++
            }
        }
    }
    print(cnt)
}

Measured memory_bytes: 33816
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <cmath>
#include <map>
#include <vector>
#include <queue>
#include <stack>
#include <set>
#include <algorithm>
#include <sstream>
#include <istream>

using namespace std;

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


int main(){
	int p,q,r;
	cin >> p >> q >> r;

	cout << min(p+q,min(q+r,r+p)) << endl;
	

	return 0;
}

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

void fnInput(vector<int>& rvnSort)
{
  int nMaxSiz;
  cin >> nMaxSiz;
  
  rvnSort.resize(nMaxSiz);
  for (int i = 0; i < nMaxSiz; i++)
    cin >> rvnSort[i];
}

void fnSelectionSort(vector<int>& rvnSort, int& rnSortCnt)
{
  for (int nSorting = 0; nSorting < rvnSort.size() - 1; nSorting++)
  {
    int nMin = nSorting;
    bool bSorting = false;

    for (int j = nSorting + 1; j < rvnSort.size(); j++)
    {
      if (rvnSort[j] < rvnSort[nMin])
      {
        nMin = j;
        bSorting = true;
      }
    }
    if (bSorting)
    {
      swap(rvnSort[nSorting], rvnSort[nMin]);
      rnSortCnt++;
    }
  }
}

void fnOutput(const vector<int>& cnrvnSort, int nSortCnt)
{
  for (int i = 0; i < cnrvnSort.size(); i++)
  {
    if (i) cout << " ";
    cout << cnrvnSort[i];
  }
  cout << endl;
  cout << nSortCnt << endl;
}

int main()
{ 
  cin.tie(0);
  ios::sync_with_stdio(false);
  
  int nSortCnt = 0;
  vector<int> vnSort;

  fnInput(vnSort);
  fnSelectionSort(vnSort, nSortCnt);
  fnOutput(vnSort, nSortCnt);

  return 0;
}

Measured memory_bytes: 3192