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

#define rep(i,n) for(int i=0;i<(n);++i)
#define reps(i,n) for(int i=1;i<=(n);++i)
#define all(x) (x).begin(),(x).end()
#define int long long
using pii = pair<int,int>;
constexpr int INF  = 0x3f3f3f3f;
constexpr long long LINF = 0x3f3f3f3f3f3f3f3fLL;
signed main(){
    int a,b;
    cin >> a >> b;
    if(a + b == 15) cout << '+' << '\n';
    else if(a * b == 15) cout << '*' << '\n';
    else cout << 'x' << '\n';
    return 0;   
}


Measured memory_bytes: 256
open Array;;let a=make 100 0;;let($)x y=if x>=0&&x<=9&&y>=0&&y<=9then a.(10*y+x)<-a.(10*y+x)+1;;let rec g x y=function|1->x$y;x$(y-1);(x-1)$y;(x+1)$y;x$(y+1)|2->g x y 1;(x-1)$(y-1);(x+1)$(y-1);(x-1)$(y+1);(x+1)$(y+1)|3->g x y 2;x$(y-2);(x-2)$y;(x+2)$y;x$(y+2)|_->();;let rec f()=f(Scanf.scanf"%d,%d,%d
"(fun x y s->g x y s));;try f()with _->(Printf.printf"%d
%d
"(fold_left(fun z e->if e=0then z+1else z)0a)(fold_left(fun z e->max z e)0a))

Measured memory_bytes: 2220
#include <iostream>

using namespace std;

int main(){
	int K,T;
	int max=0;
	cin >> K >> T; 
	int cakes[K];
	for (int i=0; i<T ;i++){
	cin >> cakes[i];
	}
	for (int i=0; i<T ;i++){
	if(cakes[i]>max){max = cakes[i];}
	}
	int ans;
	ans = 2*max- K- 1 ;
	if (ans>=0){cout << ans <<endl;}
	else {cout << 0 << endl;}

}


Measured memory_bytes: 256
#include "bits/stdc++.h"
#define Rep(i,n) for(int i=0;i<(int)(n);i++)
#define For(i,n1,n2) for(int i=(int)(n1);i<(int)(n2);i++)
#define REP(i,n) for(ll i=0;i<(ll)(n);i++)
#define RREP(i,n) for(ll i=((ll)(n)-1);i>=0;i--)
#define FOR(i,n1,n2) for(ll i=(ll)(n1);i<(ll)(n2);i++)
#define RFOR(i,n1,n2) for(ll i=((ll)(n1)-1);i>=(ll)(n2);i--)
#define all(a)  (a).begin(),(a).end()
#define IOS std::cin.tie(0),std::ios::sync_with_stdio(false)

namespace idaten {

	using namespace std;
	using ll = int_fast64_t;
	using ull = uint_fast64_t;
	using P = std::pair<int64_t, int64_t>;
	template<typename T1, typename T2> inline bool chmin(T1& a, T2 b) { if (a > b) { a = b; return 1; }return 0; }
	template<typename T1, typename T2> inline bool chmax(T1& a, T2 b) { if (a < b) { a = b; return 1; }return 0; }
	template<class Type>struct is_vector : std::false_type {};
	template<class ValueType, class Alloc>struct is_vector<std::vector<ValueType, Alloc>> : std::true_type {};
	template <typename T> inline std::ostream& operator << (std::ostream& out, const std::vector<T>& v) {
		if (v.empty())return out;
		constexpr bool is_vector_v = is_vector<T>::value;
		if (is_vector_v)for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? "\n" : "");
		else for (auto itr = v.begin(); itr != v.end();)out << (*itr), out << ((++itr != v.end()) ? " " : "");
		return out;
	}
	inline void put() {}
	template<class T> inline void put(const T& first) { std::cout << first << "\n"; }
	template<class T, class... N> inline void put(const T& first, const N& ... rest) { std::cout << first << " "; put(rest...); }
	inline void putn() {}
	template<class T, class... N> inline void putn(const T& first, const N& ... rest) { std::cout << first << "\n"; putn(rest...); }

	void solve() {
		IOS;
		int n;
		cin >> n;
		double res = (double)n * 2 * 3.141926535;
		cout << setprecision(20) << res << endl;
	}

} // namespace idaten

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


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

#define rep(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ROF(i,a,b) for(int i=(a)-1;i>=(b);i--)
#define all(a) (a).begin(),(a).end()
#define rall(a) (a).rbegin(),(a).rend() //sortで大きい順
#define UNIQUE(v) v.erase(unique(all(v)),v.end())
#define SUM(a) accumulate(all(a),0)
#define pb push_back
#define fst first
#define snd second
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<string> vs;
typedef pair<int,int> pii;
typedef long long ll;


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

main(){
  ll n,m; cin >> n >> m;
  
  ll ans = 0;
  if(n == 1 and m == 1) ans = 1;
  else if(n == 2 or m == 2) ans = 0;
  else if(n == 1) ans = m - 2;
  else if(m == 1) ans = n - 2;
  else ans = (m -2 ) * (n -2);
  cout << ans << endl;
}


Measured memory_bytes: 256
#define ll long long
#define vv(t) vector<vector<t>>
#define v(t) vector<t>
#define vvi vector<vector<int>>
#define vi vector<int>
#define rep(I, N) for(int I=0; I<N; ++I)
#define FOR(i, m, n) for(int i=m; i<n; ++i)
#define ALL(obj) (obj).begin(), (obj).end()
#define pb push_back
#include <iostream>
#include <algorithm>
#include <vector>
#include <set>
//#include <bits/stdc++.h>

using namespace std;
//cin.tie(0);
//sync_with_stdio(false);
template <class T = int>    T in(){ T x;  cin >> x;   return (x); }

int main(int argc, const char * argv[]) {
    ll x, y, z, n;      cin >> x >> y >> z >> n;
    v(ll) a(x), b(y), c(z);
    rep(i, x){  cin >> a[i];    }
    rep(i, y){  cin >> b[i];    }
    rep(i, z){  cin >> c[i];    }
    
    multiset<ll> ab;
    ab.insert(0);
    rep(i, x){
        rep(j, y){
            ll tmp = a[i] + b[j];
            if(*ab.begin() <= tmp){
                ab.insert(tmp);
                if(ab.size() > n){  ab.erase(ab.begin());   }
            }
        }
    }
    
    multiset<ll> abc;
    abc.insert(0);
    for(auto itr=ab.begin(); itr != ab.end(); ++itr){
        rep(i, z){
            ll tmp = *itr + c[i];
            if(*abc.begin() <= tmp){
                abc.insert(tmp);
                if(abc.size() > n){ abc.erase(abc.begin()); }
            }
        }
    }
    
    auto itr=abc.end();
    do{
        cout << *--itr << endl;
    }while(itr != abc.begin());
    return 0;
}


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

