akhauriyash/Code-Regression huggingface dataset:
// https://atcoder.jp/contests/abc079/tasks/abc079_c
#include <bits/stdc++.h>
using namespace std;

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

int main() {
  vector<char> c(4);
  rep(i, 4) cin >> c.at(i);

  rep(bit, 1 << 3) {
    int ans = c.at(0) - '0';
    vector<char> op(4);
    op.at(3) = '=';
    rep(i, 3) {
      if (bit & (1 << i)) {
        ans += c.at(i + 1) - '0';
        op.at(i) = '+';
      } else {
        ans -= c.at(i + 1) - '0';
        op.at(i) = '-';
      }
    }
    if (ans == 7) {
      rep(i, 4) cout << c.at(i) << op.at(i);
      cout << '7' << endl;
      return 0;
    }
  }

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<math.h>
#include<string.h>
#include<stdlib.h>
#include<limits.h>
#define MOD 1000000007
#define PI 3.14159265
#define seive_len 1000001
#define p_seive_len 1000001

typedef long long int lli;

int *array;
int seive[seive_len];
int pseive[p_seive_len];

long long int min(long long int a, long long int b) {
    return a<b?a:b;
}

long long int max(long long int a, long long int b) {
    return a>b?a:b;
}

int compare(const void* a, const void* b) {
    return *(int*)a-*(int*)b;
}

int cmp(const void *a, const void *b){
    int ia = *(int *)a;
    int ib = *(int *)b;
    return array[ia] < array[ib] ? -1 : array[ia] > array[ib];
}

long double abs1(long double n) {
    if(n < 0)
        return n*(-1.0);
    return n*1.0;
}

void swap(int *a, int *b) {
    *a = (*a)^(*b);
    *b = (*a)^(*b);
    *a = (*a)^(*b);
}

lli binSearch(lli a[], lli x, lli l, lli r) {
    if(r >= l) {
        lli mid = l + ((r-l)>>1);
        if(a[mid] == x)
            return mid;
        if(a[mid] > x) {
            return binSearch(a, x, l, mid-1);
        }
        else if(a[mid] < x) {
            return binSearch(a, x, mid+1, r);
        }
    }
    return -1;
}

void Primesieve()  { 
    lli i, j;
    pseive[1] = 1;
    printf("bhjnm");
    for(i=0;i<p_seive_len;i++)
        pseive[i] = i;
    for(i=4;i<p_seive_len;i+=2) 
        pseive[i] = 2;
    for(i=3;i*i<p_seive_len;i++) {
        if(pseive[i] == i) {
            for(j=i*i;j<p_seive_len;j+=i) {
                if(pseive[j] == j)
                    pseive[j] = i;
            }
        }
    }
} 

void makeSeive() {
    int i;
	seive[1] = 1;
    for(i=2;i<seive_len;i++) {
        if(seive[i] == 0) {
            long long int temp=(long long int)i*i;
            while(temp <= seive_len-1) {
                seive[temp] = 1;
                temp += i;
            }
        }
    }
}

int isPerfectSquare(lli n) {
    lli x = sqrt(n);
    if(x*x == n)
        return 1;
    return 0;
}

int isPrime(int n) {
    int i;
    for(i=2;i*i<=n;i++)  {
        if(n%i == 0)
            return 0;
    }
    return 1;
}

void getInput(lli a[], lli n) {
    for(lli i=0;i<n;i++)
        scanf("%lld", &a[i]);
}

void testCase() {
    lli i, sum=0;
    char s[200005];
    scanf("%s", s);
    for(i=0;i<strlen(s);i++) {
        sum += (s[i]-'0');
    }
    if(sum%9 == 0)
        printf("Yes");
    else
    {
        printf("No");
    }
    
}

int main() {
    int t=1;
    // scanf("%d", &t);
    // makeSeive();
    // Primesieve();
    while(t--) {
        testCase();
        printf("\n");
    }
    return 0;
}


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

int main() {
  int n, m;

  cin >> n;
  vector<string> u(n);
  for(int i = 0; i < n; i++) cin >> u[i];

  cin >> m;
  int cnt = 0;
  for(int i = 0; i < m; i++) {
    string t;
    cin >> t;
    bool b = true;
    for(int j = 0; j < n; j++) {
      if(u[j] == t) {
	if(cnt % 2 == 0) {
	  cout << "Opened by " << t << endl;
	  cnt++;
	  b = false;
	} else {
	  cout << "Closed by " << t << endl;
	  cnt++;
	  b = false;
	}
	if(!b) break;
      }
    }
    if(b) cout << "Unknown " << t << endl;
  }
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define rep(i,n) FOR(i,0,n)
#define repr(i,n) for(int i=(n)-1;0<=i;--i)
#define each(e,v) for(auto&& e:(v))
#define all(v) begin(v),end(v)
#define dump(x) cerr<<#x<<": "<<(x)<<endl
using namespace std;
using vint = vector<int>;
using ll = long long;
using vll = vector<ll>;
template <class T> void chmin(T& a, const T& b) { a = min(a, b); }
template <class T> void chmax(T& a, const T& b) { a = max(a, b); }
void yes() { cout << "Yes" << endl; exit(0); }
void no() { cout << "No" << endl; exit(0); }

int main() {
    int n, h, w; cin >> n >> h >> w;
    cout << (n - h + 1) * (n - w + 1) << endl;
    return 0;
}


Measured memory_bytes: 256
/*Function Template*/
#include<bits/stdc++.h>
using namespace std;
typedef long long int ll;
typedef pair<ll,ll> pint;
const int MAX = 510000;
const int MOD = 1000000007;
#define rep(i, n) for(ll i = 0; i < (n); i++)
#define Rep(i, n) for(ll i = 1; i < (n); i++)
#define ALL(a)  (a).begin(),(a).end()
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
ll fac[MAX], finv[MAX], inv[MAX];


template<class T> inline bool chmin(T& a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}
template<class T> inline bool chmax(T& a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }

}
ll Len(ll n) {
  ll s=0;
  while(n!=0) s++, n/=10;
  return s;
}


ll Sint(ll n) {
  ll m=0,s=0,a=n;
  while(a!=0) s++, a/=10;
  for(ll i=s-1;i>=0;i--) m+=n/((ll)pow(10,i))-(n/((ll)pow(10,i+1)))*10;
  return m;
}


ll Svec(vector<ll> v){
  ll n=0;
  for(ll i=0;i<v.size();i++) n+=v[i];
  return n;
}


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


ll Factorial(ll n){
  ll m=1;
  while(n>=1) m*=n,n--;
  return m;
}

void runlength(string s,vector<pair<char,ll>> &p){
  ll x=1;
  if(s.size()==1){
    p.push_back(pair<char,ll>(s[0],1));
  }
  for(ll i=0;i<s.size()-1;i++){
    if(s[i]==s[i+1]){
      x++;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[i],x));
      }
    }else{
      p.push_back(pair<char,ll>(s[i],x));
      x=1;
      if(i==s.size()-2){
        p.push_back(pair<char,ll>(s[s.size()-1],x));
      }
    }
  }
}