#define rep(i, m, n) for(int(i) = (int)(m); i < (int)(n); ++i)
#define rep2(i, m, n) for(int(i) = (int)(n)-1; i >= (int)(m); --i)
#define REP(i, n) rep(i, 0, n)
#define REP2(i, n) rep2(i, 0, n)
#define all(hoge) (hoge).begin(), (hoge).end()
#define en '\n'
using ll = long long;
using ull = unsigned long long;
template <class T>
using vec = vector<T>;
template <class T>
using vvec = vector<vec<T>>;
typedef pair<ll, ll> P;
constexpr long long INF = 1LL << 60;
constexpr int INF_INT = 1 << 25;
constexpr long long MOD = (ll)1e9 + 7;
//constexpr long long MOD = 998244353LL;
using ld = long double;
static const ld pi = 3.141592653589793L;
typedef vector<ll> Array;
typedef vector<Array> Matrix;

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

struct Edge {
    ll to, rev;
    long double cap;
    Edge(ll _to, long double _cap, ll _rev) {
        to = _to;
        cap = _cap;
        rev = _rev;
    }
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;

void add_edge(Graph &G, ll from, ll to, long double cap, bool revFlag,
              long double revCap) {
    G[from].push_back(Edge(to, cap, (ll)G[to].size()));
    if(revFlag)
        G[to].push_back(Edge(from, revCap, (ll)G[from].size() - 1));
}

void solve() {
    ll n;
    cin >> n;

    ll m = 0;
    ll sum = 0;
    rep(i, 1, n + 1) {
        m++;
        sum += m;
        if(n == sum)
            break;
        else if(n < sum) {
            cout << "No" << en;
            return;
        }
    }

    cout << "Yes" << en;

    vvec<ll> ans(m + 1);
    ans[0].push_back(1);
    ll now = 2;
    rep(i, 1, m + 1) {
        REP2(j, i) {
            ans[i].push_back(now);
            ans[j].push_back(now);
            now++;
        }
    }

    ans[0].pop_back();
    ans[m].pop_back();
    ans[m].push_back(1);

    cout << m + 1 << en;
    for(auto i : ans) {
        cout << i.size() << " ";
        for(auto j : i)
            cout << j << " ";
        cout << en;
    }
}

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

    solve();
    // ll t;cin>>t;REP(i,t) solve();

    return 0;
}


Measured memory_bytes: 5052
#!/bin/bash

read n
i=0
if [ ${n:0:1} = '7' ]; then
	i=1
fi
if [ ${n:1:1} = '7' ]; then
	i=1
fi
if [ ${n:2:1} = '7' ]; then
	i=1
fi
if [ $i -eq 1 ]; then
	echo "Yes"
else echo "No"
fi


Measured memory_bytes: 3800
using System;
using System.Collections.Generic;
public class ABC142A {
    public static void Main() {
        int N;
        double ans = 0;
        N = int.Parse(Console.ReadLine());

        if (N % 2 == 0) ans = 0.5;
        else ans = (N / 2 + 1) / (double) N;
        Console.WriteLine(ans);
    }
}


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

int main(){
  int d, g;
  cin >> d >> g;
  vector<int> pd(d), cd(d);
  for(int i=0; i<d; ++i) cin >> pd[i] >> cd[i];
  int ans = 1001;
  for(int i=0; i<(1<<d); ++i){
    int nans = 0, point = 0;
    for(int j=0; j<d; ++j){
      if(i>>j &1){
        point += cd[j];
        point += pd[j] *(j+1) *100;
        nans += pd[j];
      }
    }
    int num = d-1;
    while(point < g){
      while(num >= 0 && (i>>num &1) == 1) --num;
      if(num <0) break;
      if(point + pd[num] *(num+1) *100 <g){
        point += pd[num] *(num+1) *100;
        nans += pd[num];
        --num;
      }else{
        nans += ((g-point) /100 -1)/(num+1) +1;
        break;
      }
    }
    ans = min(ans, nans);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3612
L, k = map( int, input().split() )
a = list( map( int, input().split() ))
 
ret = L
for i in range( len(a) ):
  if i == 0:
    ret = min( ret, L - abs(a[0] - ( a[-1] - L )))
  else:
    ret = min( ret, L - abs(a[i] - a[i-1]))
print( ret )

Measured memory_bytes: 26436
#include<bits/stdc++.h>
using namespace std;
int main() {
 	string S;
  cin >> S;
  bool ok = (S.length() % 2 == 0);
  for (size_t i = 0; i < S.length(); ++i)
    ok = ok && (S[i] == (i%2 == 0 ? 'h' : 'i'));
  cout << (ok ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define INF 1e9
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ALL(x) (x).begin(), (x).end()
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}
const int MOD = 1000000007;

const int N = 4;

void solve() {
  string s;
  cin >> s;
  rep(bit, (1<<N-1)) {
    int temp = s[0] - '0';
    string ans = s.substr(0, 1);
    rep(i, N-1) {
      if (bit & (1 << i)) {
        temp += (s[i+1] - '0');
        ans = ans + '+' + s[i+1];
      } else {
        temp -= (s[i+1] - '0');
        ans = ans + '-' + s[i+1];
      }
    }
    if (temp == 7) {
      cout << ans + "=7" << endl;
      return;
    }
  }
}

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

Measured memory_bytes: 3616
fn solve(s: String, mut acc: String) -> String {
    let mut result = "NO".to_string();

    while s.len() >= acc.len() {
        if s == acc {
            result = "YES".to_string();
            break;
        } else if s.starts_with(&format!("{}maerd", acc)) {
            acc = format!("{}maerd", acc);
        } else if s.starts_with(&format!("{}remaerd", acc)) {
            acc = format!("{}remaerd", acc);
        } else if s.starts_with(&format!("{}esare", acc)) {
            acc = format!("{}esare", acc);
        } else if s.starts_with(&format!("{}resare", acc)) {
            acc = format!("{}resare", acc);
        } else {
            break;
        }
    }

    result
}

fn main() {
    let s = read();

    println!("{}", solve(s.chars().rev().collect::<String>(), "".to_string()));
}

fn read() -> String {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().to_string()
}


Measured memory_bytes: 2724
#include <bits/stdc++.h>
using namespace std;
int n,i,r,a[100100];
int main() {
  scanf("%d",&n);
  for (i=1; i<=n; i++) scanf("%d",&a[i]);
  for (i=1; i<=n; i++) if (a[a[i]]==i) r++;
  printf("%d\n",r/2);
  return 0;
}


Measured memory_bytes: 768
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/detail/standard_policies.hpp>

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using indexed_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define all(v)			((v).begin()), ((v).end())
#define SZ(v)			((int)((v).size()))
#define clr(v, d)		memset(v, d, sizeof(v))
#define has(c,i) 		((c).find(i) != end(c))
#define has_str(s, c)	((s).find(c) != string::npos)
typedef long long ll;
const int N = 3e3+9;
string a, b;
int main() {
#ifdef LOCAL
    freopen("input.in.txt", "rt", stdin);
#endif
    ios_base::sync_with_stdio(false);
    cin.tie(nullptr);
    cout.tie(nullptr);
    cin >> a >> b;
    string ans = "";
    int n = SZ(a), m = SZ(b);
    vector<vector<int>> dp(n+1, vector<int>(m+1,0));
    for(int i = 1; i <= n; ++i) {
        for(int j = 1; j <= m; ++j) {
            if(a[i-1] == b[j-1]) {
                dp[i][j] = 1+dp[i-1][j-1];
            } else {
                dp[i][j] = max(dp[i-1][j], dp[i][j-1]);
            }
        }
    }
    int i = n, j = m;
    while (i > 0 && j > 0) {
        if(a[i-1] == b[j-1]) {
            ans += a[i-1];
            --i;
            --j;
        } else {
            if(dp[i-1][j] > dp[i][j-1])
                --i;
            else
                --j;
        }
    }
    reverse(all(ans));
    cout << ans << endl;
    return 0;
}

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

struct Ball{
  string name;
  int num;
};

int main(){
  string S, T, U;
  int A, B;
  
  cin >> S >> T;
  cin >> A >> B;
  cin >> U;

  Ball x = {S, A};
  Ball y = {T, B};

  if (U == S){
    x.num--;
  }else if(U == T){
    y.num--;
  }

  cout << x.num << " " << y.num << endl;

}


Measured memory_bytes: 256
from collections import Counter
n=int(input())
S=Counter([input() for i in range(n)])

A=[]
for v,m in S.items():
    A.append((m,v))

A=sorted(A)[::-1]
num=A[0][0]

B=[]
for i in A:
    if i[0]==num:
        B.append(i[1])
    else:break

for i in sorted(B):
    print(i)

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

int main() {
	int N, K;
	string S;
	cin >> N >> K;
	cin >> S;

	vector<int> Nums;
	int now = 1;	// 今見ている数
	int cnt = 0;	// nowがいくつ並んでいるか

	for (int i = 0; i < N; i++) {
		if (S[i] == (char)(now + '0')) cnt++;
		else {
			Nums.push_back(cnt);
			now = 1 - now;
			cnt = 1;
		}
	}
	if (cnt != 0) Nums.push_back(cnt);
	if (Nums.size() % 2 == 0) Nums.push_back(0);

	// 累積和
	vector<int> sum(Nums.size() + 1, 0);
	for (int i = 0; i < Nums.size(); i++) {
		sum[i + 1] = sum[i] + Nums[i];
	}

	int Add = 2 * K + 1;
	int ans = 0;
	for (int i = 0; i < Nums.size(); i += 2) 
	{
		int left = i;
		int right = min(i + Add, (int)Nums.size());
		int tmp = sum[right] - sum[left];
		ans = max(tmp, ans);
	}

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


Measured memory_bytes: 1272
#include <bits/stdc++.h>
using namespace std;
#ifdef ENABLE_DEBUG_OUTPUT
#define DEBUG_LOG(s) cout << s << endl;
#else
#define DEBUG_LOG(s) void();
#endif

int main(){
    int n, m;
    cin >> n >> m;

    vector<int> c(m);
    for (auto i = 0; i < m; i++) cin >> c[i];

    vector<vector<int>> dp(m, vector<int>(n + 1, INT_MAX));
    dp[0].assign(n + 1, 0);
    for (auto i = 0; i <= (n - c[0]); i++) dp[0][i + c[0]] = dp[0][i] + 1;

    for (auto i = 1; i < m; i++) {
        for (auto j = 0; j <= n; j++) {
            dp[i][j] = min(dp[i - 1][j], dp[i][j]);
            if(j + c[i] <= n) {
                dp[i][j + c[i]] = min(dp[i - 1][j + c[i]], dp[i][j] + 1);
            }
        }

//        for (auto j = 0; j < m; j++) {
//            for (auto k = 0; k <= n; k++) {
//                cout << dp[j][k] << " ";
//            }
//            cout << endl;
//        }
    }
    cout << dp[m - 1][n] << endl;
    return 0;
}


Measured memory_bytes: 7092
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<ctime>
#include<vector>
#include<queue>
#include<algorithm>
#include<string>
#include<sstream>
#include<cctype>
#include<cmath>
#include<iomanip>
#include<map>
#include<stack>
#include<set>
#include<functional>
#define in(x) x=read()
#define qr read()
#define int ll
#define mp make_pair
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
namespace fastIO
{
    #define BUF_SIZE 100000
    bool IOerror=0;
    inline char nc()
	{
        static char buf[BUF_SIZE],*p1=buf+BUF_SIZE,*pend=buf+BUF_SIZE;
        if (p1==pend){
            p1=buf; pend=buf+fread(buf,1,BUF_SIZE,stdin);
            if (pend==p1){IOerror=1;return -1;}
        }
        return *p1++;
    }
    inline bool blank(char ch){return ch==' '||ch=='\n'||ch=='\r'||ch=='\t';}
    inline ll read()
	{
        bool sign=0; char ch=nc();ll x=0;
        for (;blank(ch);ch=nc());
        if (IOerror)return 0;
        if (ch=='-')sign=1,ch=nc();
        for (;ch>='0'&&ch<='9';ch=nc())x=x*10+ch-'0';
        if (sign)x=-x;
        return x;
    }
    #undef BUF_SIZE
};
using namespace fastIO;
#define mod 1000000007
int f[50][300000];
int qpow(int n,int k)
{
	int ans=1;
	while(k)
	{
		if(k&1)ans*=n,ans%=mod;
		n*=n,n%=mod;
		k>>=1;
	}
	return ans;
}
signed main()
{
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	int n=qr,x=qr,y=qr,z=qr;
	int t=(1<<(z-1))|(1<<(y+z-1))|(1<<(x+y+z-1));
	int all=(1<<(x+y+z));
	f[0][0]=1;
	for(int i=1;i<=n;i++)
	{
		for(int j=0;j<all;j++)
		{
			if(f[i-1][j])
			{
				for(int k=1;k<=10;k++)
				{
					int nex=((j*2+1)<<(k-1))&(all-1);
					if((nex&t)!=t)f[i][nex]+=f[i-1][j],f[i][nex]%=mod;
				}
			}
		}
	}
	int ans=0;
	for(int i=0;i<all;i++)ans+=f[n][i],ans%=mod;
	cout<<(qpow(10,n)-ans+mod)%mod;
	return 0;
}

Measured memory_bytes: 94464
using Atcoder;
using System;
using System.Collections.Generic;
using System.ComponentModel.Design;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var first = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
            var N = first[0];
            var X = first[1];
            var Ls = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();

            int result = 1;
            int tmp = 0;

            for (int i = 0; i < N; i++)
            {
                tmp = tmp + Ls[i];
                if (tmp <= X)
                {
                    result++;
                }
            }
            Console.Write(result);
        }
        //static void Main(string[] args)
        //{
        //    var temp = new Atcoder.ABC129.B();
        //    temp.Run();
        //}

    }

    //var N = int.Parse(Console.ReadLine());
    //var S = Console.ReadLine();
    //var K = Console.ReadLine().Split(' ');
    //var N = int.Parse((K[0]));
    //var M = int.Parse((K[1]));
    //var firstLine = Console.ReadLine().Split(' ').Select(int.Parse);
}

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

int main() {

    ll N;
    cin >> N;

    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    ll ans = 0;

    for (int i = 1; i < N; ++i)
    {
        if (A[i-1] <= A[i]) continue;
        ll x = A[i-1] - A[i];
        ans += x;
        A[i] += x;
    }

    cout << ans << endl;


    return 0;
}

Measured memory_bytes: 4804
#include<bits/stdc++.h>
using namespace std;
 
#define pfi(a) printf("%d",a);
#define pfl(a) printf("%lld",a);
#define pfin(a) printf("%d\n",a);
#define pfln(a) printf("%lld\n",a);
#define pfis(a) printf("%d ",a);
#define pfls(a) printf("%lld ",a);
#define sfi(a) scanf("%d",&a);
#define sfl(a) scanf("%lld",&a);
#define fast ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define f(i,a,b) for(int i=a;i<b;i++)
#define pb(a) push_back(a);
#define mp(a,b) make_pair(a,b)
#define ll long long   

const ll mod=1e9+7;

int main()
{
    string s;
    cin>>s;
    s[0]='2';
    s[1]='0';
    s[2]='1';
    s[3]='8';
    cout<<s<<endl;
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define int long long
#define inf 998244353
#define LINF 100000000000000007LL
#define ll long long
using namespace std;
int dis[10][10];
signed main(){
	int h,w;
	cin>>h>>w;
	for(int i=0;i<=9;i++){
		for(int j=0;j<=9;j++){
			cin>>dis[i][j];
		}
	}
	for(int k=0;k<=9;k++){
		for(int i=0;i<=9;i++){
			for(int j=0;j<=9;j++){
				dis[i][j] = min( dis[i][j], dis[i][k] + dis[k][j] );
			}
		}
	}
	int ans = 0;
	for(int i=0;i<h;i++){
		for(int j=0;j<w;j++){
			int x;
			cin>>x;
			if( x != -1 ) ans += dis[x][1];
		}
	}
	cout<<ans<<endl;
	return 0;
}

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


static const int COUNTER_CLOCKWISE = 1; //??????????????¨??????
static const int CLOCKWISE = -1;
static const int ON_SEGMENT = 0;
static const int ONLINE_FRONT = 2;
static const int ONLINE_BACK = -2;

int n;

const double EPS = 1e-10;

bool equals(double a, double b) {
	return fabs(a - b) < EPS;
}

class Point {
public:
	double x, y;

	Point(double x = 0, double y = 0): x(x), y(y) {}

	Point operator + (Point p) {
		return Point(x + p.x, y + p.y);
	}
	Point operator - (Point p) {
		return Point(x - p.x, y - p.y);
	}
	Point operator * (double k) {
		return Point(k * x, k * y);
	}
	Point operator / (double k) {
		return Point(x / k, y / k);
	}

	double norm() {
		return x * x + y * y;
	}
	double abs() {
		return sqrt(norm());
	}

	bool operator < (const Point &p) const {
		return x != p.x ? x < p.x : y < p.y;
	}

	bool operator == (const Point &p) const {
		return fabs(x - p.x) < EPS && fabs(y - p.y) < EPS;
	}

	Point orth() {
		return Point(-y, x) / abs();
	}
};

typedef Point Vector;

double dot(Vector a, Vector b) {
	return a.x * b.x + a.y * b.y;
}

double cross(Vector a, Vector b) {
	return a.x * b.y - a.y * b.x;
}

int check(Vector v0, Vector v1) { //????????§??????
	double c = cross(v0, v1);
	if (equals(c, 0)) {
		if (dot(v0, v1) < 0) return ONLINE_BACK;
		else if (v1.norm() > v0.norm()) return ONLINE_FRONT;
		else return ON_SEGMENT;
	} else if (c > 0) {
		return COUNTER_CLOCKWISE;
	} else {
		return CLOCKWISE;
	}
}

class Polygon {
public:
	vector<Point> Poly;

	void contain(Point p) {
		bool x = false;
		for (int i = 0; i < Poly.size(); i++) {
			Vector a = Vector((Poly[i] - p).x, (Poly[i] - p).y);
			Vector b = Vector((Poly[(i + 1) % n] - p).x, (Poly[(i + 1) % n] - p).y);
			if (equals(cross(a, b), 0) && dot(a, b) <= 0) {
				cout << 1 << endl;
				return;
			}
			if (a.y > b.y) swap(a, b);
			if (a.y <= 0 && b.y > 0 && cross(a, b) > 0) x = !x;
		}
		if (x) cout << 2 <<endl;
		else cout << 0 << endl;
	}
};


int main() {
	int q;
	cin >> n;
	int x, y;
	Polygon P;
	for (int i = 0; i < n; i++) {
		cin >> x >> y;
		P.Poly.push_back(Point(x, y));
	}
	cin >> q;
	for (int i = 0; i < q; i++)	{
		cin >> x >> y;
		P.contain(Point(x, y));
	}
	return 0;
}

Measured memory_bytes: 1204
#include <vector>
#include <iostream>
using namespace std;
#define M 1000000007
int n;
vector<int> adj[100100];
long long dpb[100100], dpw[100100];

void dfs(int i, int p) {
    dpb[i] = 1; dpw[i] = 1;
    for (int j : adj[i]) {
        if (j != p) {
            dfs(j, i);
            dpb[i] = dpb[i] * dpw[j] % M;
            dpw[i] = dpw[i] * (dpw[j] + dpb[j]) % M;
        }
    }
}

int main() {
    cin >> n;
    for (int i = 1; i < n; i++) {
        int x, y; cin >> x >> y;
        x--; y--;
        adj[x].push_back(y);
        adj[y].push_back(x);
    }
    dfs(0, -1);
    cout << (dpb[0] + dpw[0]) % M << endl;
}


Measured memory_bytes: 14208
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <iostream>
#include <string>
#include <vector>
#include <stack>
#include <bitset>
#include <cstdlib>
#include <cmath>
#include <set>
#include <list>
#include <deque>
#include <map>
#include <queue>
#include <fstream>
#include <cassert>
#include <cmath>
#include <sstream>
#include <time.h>
#include <iomanip>
#include <complex>
#include <unordered_set>

using namespace std;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef pair<int,int> ii;
typedef pair<double,double> dd;
typedef pair<char,char> cc;
typedef vector<ii> vii;
typedef long long ll;
typedef pair<ll, ll> l4;
typedef long double ld;
const double pi = acos(-1);
const int maxn = 300010;
const ll mod = 1e9+7;
const int inf = 1e9;
int T;

int n,m;
int a,b,c,d;

int main()
{
    scanf("%d%d%d%d%d",&a,&b,&c,&d,&n);
    int A = a*4;
    int B = b*2;
    int C = c;
    int mini = min(min(A,B),C);
    ll ans = 0;
    if (d < mini*2) {
        ans = (ll)n/2*d;
        n %= 2;
    }
    ans += (ll)n*mini;
    printf("%lld\n",ans);
    return 0;
}





Measured memory_bytes: 256
/*~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=
    WRITER:kakitamasziru/OxOmisosiru
~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=~=*/
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <iomanip>
#include <limits>//setprecision
//#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <math.h>//pow,,,
#include <cmath>//abs,,,
//#include <unordered_map> // unordered_map
//#include <unordered_set> // unordered_set
#include <bitset> // bitset
//#include <cctype> // isupper, islower, isdigit, toupper, tolower
//It is so troublesome that I include bits/stdc++.h !
using namespace std;

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; }
const long long INF = 100100100100100;
const int MOD = 1000000007;
typedef pair<int,int> P;
//NのM乗を求める(繰り返し二乗法)
long long mod_pow(long long N, long long M) {
    if (M == 0) return 1;
    long long res = mod_pow((N * N) % MOD, M / 2);
    //最下位ビット(*N)が1の時は単独でNをかける
    if (M & 1) res = (res * N) % MOD;

    return res %= MOD;
}
long long nCr(long long n, long long r) {
    long long A = 1, B = 1;
    //Aが分子Bが1/r!
    for (long long i = n - r + 1; i <= n; i++) {
        A = A * i % MOD;
    }
    for (long long i = 1; i <= r; i++) {
        B = B * i % MOD;
    }
    B = mod_pow(B, MOD - 2);
    B %= MOD;
    //Bは割るのではなく掛ける
    return (A * B) % MOD;
}

int main() {
    int N,M;
  	scanf("%d%d", &N, &M);
    long long ans = 0;
    priority_queue<int>Q;
    for(int i = 0;i<N;i++){
        int A;
      scanf("%d",&A);
        Q.push(A);
    }

    for(int i = 0;i<M;i++){
        int X = Q.top();
        Q.pop();
        Q.push(X/2);
    }

    for(int i=0;i<N;++i){
        ans += Q.top();
        Q.pop();
    }

    cout << ans << endl;
    
    // PLEASE GIVE ME THE "ACCEPTED" !
}


Measured memory_bytes: 892
#include<stdio.h>

int main(void){
	int a,s,i;
	s=0;
	for(i=0;i<4;i++){
		scanf("%d",&a);
		s=s+a;
	}
	printf("%d\n%d\n",s / 60,s % 60);
	return 0;
}

Measured memory_bytes: 1796
import math


def bits(n, max_bits):
    return [int(x) for x in format(n, '0{}b'.format(max_bits))]


def main():
    A, B = map(int, input().split())

    max_bits = len(bin(B)[2:])
    c = [0] * max_bits
    ans = -1

    # for n in range(A, B+1):
    #     a = bits(n, max_bits)
    #     for i in range(max_bits):
    #         if a[i] == 1:
    #             c[i] += 1

    #     if ans == -1:
    #         ans = n
    #     else:
    #         ans ^= n

    # print(ans)
    # print(*c)

    # print(*bits(A, max_bits))
    # print(*bits(B, max_bits))
    # print(int(math.ceil((B - A) / 2)))
    pair = []
    for C in [A-1, B]:
        cur = 1
        bit_list = []
        for i in range(0, max_bits):
            a = C // (cur * 2)
            b = C % (cur * 2)
            # print(a, b, (a * cur), (b - cur) + 1)
            bit_list.append((a * cur) + max((b - cur) + 1, 0))
            # print(C, i, a, b, (a * cur) + max((b - cur) + 1, 0))
            cur *= 2
        # print(bit_list)
        pair.append(bit_list)

    pair[0] = pair[0][::-1]
    pair[1] = pair[1][::-1]
    for i in range(max_bits):
        c[i] = pair[1][i] - pair[0][i]

    ans = ''
    for i in range(max_bits):
        if c[i] % 2 == 0:
            ans += '0'
        else:
            ans += '1'

    print(int(ans, 2))
    # print(*c)


if __name__ == '__main__':
    main()


Measured memory_bytes: 38384
#include <bits/stdc++.h>
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;

int main() {
  int n;
  cin >> n;
  vector<int> p(n);
  int maxv = 0;
  ll sum = 0;
  for (int i = 0; i < n; i++) {
    cin >> p[i];
    maxv = max(maxv, p[i]);
    sum += p[i];
  }
  cout << sum - maxv + (maxv / 2) << endl;
  return 0;
}

Measured memory_bytes: 3580
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
const int INF = 1001001001;
const ll LINF = 1LL << 60;

template <typename T>
void print(const T &v)
{
    for (int i = 0; i < v.size(); i++)
    {
        if (i)
            cout << ' ';
        cout << v[i];
    }
    cout << endl;
}

int main()
{
    string s;
    cin >> s;
    if (s.size() == 2)
    {
        cout << s << endl;
    }
    else
    {
        reverse(s.begin(), s.end());
        cout << s << endl;
    }
}


Measured memory_bytes: 3576
//============================================================================
// Author       : Sun YaoFeng
//============================================================================

//#pragma 	comment(linker, "/STACK:100240000,100240000")
//#include	<cstdio>
//#include	<cstdlib>
//#include	<cstring>
//#include	<algorithm>

#include	<bits/stdc++.h>

using	namespace	std;

#define DB		double
#define	lf		else if
#define I64		long long
#define	Rd()	(rand()<<15|rand())
#define For(i,a,b)	for(int i=a,lim=b;i<=lim;i++)
#define Rep(i,a,b)	for(int i=a,lim=b;i>=lim;i--)

#define	fi	first
#define se	second
#define MK	make_pair
#define PA	pair<int, int>

//#define	min(a,b)	((a)<(b)?(a):(b))
//#define	max(a,b)	((a)<(b)?(b):(a))

#define	CH	(ch=getchar())
int		IN()	{
		int x= 0, f= 0, ch;
		for	(; CH < '0' || ch > '9';)	f= (ch == '-');
		for	(; ch >= '0' && ch <= '9'; CH)	x= x*10 + ch -'0';
		return	f? -x : x;
}

#define n	100005

int		N, A[n], B[n];

I64		Ans;

int		main(int argc, char* argv[]){
		N= IN();
		For(i, 1, N)	A[i]= IN(), B[i]= IN();
		
		Rep(i, N, 1)	if	((A[i] + Ans) % B[i])	{
			Ans+= B[i] - (A[i] + Ans) % B[i];
		}
		
		cout << Ans << endl;
		
		return	0;
}

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

signed main(){
  int a,b;

  cin>>a>>b;

  int sum=1;
  int count=0;

  while(true){
    if(sum>=b) break;
    sum=a-1+sum;
    count++;
  }

  cout<<count<<endl;

  return(0);
}


Measured memory_bytes: 256
import sys
from collections import deque, Counter, defaultdict
from fractions import gcd
input = sys.stdin.readline

def eprint(s):
    if type(s) != type('str'):
        s=str(s)

    sys.stderr.write(s+'\n')
    return

def main():
    s = input()
    print('x' * (len(s)-1))
    return

if __name__ == '__main__':
    main()

Measured memory_bytes: 5568
using System;
using System.Collections.Generic;
using System.Text;


namespace ConsoleApplication4
{
    class Program
    {
        static void Main(string[] args)
        {

            string s = Console.ReadLine(); //?????????

            int count = int.Parse(s);    //5

            int max = int.MinValue;
            int min = int.MaxValue;
            long total =0;

            string[] ss = Console.ReadLine().Split(' ');

            for(int i =0; i<count; i++)
            {
             
                int value = int.Parse(ss[i]);
                
                if(max< value)
                 max = value;
                if (min >value)
                    min = value;
                total = total + value;
               
            }
            Console.WriteLine(min + " " + max + " " + total);
        }
    }
}

Measured memory_bytes: 19892
#include <iostream>
#include <vector>
#include <map>
#include <algorithm>
#include <fstream>
#include<cstdio>
#include<iomanip>

#define REP(i, n) for(int i=0;i<n;i++)
#define REP2(i, s, n) for(int i=s;i<n;i++)
#define REP_1(i, n) for(int i=1;i<n+1;i++)
#define bitSearch(bit, n) for(int bit = 0; bit < (1 << N); bit++)
using namespace std;

void printAns(int a) { cout << a << endl; }

void yesno(bool a) { if (a)cout << "Yes" << endl; else cout << "No" << endl; }

void YESNO(bool a) { if (a)cout << "YES" << endl; else cout << "NO" << endl; }

typedef long long ll;
typedef unsigned long ul;
typedef long double ld;

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

ll INF = 10000000;
ll mod = 1000000007;//10^9+7



//番号ズレ注意！！
int main() {
    double W, H, x, y;
    cin >> W >> H >> x >> y;
    double S = W * H / 2.0;
    bool plu = false;
    if (2 * x == W && 2 * y == H) { plu = true; }
    cout << S << ' ' << plu << endl;
}


Measured memory_bytes: 256
#include<iostream>
using namespace std;
int main(){
cin.tie(0);
   	ios::sync_with_stdio(false);

int a,sum=0;
for(int i=0;i<5;i++){
cin >> a;
if(a<40)
sum+=40;
else
sum += a;
}
cout << sum/5 << "\n";
return 0;
}

Measured memory_bytes: 3196
import sys

s = str(input())
p = str(input())

s += s

ans = 'No'
for i in range(len(s)//2):
  if s[i] == p[0]:
    for j in range(len(p)):
      if s[i+j] != p[j]:
        break
      if j == len(p)-1:
         ans ='Yes'
print(ans)



Measured memory_bytes: 5564
#include <stdio.h>
#include <iostream>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>

using ll = long long int;
using P = std::pair<ll, int>;
const int INF = (1<<30);
const ll INFLL = (1ll<<60);
const ll MOD = (ll)(1e9+7);

#define l_ength size

void mul_mod(ll& a, ll b){
	a *= b;
	a %= MOD;
}

void add_mod(ll& a, ll b){
	a = (a<MOD)?a:(a-MOD);
	b = (b<MOD)?b:(b-MOD);
	a += b;
	a = (a<MOD)?a:(a-MOD);
}

ll c[30],s[400][30];
int t[400],l[30];

int main(void){
	int d,i,j,n=26;
	ll ans = 0;
	std::cin >> d;
	for(i=0; i<26; ++i){
		l[i] = -1;
		std::cin >> c[i];
	}
	for(i=0; i<d; ++i){
		for(j=0; j<n; ++j){
			std::cin >> s[i][j];
		}
	}
	for(i=0; i<d; ++i){
		std::cin >> t[i]; --t[i];
		ans += s[i][t[i]];
		l[t[i]] = i;
		for(j=0; j<n; ++j){
			ans -= c[j]*(i-l[j]);
		}
		std::cout << ans << std::endl;
	}
	return 0;
}


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

int main(){
  size_t K;
  cin >> K;
  vector<long long> R;
  for(int i = 1; i < 10; ++i) R.push_back(i);
  while(R.size() < K){
    K -= R.size();
    set<long long> tmp;
    for(auto r : R){
      int c = r%10;
      tmp.insert(r*10+c);
      if(c > 0) tmp.insert(r*10+c-1);
      if(c < 9) tmp.insert(r*10+c+1);
    }
    vector<long long> R_(tmp.begin(),tmp.end());
    swap(R,R_);
  }
  cout << R[K-1] << endl;
}


Measured memory_bytes: 7808
import sys
def input(): return sys.stdin.readline().strip()
import math
def resolve():
    n=int(input())
    l=list(map(int,input().split()))
    l.sort(reverse=True)
    ans=0
    jissitu=0
    naka=l[0]//2
    for i in range(1,n):
        if l[i]>naka and l[0]-i>jissitu:
            ans=l[i]
            jissitu=l[0]-l[i]
        elif l[i]<=naka and l[i]>jissitu:
            ans=l[i]
            jissitu=l[i]
    print(l[0],ans)
resolve()

Measured memory_bytes: 62704
program main
      implicit none
      integer(4) :: n, i
      integer(8), allocatable :: a(:)
      integer(8), allocatable :: tmpi(:), tmpj(:)
      integer(8) :: cnt

      read *, n
      allocate( a(n) )
      read *, a

      allocate(tmpi(n))
      allocate(tmpj(n))
      tmpi(:) = 0
      tmpj(:) = 0

      do i = 1, n
        if ( i + a(i) < n+1 ) then
          tmpi(i+a(i)) = tmpi(i+a(i)) + 1
        end if
        if ( i - a(i) > 0 ) then
          tmpj(i-a(i)) = tmpj(i-a(i)) + 1
        end if
      end do


      cnt = 0
      do i = 1, n
        cnt = cnt + tmpi(i) * tmpj(i)
      end do

      print *, cnt
      
end program main


Measured memory_bytes: 7820
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <queue>
#include <stack>
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
using namespace std;
typedef long long ll;
typedef pair<ll,ll> P;
typedef double db;

#define fr first
#define sc second
#define pb push_back
#define rep(i,x) for(ll i=0;i<x;i++)
#define rep1(i,x) for(ll i=1;i<=x;i++)
#define rrep(i,x) for(ll i=x-1;i>=0;i--)
#define rrep1(i,x) for(ll i=x;i>0;i--)

ll n;
ll bar[101][4];

ll gcd(ll a,ll b){
	if(b==0) return a;
	return gcd(b,a%b);
}
ll dp[101];
ll rec(ll x){
	if(dp[x]) return dp[x];
	ll lef=1,rig=1;
	if(bar[x][2]!=0) lef=rec(bar[x][2]);
	if(bar[x][3]!=0) rig=rec(bar[x][3]);
	ll div=gcd(bar[x][0],bar[x][1]);
	bar[x][0]/=div;
	bar[x][1]/=div;
	div=gcd(lef,rig);
	ll a=bar[x][1]*(rig/div);
	ll b=bar[x][0]*(lef/div);
	div=gcd(a,b);
	a/=div;
	b/=div;
	return dp[x]=a*lef+b*rig;
}

int main()
{while(1){
	memset(dp,0,sizeof(dp));
	ll ans=0;
	cin>>n;
	if(!n) return 0;
	rep1(i,n){
		rep(j,4) cin>>bar[i][j];
	}
	rep1(i,n){
		ans=max(ans,rec(i));
	}
	cout<<ans<<endl;
}}

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


def main():
    import numpy as np

    n = int(input())
    a = np.array([int(ai) for ai in input().split()])
    mod = 10 ** 9 + 7
    ans = 0

    # KeyInsight:
    # XORを取る操作で各ビットは干渉しないため，それぞれ独立として扱ってよい
    # XORが1となるのは，Ai != Aj，つまり0と1の組み合わせを求めることと同じ

    # See:
    # https://qiita.com/ZhangChaoran/items/0d59eb5c95cd9414801d
    for i in range(60):
        count = np.count_nonzero(a & 1)
        ans += (2 ** i) * (n - count) * count
        a >>= 1

    print(ans % mod)


if __name__ == '__main__':
    main()


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

using namespace std;

#define MAX 10000
#define INFTY (1 << 29)

class DisjointSet {
  public:
    vector<int> rank, p;

    DisjointSet() {}
    DisjointSet(int size) {
      rank.resize(size, 0);
      p.resize(size, 0);
      for( int i = 0; i < size; i++ ) makeSet(i);
    }

    void makeSet(int x) {
      p[x] = x;
      rank[x] = 0;
    }

    bool same(int x, int y) {
      return findSet(x) == findSet(y);
    }

    void unite(int x, int y) {
      link(findSet(x), findSet(y));
    }

    void link(int x, int y) {
      if ( rank[x] > rank[y] ) {
        p[y] = x;
      } else {
        p[x] = y;
        if ( rank [x] == rank[y] )
          rank[y]++;
      }
    }

    int findSet(int x) {
      if ( x != p[x] )
        p[x] = findSet(p[x]);
      return p[x];
    }
};

class Edge {
  public:
  int source, target, cost;
  Edge(int source = 0, int target = 0, int cost = 0):
  source(source), target(target), cost(cost) {}
  bool operator < ( const Edge &e ) const {
    return cost < e.cost;
  }
};

int kruskal(int N, vector<Edge> edges) {
  int totalCost = 0;
  sort(edges.begin(), edges.end());

  DisjointSet dset = DisjointSet(N + 1);

  for ( int i = 0; i < N; i++ ) dset.makeSet(i);

  int source, target;
  for ( int i = 0; i < edges.size(); i++ ) {
    Edge e = edges[i];
    if ( !dset.same( e.source, e.target ) ) {
      totalCost += e.cost;
      dset.unite( e.source, e.target );
    }
  }
  return totalCost;
}


int main() {
  int N, M, cost;
  int source, target;

  cin >> N >> M;

  vector<Edge> edges;
  for ( int i = 0; i < M; i++ ) {
    cin >> source >> target >>  cost;
    edges.push_back(Edge(source, target, cost));
  }

  cout << kruskal(N, edges) << endl;

  return 0;
}


Measured memory_bytes: 5400
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int[] num = new int[3];
		for(int i = 0;i < 3;++i)
			num[i] = sc.nextInt();
		sc.close();
		
		int max = 0, sum = 0;
		for(int i = 0;i < 3;++i) {
			sum += num[i];
			if(max < num[i])
				max = num[i];
		}
		if(sum%2 == 0 && sum/2 == max)
			System.out.println("Yes");
		else
			System.out.println("No");
	}
}