ll COM(ll n,ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

const int MAX_N=100010;
vector<bool> sieve_of_eratosthenes(){
  vector<bool> isPrime(MAX_N+1,true);
  for(int i=2;i<=MAX_N;i++){
    if(isPrime[i]){
      for(int j=2*i;j<=MAX_N;j+=i){
        isPrime[j]=false;
      }
    }
  }
  return isPrime;
}

vector<pint> prime_factorize(ll n){
  vector<pint> ans;
  for(ll p=2;p<=sqrt(n);p++){
    if(n%p!=0) continue;
    ll cnt=0;
    while(n%p==0){
      n/=p;
      cnt++;
    }
    ans.push_back(make_pair(p,cnt));
  }
  if(n!=1) ans.push_back(make_pair(n,1));
  return ans;
}

/*↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓*/
int main() {
  IOS;
  ll h,w;
  cin>>h>>w;
  if(h%3==0 || w%3==0){
    cout<<0<<endl;
    return 0;
  }
  ll ans=1e17;
  Rep(i,h){
    vector<ll> tmp;
    tmp.push_back(i*w);
    tmp.push_back((w/2)*(h-i));
    tmp.push_back(((w+1)/2)*(h-i));
    sort(ALL(tmp));
    ans=min(ans,tmp[2]-tmp[0]);
  }
  Rep(i,w){
    vector<ll> tmp;
    tmp.push_back(i*h);
    tmp.push_back((h/2)*(w-i));
    tmp.push_back(((h+1)/2)*(w-i));
    sort(ALL(tmp));
    ans=min(ans,tmp[2]-tmp[0]);
  }
  chmin(ans,w);
  chmin(ans,h);
  cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ull uint64_t
#define ll long long int
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define mx5 100005
#define mx6 1000005
#define nfs ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
using namespace std;

int main() {
    nfs
    int i, v, n, dp[mx5] = {}, h[mx5] = {};
    cin >> n;
    cin >> h[0] >> h[1];
    dp[0] = 0;
    dp[1] = abs(h[1] - h[0]);
    for (i = 2; i < n; i++) {
        cin >> h[i];
        dp[i] = min (dp[i-1] + abs(h[i] - h[i-1]), dp[i-2] + abs(h[i] - h[i-2]));
    }
    cout << dp[n-1];
}

Measured memory_bytes: 4400
//http://drken1215.hatenablog.com/entry/2019/06/15/142900
//参考にさせて頂いた解説

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;

const ll LongINF=1e13+7;
const int INF=1e9+7;
const int dx[]={0,1,0,-1};
const int dy[]={1,0,-1,0};

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template <class T, class Y>T GCD(T a, Y b){if(a<b){int c=a;a=b;b=c;}if (a % b == 0){return b;}return GCD(b, a % b);}
void clear(queue<pair<int, int>> &q){queue<pair<int, int>> empty;swap(q, empty);} //queueの中身の型は適時変更を忘れない

#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back

int main(){
    int N,K;
    cin>>N>>K;
    vector<ll> V(N);

    for(int i=0;i<N;i++){
        cin>>V[i];
    }
    ll res=0;

    for(int p=0;p<=min(K,N);p++){
        for(int q=0;q+p<=min(K,N);q++){
            //forを二重に回すことで、右と左からの取り出し全探索ができる。総和をmin(K,N)にすることでmin(N,K)-a=bとなるのでも一方の全探索の回す回数がわかる
            vector<ll> v;
            ll cur=0;
            for(int i=0;i<p;i++)v.pb(V[i]),cur+=V[i];//p,qの回数分操作を行う
            for(int i=0;i<q;i++)v.pb(V[N-1-i]),cur+=V[N-1-i];

            sort(v.begin(),v.end());
            for(int i=0;i<min(K-p-q,(int)v.size());i++){//p,qの余った回数分捨てる
                if(v[i]<0)cur-=v[i];
            }
            res=max(res,cur);
        }
    }

    cout<<res<<endl;

    return 0;
}

//a=97,z=122

Measured memory_bytes: 256
using System;
using System.Numerics;

namespace ABC059B
{
    static class Program
    {
        static void Main()
        {
            var a = BigInteger.Parse(Console.ReadLine());
            var b = BigInteger.Parse(Console.ReadLine());
            string output;

            if (a > b)
                output = "GREATER";
            else if (b > a)
                output = "LESS";
            else
                output = "EQUAL";

            Console.WriteLine(output);
        }
    }
}

Measured memory_bytes: 13524
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define pii  pair<int,int>
#define vpii vector<pii>
#define vll  vector<ll>
#define vi  vector<int>
#define pb push_back
#define f  first
#define s  second

int main() {

   int x,t;
      cin>>x>>t;
      
      if((x-t)<=0)
         cout<<"0";
      else
         cout<<x-t;
    
    

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
class P
{
    static void Main()
    {
        long l = long.Parse(Console.ReadLine());
        //if (l <= 60)
        //{
        //    for (int i = 0; i < l; i++)
        //        Console.WriteLine("{0} {1} {2}", 1, 2, i);
        //    return;
        //}
        List<long> ls = new List<long>();
        while (l > 0)
        {
            ls.Add(M(l));
            l -= (long)Math.Pow(2, M(l));
        }
        //foreach (var i in ls)
        //    Console.WriteLine(i);
        int n = (int)ls[0] + 1;
        List<string> answer = new List<string>();
        long m = 0;
        for (int i = 1; i < n; i++)
        {
            answer.Add(String.Format("{0} {1} {2}", i, i + 1, 0));
            answer.Add(String.Format("{0} {1} {2}", i, i + 1, (long)Math.Pow(2, i - 1)));
            m += 2;
        }
        for (int i = 1; ; i++)
        {
            try
            {
                long d = 0;
                for (int k = 0; k < i; k++)
                    d += (long)Math.Pow(2, ls[k]);
                string ans = String.Format("{0} {1} {2}", ls[i] + 1, n, d);
                answer.Add(ans);
                m++;
            }
            catch
            {
                break;
            }
        }
        Console.WriteLine("{0} {1}", n, m);
        foreach (var s in answer)
            Console.WriteLine(s);
        return;
    }
    static long M(long l)
    {
        long c = 0;
        while ((long)Math.Pow(2, c) <= l)
        {
            c++;
        }
        return c - 1;
    }
}

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

int main(){
    int64_t n, a, b;
    cin >> n >> a >> b;

    int64_t ans = 0;
    
    int64_t times = (int64_t)n/(a+b);
    ans += (times * a);

    ans += (min(a, n%(a+b)));

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

Measured memory_bytes: 256
N=int(input())
C=[0]*(N-1)
S=[0]*(N-1)
F=[0]*(N-1)
for i in range(N-1):
  C[i],S[i],F[i]=map(int,input().split())
  
for i in range(N):
  j=i
  t=0
  while j<N-1:
    if t<=S[j]:
      t=S[j]
    else:
      tmp= t-S[j]
      s=tmp%F[j]
      if s!=0:
        t += F[j]-s
    #print(i,j,t)
    t += C[j]
    j +=1
  print(t)
    

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

using namespace std;

#define ll long long

ll M = 1000000007;

ll bin_pow(ll a, ll pow) {
    if (pow == 0) return 1;
    if (pow == 1) return a;
    if (pow % 2 == 0) {
        ll tmp = bin_pow(a, pow / 2) % M;
        return tmp * tmp % M;
    }
    return a * bin_pow(a, pow - 1) % M;
}

ll inv(ll a) {
    return bin_pow(a, M - 2) % M;
}

ll fact(ll a) {
    ll ans = 1;
    for (int i = 1; i <= a; i++) {
        ans *= i;
        ans %= M;
    }
    return ans;
}

vector<vector<int>> d;
vector<pair<int, int>> a;

int ans(int n, int t) {
    if (t <= 0 || n == 0) return 0;
    if (d[n][t] == -1) {
        d[n][t] = max(ans(n - 1, t), ans(n - 1, t - a[n - 1].first) + a[n - 1].second);
    }

    return d[n][t];
}

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

    vector<vector<int>> a(3, vector<int>(3));

    for (int i = 0; i < 3; i++) for (int j = 0; j < 3; j++) cin >> a[i][j];

    int n;
    cin >> n;

    vector<vector<pair<int, int>>> bingos = {
            {{0, 0}, {0, 1}, {0, 2}},
            {{1, 0}, {1, 1}, {1, 2}},
            {{2, 0}, {2, 1}, {2, 2}},
            {{0, 0}, {1, 0}, {2, 0}},
            {{0, 1}, {1, 1}, {2, 1}},
            {{0, 2}, {1, 2}, {2, 2}},
            {{0, 0}, {1, 1}, {2, 2}},
            {{0, 2}, {1, 1}, {2, 0}}
    };

    set<pair<int, int>> f;

    for (int i = 0; i < n; i++) {
        int x;
        cin >> x;

        for (int k = 0; k < 3; k++) {
            for (int j = 0; j < 3; j++) {
                if (a[k][j] == x) {
                    f.insert({k, j});
                }
            }
        }
    }

    for (auto b : bingos) {
        bool got = true;
        for (auto bb : b) {
            if (f.count(bb) == 0) {
                got = false;
            }
        }

        if (got) {
            cout << "Yes";
            return 0;
        }
    }


    cout << "No";


    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define forr(x,n) for(int x = 0; x < n; ++x)
#define pr pair<int,int>
#define ll long long int
const int mod=1e9+7;
int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    int a,b,x,y,ans=-1;
    cin>>a>>b;
    for(int i=1;i<=100000;i++)
    {
    	x=i*0.08;
    	y=i*0.10;
    	if(x==a&&y==b)
    	{
    		ans=i;
    		break;
		}
	}
	cout<<ans;
}




Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;using ll=long long;using vi=vector<int>;using vvi=vector<vi>;using vl=vector<ll>;using P=pair<int,int>;using PL=pair<ll,ll>;using vp=vector<P>;using vpl=vector<PL>;
constexpr const int INF=1<<30,MOD=1000000007;constexpr const ll LINF=1ll<<60;
#define _ol3(_1,_2,_3,name,...)name
#define _rep(i,n)_repi(i,0,n)
#define _repi(i,a,b)for(int i=a,i##_l=(b);i<i##_l;++i)
#define REP(...)_ol3(__VA_ARGS__,_repi,_rep,)(__VA_ARGS__)
#define REPR(i,n)for(int i=n-1;i>=0;--i)
#define REPA(i,v)REP(i,v.size())
#define all(v)(v).begin(),(v).end()
#define bit(n)(1ll<<(n))
#define uniq(v)sort(all(v));v.erase(unique(all(v)),v.end())
#define F first
#define S second
#define endl '\n'
#define cho(n,a,b)cout<<((n)?a:b)<<endl
void YES(int n){cho(n,"YES","NO");}void Yes(int n){cho(n,"Yes","No");}void Poss(int n){cho(n,"Possible","Impossible");}
#ifndef LOCAL
struct osd{template<class T>osd&operator<<(const T&t){return*this;}};osd cer_;
#define cerr cer_
#endif
template<class T>ostream&operator<(ostream&o,const T&t){return o<<t;}template<class T>istream&operator>(istream&i,T&t){return i>>t;}
void _print(ostream&s){}template<class T,class...U>void _print(ostream&s,T&&t,U&&...u){s<t<(sizeof...(u)?' ':'\n');_print(s,u...);}
template<class...T>void print(T&&...t){_print(cout,t...);}template<class...T>void dprint(T&&...t){_print(cerr,t...);}
template<class T>void chmax(T&a,const T&b){if(a<b)a=b;}template<class T>void chmin(T&a,const T&b){if(a>b)a=b;}
template<class T>ostream&operator<<(ostream&o,const vector<T>&v){for(auto&&i:v)o<i<' ';return o;}
template<class T>istream&operator>>(istream&i,vector<T>&v){for(T&j:v)i>j;return i;}
template<class T,class U>ostream&operator<<(ostream&o,const pair<T,U>&p){return o<p.F<' '<p.S;}
template<class T,class U>istream&operator>>(istream&i,pair<T,U>&p){return i>p.F>p.S;}
template<class T>ostream&operator<<(ostream&o,const set<T>&v){for(auto&&i:v)o<i<' ';return o;}
template<class T>vector<T>&operator<<(vector<T>&v,const T&t){v.push_back(t);return v;}
template<class T>queue<T>&operator<<(queue<T>&q,const T&t){q.push(t);return q;}template<class T>queue<T>&operator<<(T&t,queue<T>&q){t=q.front();q.pop();return q;}
template<class T>deque<T>&operator>>(const T&t,deque<T>&q){q.push_front(t);return q;}template<class T>deque<T>&operator<<(T&t,deque<T>&q){t=q.front();q.pop_front();return q;}
template<class T>deque<T>&operator<<(deque<T>&q,const T&t){q.push_back(t);return q;}template<class T>deque<T>&operator>>(deque<T>&q,T&t){t=q.back(t);q.pop_back();return q;}
template<class T>stack<T>&operator<<(stack<T>&s,const T&t){s.push(t);return s;}template<class T>stack<T>&operator>>(stack<T>&s,T&t){t=s.top();s.pop();return s;}

int main(){
    cin.tie(0);ios::sync_with_stdio(0);
    int a,p;
    cin>a>p;
    cout<(a*3+p)/2<endl;
    return 0;
}


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

int main() {
  map<string,int> mp1;
  map<string,int> mp2;
  int n,m;cin>>n;
  rep(i,n) {
    string s;cin>>s;
    if(mp1.find(s)!=mp1.end()) mp1[s]++;
    else mp1[s]=1;
  }
  cin>>m;
  rep(i,m) {
    string s;cin>>s;
    if(mp2.find(s)!=mp2.end()) mp2[s]++;
    else mp2[s]=1;
  }
  int ans=0;
  for(auto itr : mp1) {
    if(mp2.find(itr.first)!=mp2.end()) {
      ans=max(ans,mp1[itr.first]-mp2[itr.first]);
    } else {
      ans=max(ans,mp1[itr.first]);
    }
  }
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 256
/*
    問題をよく読もう！
    論理的に考えよう！
    サンプルを確認しよう!
    絶対に諦めるな！
    工夫をしろ！

    Twitterは終わるまでログアウト！
    （間違えて解法をツイートしてはいけないから）

*/
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cctype>
using namespace std;
#define rep(i, n) for(int i=0; i<n; ++i)
typedef long long ll;
//必要な宣言

int main() {
  int AB, BC, CA;
  cin >> AB >> BC >> CA;

  cout << AB*BC/2 << endl;

  return 0;
}


Measured memory_bytes: 256
// JOI11-quest1.cpp : Defines the entry point for the console application.
//
#define _CRT_SECURE_NO_WARNINGS
#include <stdio.h>


int main(void)
{
	int pasta = 2000, juice = 2000, temp;
	for (int i = 0; i < 3; i++) {
		scanf("%d", &temp);

		if (pasta > temp) {
			pasta = temp;
		}
	}

	for (int i = 0; i < 2; i++) {
		scanf("%d", &temp);

		if (juice > temp) {
			juice = temp;
		}
	}

	printf("%d\n", pasta + juice - 50);

	return 0;
}

Measured memory_bytes: 1020
#include<bits/stdc++.h>
using namespace std;
int main(){
	char c1[5],c2[5];
	scanf("%s%s",c1,c2);
	int cnt=0;
	for(int i=0;i<3;++i)if(c1[i]==c2[i]) cnt++;
	cout<<cnt;
	return 0;
}


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

using namespace std;

/**/
void __print(int x) {cerr << x;}
void __print(long x) {cerr << x;}
void __print(long long x) {cerr << x;}
void __print(unsigned x) {cerr << x;}
void __print(unsigned long x) {cerr << x;}
void __print(unsigned long long x) {cerr << x;}
void __print(float x) {cerr << x;}
void __print(double x) {cerr << x;}
void __print(long double x) {cerr << x;}
void __print(char x) {cerr << '\'' << x << '\'';}
void __print(const char *x) {cerr << '\"' << x << '\"';}
void __print(const string &x) {cerr << '\"' << x << '\"';}
void __print(bool x) {cerr << (x ? "true" : "false");}

template<typename T, typename V>
void __print(const pair<T, V> &x) {cerr << '{'; __print(x.first); cerr << ','; __print(x.second); cerr << '}';}
template<typename T>
void __print(const T &x) {int f = 0; cerr << '{'; for (auto &i: x) cerr << (f++ ? "," : ""), __print(i); cerr << "}";}
void _print() {cerr << "]\n";}
template <typename T, typename... V>
void _print(T t, V... v) {__print(t); if (sizeof...(v)) cerr << ", "; _print(v...);}
#ifndef ONLINE_JUDGE
#define wt(x...) cerr << "[" << #x << "] = ["; _print(x)
#else
#define wt(x...)
#endif
/**/

#define LL long long
const int MAXN = 212345;
const int INF  = 0x3f3f3f3f;

int h[MAXN];

LL dp[MAXN];

int main () {

	ios_base::sync_with_stdio(false);  cin.tie(NULL); 

	memset (dp, INF, sizeof dp);

	int n;
	cin >> n;

	for (int i  = 0; i < n; ++i) 
		cin >> h[i];

	LL cost = 0;

	dp[0] = 0;

	for (int i = 1; i < n; ++i) {
		dp[i] = dp[i-1] + abs (h[i-1] - h[i]);
		if (i - 2 >= 0) dp[i] = min(dp[i], dp[i-2] + abs (h[i-2]- h[i]));
	}

	cout << dp[n-1] << '\n';


	return 0;
}



Measured memory_bytes: 2304
#include <iostream>
#include <cstdio>
#include <algorithm>
#include <queue>
#define inf (1e12) 
using namespace std;
typedef long long ll;
const int maxN = 5 * 1e4 + 1000; 
int cur[maxN], l[maxN], layer[maxN], e, S, T, N, val[maxN];
struct edge{
	int u, v, fa; ll cap;
}G[maxN << 1];
void add_(int u, int v, ll val) {
	//if(val == 0) return;
	G[e].u = u; G[e].v = v; G[e].cap = val; G[e].fa = l[u]; l[u] = e++;
	G[e].u = v; G[e].v = u; G[e].cap = 0; G[e].fa = l[v]; l[v] = e++; 
}
bool BFS() {
	for(int i = 0; i <= T; ++i) layer[i] = -1, cur[i] = l[i];
	queue<int> q; q.push(S); layer[S] = 0;
	while(!q.empty()) {
		int u = q.front(); q.pop();
		for(int i = l[u]; i != -1; i = G[i].fa) {
			int v = G[i].v;
			if(layer[v] > -1 || G[i].cap == 0) continue;
			layer[v] = layer[u] + 1;
			q.push(v);
		}
	}
	return layer[T] > -1;
}
ll dfs(int u, ll flow) {
	if(u == T) return flow;
	ll ret = 0;
	for(int& i = cur[u]; i != -1; i = G[i].fa) {
		int v = G[i].v;
		if(layer[v] == layer[u] + 1 && G[i].cap > 0) {
			ll tmp = dfs(v, min(flow, G[i].cap));
			ret += tmp; flow -= tmp;
			G[i ^ 1].cap += tmp; G[i].cap -= tmp;
			if(flow == 0) return ret; 	
		}
	}
	return ret;
}
int main() {
	scanf("%d", &N);
	for(int i = 1; i <= N; ++i) scanf("%d", &val[i]);
	S = 0; T = N + 1;
	for(int i = 0; i <= T; ++i) l[i] = -1;
	for(int i = 1; i <= N; ++i) {
		for(int j = i * 2; j <= N; j += i) 
		add_(j, i, inf);
	}
	ll ans = 0;
	for(int i = 1; i <= N; ++i) {
		if(val[i] > 0) ans += val[i], add_(S, i, val[i]);
		else add_(i, T, -val[i]);
	}
	//cout << ans << endl;
	while(BFS()) ans -= dfs(S, inf);
	printf("%lld\n", ans);
	return 0;
}

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

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


int main() {
  string s;
  cin >> s;
  if (s == "SUN") {
    cout << 7 << endl;
  }
  if (s == "MON") {
    cout << 6 << endl;
  }
  if (s == "TUE") {
    cout << 5 << endl;
  }
  if (s == "WED") {
    cout << 4 << endl;
  }
  if (s == "THU") {
    cout << 3 << endl;
  }
  if (s == "FRI") {
    cout << 2 << endl;
  }
  if (s == "SAT") {
    cout << 1 << endl;
  }
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (n); i++)
using ll = long long;
using P = pair<int,int>;
const long long inf = 1000000001; // const 書き換え禁止
const double PI = 3.14159265358979323846; //M_PI はライブラリ

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

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

int main() {
	string x; cin >> x;
	int n = x.size();
	deque<char> deq;
	REP(i, n) {
		if (x[i] == 'S') {
			deq.push_back('S');
		} else if (x[i] == 'T') {
			if (deq.empty()) {
				deq.push_back('T');
			} else if (deq.back() == 'S') {
				deq.pop_back();
			} else if (deq.back() == 'T') {
				deq.push_back('T');
			}
		}
	}
	cout << deq.size() << '\n';
    return 0;
}


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

int main()
{
    string s;
    cin >> s;
    for (int i = 1; i <= 4; i++) {
        if (s[i] == s[i-1]) {
            cout << "Bad" << endl;
            return 0;
        }
    }
    cout << "Good" << endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define REP(i,n) for(int i=0; i<(n); i++)
int main()
{
    int n, d;
    double x, y;
    int count = 0;
    cin >> n >> d;
    REP(i,n){
      cin >> x >> y;
      if(sqrt(x*x + y*y) <= double(d)){
        count++;
      }
    }
    cout << count << endl;
    return 0;
}

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

int main(){
int r,c;
int a[500][500];
int Ans[600][600];
memset(Ans,0,sizeof(Ans));
cin>>r>>c;
for(int i=1;i<=r;i++){
for(int j=1;j<=c;j++){
cin>>a[i][j];
Ans[i][j]=a[i][j];
}
}
for(int i=1;i<=r;i++){
for(int j=1;j<=c;j++){
Ans[r+1][j] += a[i][j];
Ans[i][c+1] += a[i][j];
Ans[r+1][c+1] += a[i][j];
}
}
for(int i=1;i<=r+1;i++){
for(int j=1;j<=c+1;j++){
if(j>c){
cout<<Ans[i][j]<<endl;
}
else{
cout<<Ans[i][j]<<' ';
}
}
}
return 0;
}

Measured memory_bytes: 2776
import bisect, collections, copy, heapq, itertools, math, numpy, string
import sys
from bisect import bisect_left, bisect_right, insort
from collections import deque
def S(): return sys.stdin.readline().rstrip()
def I(): return int(sys.stdin.readline().rstrip())
def MI(): return map(int, sys.stdin.readline().rstrip().split())
def MS(): return map(str, sys.stdin.readline().rstrip().split())
def LI(): return list(map(int, sys.stdin.readline().rstrip().split()))
def LS(): return list(sys.stdin.readline().rstrip().split())
# N = I()
# A = [LI() for _ in range(N)]

import bisect


x,n =MI()
p =LI()
j = 0
while x+j in p and x-j in p:
    j += 1

if not(x+j in p) and not(x-j in p):
    print(x-j)
elif x+j in p:
    print(x-j)
else:
    print(x+j)


Measured memory_bytes: 27236
use std::str::FromStr;
struct Input {
    line: Vec<String>,
    position: usize
}
impl Input {
    fn new() -> Input {
        Input{line:vec![], position: 0}
    }
    fn read_word(&mut self) -> &String {
        if self.position == self.line.len() {
            let mut line= String::new();
            std::io::stdin().read_line(&mut line).ok();
            self.line = line.split_whitespace().map(|x|x.to_string()).collect();
            self.position = 0
        }
        let result = &self.line[self.position];
        self.position += 1;
        result
    }
    fn read<T: FromStr>(&mut self, result: &mut T) -> &mut Input {
        *result = self.read_word().parse().ok().unwrap();
        self
    }
    fn get<T: FromStr>(&mut self) -> Result<T, T::Err> {
        self.read_word().parse()
    }
}
fn main() {
    let mut input = Input::new();
    let s: i32 = input.get().unwrap();
    println!("{}:{}:{}", s / 3600, (s / 60) % 60, s % 60);
}



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

int dp[4001][4001];
char s[4001],t[4001];

int main(){
	while(scanf("%s%s",s,t) == 2){
		int ans = 0;
		int slen = strlen(s);
		int tlen = strlen(t);
		for(int i = 0; i < slen; i++){
			if(s[i] == t[0]){
				dp[0][i] = 1;
				ans = 1;
			}
			else{
				dp[0][i] = 0;
			}
		}
		for(int i = 0; i < tlen; i++){
			if(t[i] == s[0]){
				dp[i][0] = 1;
				ans = 1;
			}
			else{
				dp[i][0] = 0;
			}
		}

		for(int i = 1; i < tlen; i++){
			for(int j = 1; j < slen; j++){
				if(t[i] == s[j]){
					dp[i][j] = dp[i-1][j-1] + 1;
					ans = max(ans,dp[i][j]);
				}
				else{
					dp[i][j] = 0;
				}
			}
		}
		printf("%d\n",ans);
	}
	return 0;
}



Measured memory_bytes: 65680
N = int(input())
s = {}
for x in map(int, input().split()):
    n = s.get(x, 0) + 1
    s[x] = n
ret = 0
for k, v in s.items():
    if k < v:
        ret += v - k
    elif k > v:
        ret += v
print(ret)

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

#define rep(i,n) for(int i=0;i<n;i++)
#define REP(i,s,n) for(long long i=s;i<n;i++)
#define all(a) (a).begin(),(a).end()

typedef long long ll;
typedef long double ld;
typedef vector<ll> vll;
typedef vector<vll> vvll;
const double pi = acos(-1.0);
const ll mod = pow(10,9) + 7;
const ll INF = pow(2,31) - 1;

ll gcd(ll x,ll y)
{
    ll r;
    while((r = x % y) != 0)
    {
        x = y;
        y = r;
    }
    return y;
}

ll lcm(ll x,ll y)
{
    x /= gcd(x,y);
    y /= gcd(x,y);
    return (x*y);
}

int main()
{
    int a,b;cin >> a >> b;

    if(a < b)rep(i,b)cout << a;
    else if(b <= a)rep(i,a)cout << b;
    cout << endl;

    return 0;
}

Measured memory_bytes: 256
//AUTHOR - NIMISH UPADHYAY
//FROM IIIT ALLAHABAD
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define UPADHYAY int t;cin>>t;while(t--)
#define pb push_back
#define NIMISH ios_base::sync_with_stdio(false);cin.tie(NULL);
const ll N=102,W=1e5+1; ll c[N],v[N],dp[N][W],n,i,j,w;
ll fun(ll i,ll j){
    if(i>=n||w<=0) return 0;
    if(dp[i][j]!=-1) return dp[i][j];
    if(j>=c[i]) return dp[i][j]=max(v[i]+fun(i+1,j-c[i]),fun(i+1,j));
    return dp[i][j]= fun(i+1,j);
}
int main(){
    NIMISH
    cin>>n>>w;
    for(i=0;i<n;i++){
        cin>>c[i]>>v[i];
    }
    memset(dp,-1,sizeof(dp));
    cout<<fun(0,w);
}

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

int main()
{
    std::string s,t;
    std::cin >> s >> t;
    std::sort(s.begin(), s.end());
    std::sort(t.begin(), t.end(), std::greater<char>());
    bool res = s < t;
    std::cout << (res ? "Yes" : "No") << std::endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <string>
#include <vector>
#include <list>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <bitset>
#include <numeric>
#include <climits>
#include <cfloat>
using namespace std;

int main()
{
    int w, n;
    cin >> w >> n;
    vector<int> num(w);
    for(int i=0; i<w; ++i)
        num[i] = i+1;

    for(int i=0; i<n; ++i){
        int a, b;
        char c;
        cin >> a >> c >> b;
        swap(num[a-1], num[b-1]);
    }

    for(int i=0; i<w; ++i)
        cout << num[i] << endl;

    return 0;
}

Measured memory_bytes: 0
#include <iostream>
#include <cstdio>

using namespace std;

typedef long long ll;

ll n;

int main()
{
    cin>>n;
    for(ll i = 0; i <= 1000; i++)
    {
        for(ll j = 0; j <= 1000; j++)
        {
            if(i * i * i * i * i - j * j * j * j * j == n)
            {
                printf("%lld %lld\n", i, j);
                return 0;
            }
            if(i * i * i * i * i + j * j * j * j * j == n)
            {
                printf("%lld %lld\n", i, -j);
                return 0;
            }
        }
    }
    return 0;
}


Measured memory_bytes: 3760
#include <iostream>
#include <cstring>
#include <cassert>
#include <vector>
#include <utility>
#include <algorithm>
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <ctime>
#include <climits>
#include <cassert>
#include <ctime>
#include <bitset>
#include <complex>
using namespace std;

bool is_pal(int x) {
  string s=to_string(x);
  bool ok=true;
  for (int i = 0; i < s.length(); ++i) {
    if (s[i] != s[s.length()-i-1]) {
      ok=false;
    }
  }
  return ok;
}

int main() {
  
  int a, b;
  cin >> a >> b;
  
  int nr=0;
  for (int i = a; i <= b; ++i) {
    if (is_pal(i))nr++;
  }
  
  cout << nr << endl;

  return 0;
}


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

using namespace std;

int main() {
    vector<int> h(6);
    int k;
    int flag = 0;

    int tmp = 0;
    int i = 0;
    while(cin >> tmp) {
        h[i] = tmp;
        i ++;
        if(i >= 6) {
            break;
        }
    }

    k = h[5];

    for(int i = 0; i < 5; i++) {
        for(int j = i+1; j < 5; j++) {
            if( (h[j] - h[i]) > k ) {
                flag = 1;
            }
        }
    }

    if(flag == 1) {
        cout << ":(" << endl;
    } else {
        cout << "Yay!" << endl;
    }


}


Measured memory_bytes: 256
// AOJ 1328 Find the Outlier
// 2018.2.9 bal4u

#include <stdio.h>

int n;
double v[10];

double calc(int x, int k)
{
	int i, j;
	double t, s;

	s = 0;
	for (i = 0; i < n; i++) if (i != k && i != x) {
        t = v[i];
		for (j = 0; j < n; j++) {
			if (j != i && j != k && j != x)	t = (t*(k-j)) /(i-j);
		}
        s += t;
	}
	return s;
}
 
int main()
{
	int d, i, j;
	double t;

	while (scanf("%d", &d) && d) {
		n = d+3;
		for (i = 0; i < n; i++) scanf("%lf", v+i);
		for (i = 0; i < n; i++) {
			for (j = 0; ; j++) {
				if (j == n) goto done;
				if (j != i) {
					t = calc(i, j) - v[j];
					if (t < -0.1 || t > 0.1) break;
				}
			}
		}
done:	printf("%d\n", i);
	}
	return 0;
}


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

typedef long long ll;

int main(){
	int H,N;
	cin >> H >> N;
	ll s=0;
	rep(i,N){
		int t;
		cin >> t;
		s +=t;
	}

	if(H<=s){cout << "Yes" << endl; }
	else {cout << "No" << endl;}
}

Measured memory_bytes: 256
#include <stdio.h>

int main()
{
  int n,q,i,l,m,r,C=0;

  scanf("%d",&n);

  int S[n];

  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }

  scanf("%d",&q);

  int T[q];

  for(i=0;i<q;i++){
    scanf("%d",&T[i]);
    l=0;
    r=n;
    while(l<r){
      m=(l+r)/2;
      if(T[i]==S[m]){
	C++;
	break;
      }
      if(T[i]>S[m]) l=m+1;
      else if (T[i]<S[m]) r=m;
    }
  }

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

  return 0;
}


Measured memory_bytes: 2300
/*****************************************************/
//#pragma comment(linker, "/STACK:1024000000,1024000000")
#include <map>
#include <set>
#include <stack>
#include <queue>
#include <cmath>
#include <string>
#include <vector>
#include <cstdio>
#include <cstring>
#include <sstream>
#include <cstdlib>
#include <iostream>
#include <algorithm>

using namespace std;

#define   offcin        ios::sync_with_stdio(false)
#define   DEBUG         freopen("#.txt", "r", stdin)
#define   sigma_size    26
#define   lson          l,m,v<<1
#define   rson          m+1,r,v<<1|1
#define   slch          v<<1
#define   srch          v<<1|1
#define   ll            long long
#define   ull           unsigned long long
#define   lowbit(x)     (x&-x)

const int    INF    = 0x3f3f3f3f;
const ll     INFF   = 1e18;
const double pi     = acos(-1.0);
const double inf    = 1e18;
const double eps    = 1e-9;
const ll     mod    = 1e9+7;
const int    maxmat = 10;
const ull    BASE   = 133333331;

/*****************************************************/
inline void RI(int &x) {
      char c;
      while((c=getchar())<'0' || c>'9');
      x=c-'0';
      while((c=getchar())>='0' && c<='9') x=(x<<3)+(x<<1)+c-'0';
}
inline ll bits(ll x) {
      return !x ? x : bits(x - lowbit(x)) + 1;
}
/*****************************************************/

const int maxn = 55;

map<long long, int> mp;
int N, A, B;
long long v[maxn];

long long C(int m, int n) {
    long long ans = 1;
    for (int i = 0; i < n; i ++) {
        ans = ans * (m - i);
        ans = ans / (i + 1);
    }
    return ans;
}

int main(int argc, char const *argv[]) {
    cin>>N>>A>>B;
    for (int i = 1; i <= N; i ++) cin>>v[i];

    sort(v + 1, v + N + 1);

    int last = N - A + 1;
    int p = last - 1;

    while (v[p] == v[last]) p --;

    long long ans = 0;
    long long sum = 0;
    for (int i = N; i >= last; i --) sum += v[i];
    if (v[N] == v[last]) {
        for (int i = A; i <= B; i ++)
            ans += C(N - p, i);
    }
    else {
        int q = last + 1;
        while (v[q] == v[last]) q ++;
        // cout<<p<<" "<<q<<endl;
        int n = q - last;
        int m = q - p - 1;
        ans = C(m, n);
    }
    printf("%.5f\n", sum / (double)A);
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 256
IDENTIFICATION DIVISION.
PROGRAM-ID. 160B.
DATA DIVISION.
WORKING-STORAGE SECTION.
01 S          PIC X(6).
*>
PROCEDURE DIVISION.
  ACCEPT S.
*>
  IF S(3:1) = S(4:1) AND S(5:1) = S(6:1)
    DISPLAY 'Yes'
  ELSE
    DISPLAY 'No'
  END-IF.
*>
  STOP RUN.


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

typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<double, double> pdd;
const ull mod = 1e9 + 7;
#define REP(i,n) for(int i=0;i<(int)n;++i)

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

template<class S, class T> ostream& operator << (ostream& os, const pair<S, T> v){
  os << "(" << v.first << ", " << v.second << ")"; return os;
}
template<class T> ostream& operator << (ostream& os, const vector<T> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << " ";} os << v[i];} return os;
}
template<class T> ostream& operator << (ostream& os, const vector<vector<T>> v){
  for(int i = 0; i < v.size(); i++){if(i > 0){os << endl;} os << v[i];} return os;
}

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

    ll N;
    vector<ll> A(5);
    cin >> N >> A[0] >> A[1] >> A[2] >> A[3] >> A[4];
    sort(A.begin(), A.end());
    cout << ((N-1)/A[0]) + 1 + 4 << endl;

    return 0;
}

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

int main()
{
    int n;
    int a, ccc = 0;
    int count = 0;
    vector<vector<P>> p(15);

    cin >> n;

    for (int i = 0; i < n; i++)
    {
        cin >> a;
        for (int j = 0; j < a; j++)
        {
            int x, y;
            cin >> x >> y;
            p.at(i).push_back(make_pair(x, y));
        }
    }

    for (int bit = 0; bit < (1 << n); bit++)
    {
        // 正直の時、call
        // 正直同士で整合性に問題ないか確認する
        auto func = [&]() {
            bool ans = true;
            for (int i = 0; i < n; i++)
            {
                if (!(bit & (1 << i)))
                    continue;

                for (int j = 0; j < (int)p[i].size(); j++)
                {
                    int dx = p[i][j].first - 1;
                    int dy = p[i][j].second;

                    if (((bit & (1 << dx)) && dy == 1) ||
                        (!(bit & (1 << dx)) && dy == 0))
                        continue;
                    else
                        ans = false;
                }
            }

            return ans;
        };

        if (func())
        {
            count = 0;
            for (int j = 0; j < n; j++)
            {
                if (bit & (1 << j))
                    count++;
            }
            ccc = max(count, ccc);
        }
    }

    cout << ccc << endl;

    return 0;
}


Measured memory_bytes: 3668
#include <iostream>
#include <stdio.h>
#include <cmath>
using namespace std;
int main(){

  int n,i;
  double D=0,vx[100]={},vy[100]={},v[100]={},max=0;

  cin>>n;
  for(i=0; i<n; i++)cin>>vx[i];
  for(i=0; i<n; i++)cin>>vy[i];
  
  for(i=0; i<n; i++){
    if(vx[i]-vy[i]<0)v[i]=vy[i]-vx[i];
    else v[i]=vx[i]-vy[i];
    D+=v[i];
  }
  
  printf("%.6f\n",D);
  D=0;

  for(i=0; i<n; i++){
    v[i]=(vx[i]-vy[i])*(vx[i]-vy[i]);
    D+=v[i];
  }

  printf("%.6f\n",sqrt(D));
  D=0;

  for(i=0; i<n; i++){
    if(vx[i]-vy[i]<0)v[i]=(vy[i]-vx[i])*(vy[i]-vx[i])*(vy[i]-vx[i]);
    else v[i]=(vx[i]-vy[i])*(vx[i]-vy[i])*(vx[i]-vy[i]);
    D+=v[i];
  }

  printf("%.6f\n",pow(D,1.0/3.0));
  D=0;

  for(i=0; i<n; i++){
    if(vx[i]-vy[i]<0){
      if(max<vy[i]-vx[i])max=vy[i]-vx[i];
    }else if(max<vx[i]-vy[i])max=vx[i]-vy[i];
  }
  
  printf("%.6f\n",max);
  
}

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

using namespace std;

typedef long long ll;
typedef long double ld;
#define gap ' '
#define L(i) ((i) - (&i))

const int MAXN = 1000010;
const int MAX = 1e6 + 1;
const int MOD = 1e9;
const int INF = 1e9;

int main(){	
	int n, k; cin >> n >> k;
	vector<int> a(n,0);
	for(int i = 0; i < n; ++i)
		cin >> a[i];
	vector<int> dp(n,INF);
	dp[0] = 0;
	for(int i = 0; i < n; ++i){
		int e = i+1;
		for(int j = 1; j <= k; ++j){
			if(e < n)
				dp[e] = min(dp[e], dp[i]+abs(a[i]-a[e]));
			e++;
		}
	}
	cout << dp[n-1] << "\n";
	return 0;
}

Measured memory_bytes: 3964
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <math.h>
#include <functional>
using namespace std;

int main(){
  int n;
  cin >> n;
  int k;
  cin >> k;
  vector<int> v(n, 0);
  for(int i = 0; i < n; i++){
    cin >> v[i];
  } 
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  int ans = 0;
  for(int i = 0; i < k; i++){
    ans += v[i];
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
use itertools::Itertools;
use proconio::input;
use std::collections::HashSet;

fn main() {
    input! {
        n: usize,
        l: [u64; n],
    }
    let ans = l.iter().combinations(3).filter(|v| {
        let mut vv = v.clone();
        vv.sort();
        vv.len() == vv.iter().collect::<HashSet<&&u64>>().len() && *vv[0] + *vv[1] > *vv[2]
    }).count();
    println!("{}", ans);
}


Measured memory_bytes: 2180
#include <iostream>

int Count(int value)
{
    int count = 1;
    while (value >= 10) {
        value /= 10;
        count++;
    }
    return count;
}

int main()
{
    int a, b;
    while (std::cin >> a >> b) {
        std::cout << Count(a + b) << std::endl;
    }

    return 0;
}



Measured memory_bytes: 3040
#include<bits/stdc++.h>
using namespace std;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
const ll mod=1000000007;
const ll LINF=1LL<<60;
const int INF=1<<30;

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	if(a <= c && c <= b){
		cout << "Yes" << endl;
	}
	else{
		cout<< "No" << endl;
	}
	return 0;
}

Measured memory_bytes: 256
if __name__ == '__main__':
    n, m, k = map(int, input().strip().split())
    a = list(map(int, input().strip().split()))
    b = list(map(int, input().strip().split()))

    min = 0
    a_count = 0
    for i, a_min in enumerate(a):
        if a_min + min <= k:
            min += a_min
            a_count += 1
        else:
            break
    b_count = 0

    for i, b_min in enumerate(b):
        if b_min + min <= k:
            min += b_min
            b_count += 1
        else:
            break

    max_count = a_count + b_count
    if not max_count == n + m and not b_count == m:
        for i in a[:a_count][::-1]:
            min -= i
            a_count -= 1
            while b_count < len(b) and min + b[b_count] <= k:
                min += b[b_count]
                b_count += 1
            if a_count + b_count > max_count:
                max_count = a_count + b_count
            if b_count >= len(b):
                break
    print(max_count)


Measured memory_bytes: 110852
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int[] a=new int[8];

        while (sc.hasNext()) {
            for(int i=0;i<2;i++) {
                double e= sc.nextDouble();
                if(e>=1.1) {
                    a[0+i]++;
                }else if(e>=0.6) {
                    a[2+i]++;
                }else if(e>=0.2) {
                    a[4+i]++;
                }else {
                    a[6+i]++;
                }
            }
        }
        for(int i=0;i<8;i+=2) {
            System.out.println(a[i]+" "+a[i+1]);
        }
    }
}


Measured memory_bytes: 28164
#include<stdio.h>
#include<stdlib.h>
#include<limits.h>
    
    
    
int n,cost;
int A[1001],B[1001];
int L[501],R[502];
    
    
void merge(int left,int mid,int right){
  int i,j,n1=mid-left,n2=right-mid;
  for(i=0;i<n1;i++) L[i]=A[left+i];
  L[n1]=INT_MAX;
  for(i=0;i<n2;i++) R[i]=A[mid+i];
  R[n2]=INT_MAX;
  int l=0,r=0;
  for(i=left;i<right;i++){
    if(L[l]<=R[r]){
      A[i]=L[l];
      l++;
    }
    else{
      A[i]=R[r];
      r++;
    }
  }
}
    
    
void m_sort(int left,int right){
  int mid;
  if( left+1 >= right) return;
  mid=(left+right)/2;
  m_sort(left,mid);
  m_sort(mid,right);
  merge(left,mid,right);
}
    
    
void swap(int a,int b,int *C){
  int swap;
  swap=C[a];
  C[a]=C[b];
  C[b]=swap;
}
    
    
    
    
    
    
      
     
      
    
int main(){
  scanf("%d",&n);
  int i,j;
  int cnt,sum,min,start,x;
  int C[1001]={};
  for(i=0;i<n;i++){
    scanf("%d",&A[i]);
    B[i]=A[i];
  }
  m_sort(0,n);
  for(i=0;i<n;i++){
    if(A[i]==B[i]) C[i]=1;
  }
  cost=0;
  for(i=0;i<n;i++){
    if(C[i]!=1){
      C[i]=1;
      cnt=0;
      sum=0;
      min=B[i];
      x=i;
      while(1){
        for(j=0;j<n;j++){
          if(B[x]==A[j]){
            C[j]=1;
            cnt++;
            sum+=B[j];
            if(min > B[j]) min=B[j];
            x=j;
            break;
          }
        }
        if(x==i) break;
      }
      sum-=min;
      if( (cnt -1)*min > (cnt -1)*A[0]+2*(min +A[0])) cost+=sum+(cnt-1)*A[0]+2*(min +A[0]);
      else cost+=sum+(cnt-1)*min;
    }
  }
  printf("%d\n",cost);
  return 0;
}


Measured memory_bytes: 2100
#include<stdio.h>

void trace(int a[],int n){
  for(int i=0;i<n;i++){
    if(i>0) printf(" ");
    printf("%d",a[i]);
  }
  printf("\n");
}

void insertionSort(int a[],int n){
  int j,v;
  for(int i=1;i<n;i++){
    v = a[i];
    j = i -1;
    while(j>=0 && a[j]>v){
      a[j+1] = a[j];
      j--;
    }
    a[j+1] = v;
    trace(a,n);
  }
}



int main(){
  int n;
  int a[100];
  
  scanf("%d",&n);
  for(int i=0;i<n;i++) scanf("%d",&a[i]);
  
  trace(a,n);
  insertionSort(a,n);
  
  return 0;
}



Measured memory_bytes: 2736
#include <bits/stdc++.h> 
using namespace std;
int main()
{
  string a,b;
  int cnt=0;
  cin>>a>>b;
  for (int i=0;i<a.size();i++)
    if (a[i]!=b[i])
      cnt++;
  cout<<cnt;
	return 0;
}


Measured memory_bytes: 3912
#include  <bits/stdc++.h> 
using namespace std;
 
#define ll long long
#define ar array
#define pii pair<int,int>
#define mp make_pair
 
const ll INF = 1e18;
const ll mod = 1000000007;
const int mxn=10e6;

bool comp(pii a,pii b){
	return a.first<b.first;
}

void solve(){
	string s;cin>>s;
	if (s[s.length()-1]=='s')
	{
		cout<<s<<"es"<<endl;
	}else{
		cout<<s<<'s';
	}
}
 
int main() {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	// int t;
	// cin>>t;
	// while(t--)
		solve();
	return 0;
}

Measured memory_bytes: 3616
import Data.List
import Data.List.Split

solve ls | length ls <= 1 = 0
         | otherwise = length $ head $ groupBy (==) $ reverse $ sort $ f ls [-1] (head ls)
  where f [] ys _ = ys
        f (x:xs) ys bottom | x < bottom = f xs ys x
                           | otherwise = f xs ((x - bottom):ys) bottom

main = do
  l1 <- getLine
  l2 <- getLine
  let ls = map (read::String->Int) $ splitOn " " l2
  let answer = solve ls
  putStrLn $ show $ answer


Measured memory_bytes: 83324