Measured memory_bytes: 22996
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const ll INF = 1LL << 60;
const int MAX = 1000000010;
const ll MOD = 1000000007;

int main() {
    int X, t; cin >> X >> t;
    cout << max(X - t, 0) << endl;
    return 0;
}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#include<unordered_map>
#include<unordered_set>
#pragma warning(disable:4996)
using namespace std;
using ld = long double;
template<class T>
using Table = vector<vector<T>>;
const ld eps = 1e-9;

//// < "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\a.txt" > "D:\D_Download\Visual Studio 2015\Projects\programing_contest_c++\Debug\b.answer"
int main() {
	while (1) {
		int D, E; cin >> D >> E;
		if (!D)break;
		ld ans = 1e9;
		for (int x = 0; x <= D; ++x) {
			const ld y = D - x;
			ld dis = sqrt(y*y + x*x);
			ans = min(ans, abs(dis - E));
		}
		cout <<fixed<<setprecision(22)<< ans << endl;
	}
	return 0;
}

Measured memory_bytes: 3228
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Console = System.Console;

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var r = ReadStringArray();
            Console.WriteLine("A" + r[1].First() + "C");
        }


        private static readonly Func<string> Read = () => Console.ReadLine();
        private static readonly Func<string[]> ReadStringArray = () => Console.ReadLine().Split();
        private static readonly Func<int> ReadInt = () => int.Parse(Console.ReadLine());
        private static readonly Func<long> ReadLong = () => long.Parse(Console.ReadLine());
        private static readonly Func<int[]> ReadIntArray = () => Console.ReadLine().Split().Select(int.Parse).ToArray();
        private static readonly Func<long[]> ReadLongArray = () => Console.ReadLine().Split().Select(long.Parse).ToArray();
        private static readonly Action<string> Cw = str => Console.WriteLine(str);
    }
}

Measured memory_bytes: 13268
#include<cstdio>
#include<iostream>
#include<sstream>
#include<cmath>
#include<algorithm>
#include<map>
#include<set>
#include<list>
#include<vector>
#include<stack>
#include<queue>
#include<string>
#include<iomanip>
#include<fstream>
#include<ctime>
using namespace std;
typedef vector<int> VI;
typedef pair <int,int> ii;
typedef long long LL;
#define pb push_back
const int INF = 2147483647;
const int N = 100005;

int n, tab[N], i;
LL minAkt, maxAkt, c, d;

int main() {
scanf("%d", &n);
for (i=0;i<n;i++) scanf("%d", &tab[i]);
if (tab[n - 1] != 2) {
	printf("-1\n");
	return 0;
}
minAkt = 2;
maxAkt = 2;
for (i = n - 1;i >= 0;i--) {
	c = minAkt % tab[i];
	if (c == 0) d = minAkt; else d = minAkt + (tab[i] - c);
	if (d > maxAkt) {
		printf("-1\n");
		return 0;
	}
	minAkt = d;
	c = maxAkt % tab[i];
	d = maxAkt - c;
	maxAkt = d + (tab[i] - 1);
	//printf("%d %d\n", minAkt, maxAkt);
}
printf("%lld %lld\n", minAkt, maxAkt);
return 0;
}



Measured memory_bytes: 640
N, A = map(int, input().split())
X = list(map(int, input().split()))

dp = [[[0 for k in range(50 * N + 1)] for j in range(N + 1)] for i in range(N + 1)]

for i in range(N):
    dp[i][0][0] = 1

for i in range(N):
    for j in range(N):
        for k in range(50 * N + 1):
            if k - X[i] >= 0:
                dp[i + 1][j + 1][k] += dp[i][j][k - X[i]]
            dp[i + 1][j + 1][k] += dp[i][j + 1][k]

res = 0

for j in range(N + 1):
    for k in range(50 * N + 1):
        if k == j * A:
            res += dp[N][j][k]

print(res)

Measured memory_bytes: 95708
import java.io.*;
import java.util.StringTokenizer;

class Main{

static final PrintWriter out=new PrintWriter(System.out);

public static void main(String[] args) throws IOException{
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));
String line="";
while((line=br.readLine())!=null&&!line.isEmpty()){
int n=Integer.parseInt(line);
int m=Integer.parseInt(br.readLine());
int[] t=new int[m];
int[] p=new int[n];
int[][] sel=new int[m][n];
StringTokenizer st1=new StringTokenizer(br.readLine());
for(int i=0;i<m;i++) t[i]=Integer.parseInt(st1.nextToken());
for(int i=0;i<m;i++){
StringTokenizer st2=new StringTokenizer(br.readLine());
for(int j=0;j<n;j++){
sel[i][j]=Integer.parseInt(st2.nextToken());
}
}
for(int i=0;i<m;i++){
int cnt=n;
for(int j=0;j<n;j++){
if(sel[i][j]==t[i]){
p[j]++;
cnt--;
}
}
p[t[i]-1]+=cnt;
}
for(int i=0;i<n;i++) out.println(p[i]);
out.flush();
}
}
}

Measured memory_bytes: 22268
n = int(input())
A = list(map(int, input().split()))

def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    #divisors.sort(reverse=True)
    return divisors

def main():
    A.sort()
    S = set(A)
    m = max(A)
    X = [0]*(m+1)
    for i in range(1, m+1):
        j = i
        if j not in S:
            continue
        while j <= m:
            X[j] += 1
            j += i
    #print(X)

    D = {}
    for i in range(n):
        if A[i] not in D:
            D[A[i]] = 1
        else:
            D[A[i]] += 1

    ans = 0
    for a in A:
        if X[a] == 1 and D[a] == 1:
            ans += 1
    print(ans)

    #for i in range(m+1):
    #    if X[i] == 1:
            #print(i)

if __name__ == '__main__':
    main()


Measured memory_bytes: 124500
#include <bits/stdc++.h>
#define rep(i, start, end) for (long long i = start; i < end; ++i)
#define srt(x) sort((x).begin(), (x).end());
#define rsrt(x) sort((x).rbegin(), (x).rend());
#define deb(x) cout<<#x<<" = "<<(x)<<" (L"<<LINE<<")"<<endl;
#define vdeb(x) {cout<<#x<<" = { "; rep(i, x.size()) cout<<x[i]<<' '; cout <<'}'<<" (L"<<LINE<<")"<<endl;}
using namespace std;
using ll = long long;
using ld = long double;
using vi = vector<int>;
using vivi = vector<vi>;
using vll = vector<long long>;
using vllvll = vector<vll>;
using vs = vector<string>;
using um = unordered_map<long long, long long>;
const long long INF = 1LL << 60;
const long long MOD = 1e9 + 7;

int main()
{
    string S;
    ll K;
    cin >> K >> S;
    if ((ll)S.size() <= K) {
        cout << S << endl;
    } else {
        string ans(S.begin(), S.begin()+K);
        ans += "...";
        cout << ans << endl;
    }
}

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

int main() {
  int n;
  cin >> n;
  string s;
  cin >> s;
  string a = s.substr(0, n / 2); 
  if(a + a == s){
    cout << "Yes" << endl;
  }else{
    cout << "No" << endl;
  }
  return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
signed main(){
  cin.tie(0);
  ios::sync_with_stdio(0);
  Int n;
  cin>>n;
  vector<Int> as(n),bs(n);
  for(Int i=0;i<n;i++) cin>>as[i]>>bs[i];

  using P = pair<Int, Int>;
  vector<P> vp;
  for(Int i=0;i<n;i++) vp.emplace_back(bs[i],as[i]);
  sort(vp.begin(),vp.end());
  for(Int i=0;i<n;i++) tie(bs[i],as[i])=vp[i];

  Int sum=0;
  for(Int i=0;i<n;i++){
    sum+=as[i];
    if(sum>bs[i]){
      cout<<"No"<<endl;
      return 0;
    }
  }
  cout<<"Yes"<<endl;
  return 0;
}


Measured memory_bytes: 9456
n, k = map(int, input().split())
s = input().strip()

ls = []
left = 0
right = 0
count = 0
while left < n:
    prev = s[left]
    right = left + 1
    while right <= n:
        if right == n:
            ls.append(right - left)
            left = right
            break
        c = s[right]
        if c == prev:
            right += 1
        else:
            ls.append(right - left)
            left = right
            break

m = len(ls)
if m <= 2 * k:
    print(n - 1)
else:
    print(n - m + 2 * k)

Measured memory_bytes: 3956