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

//type
#define ll long long
typedef pair<int, int> P;
//定数
#define INF 1000000000000 //10^12:∞
#define MOD 1000000007    //10^9+7:合同式の法
#define MAXR 100000       //10^5:配列の最大のrange
//略記
#define PB push_back //挿入
#define MP make_pair //pairのコンストラクタ
#define F first      //pairの一つ目の要素
#define S second     //pairの二つ目の要素
#define Z class
// OTHER
// xの二乗を返す (関数テンプレート版)
template <typename T>
T square(T x) { return x * x; }
#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))
// loop
#define rep(i, n) for (int i = 0; i < (n); i++)
#define REPD(i, n) for (ll i = n - 1; i >= 0; i--)
#define FOR(i, a, b) for (ll i = a; i <= ll(b); i++)
#define FORD(i, a, b) for (ll i = a; i >= ll(b); i--)
#define FORA(i, I) for (const auto &i : I)

// vector
#define ALL(x) x.begin(), x.end()

// output
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define isYES(x) printf("%s\n", (x) ? "YES" : "NO")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define ln cout << '\n'
template <Z A>
void pr(A a)
{
  cout << a;
  ln;
}
template <Z A, Z B>
void pr(A a, B b)
{
  cout << a << ' ';
  pr(b);
}

int ans = 0;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *

int main()
{
  int a,b; cin>> a >> b;
  pr(max(max(a+b,a-b),a*b));
  return 0;
}


Measured memory_bytes: 3612
#pragma GCC optimize ("O3")
#pragma GCC target ("avx")
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define chmin(x, y) x = min(x, y)
#define chmax(x, y) x = max(x, y)
#define Would
#define you
#define please


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


	int N;
	cin >> N;

	co((N + 1) / 2);


	Would you please return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace __gnu_pbds;
 
#define watch(x) cout<<(#x)<<"="<<(x)<<'\n'
#define mset(d,val) memset(d,val,sizeof(d))
#define setp(x) cout<<fixed<<setprecision(x)
#define forn(i,a,b) for(int i=a;i<b;i++)
#define fore(i,a,b) for(int i=a;i<=b;i++)
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define INF ll(1e18)
#define MOD 998244353
#define pqueue priority_queue
#define fbo find_by_order
#define ook order_of_key
typedef long long ll;
typedef pair<ll,ll> ii;
typedef vector<ll> vi;
typedef vector<ii> vii;
typedef long double ld;
typedef tree<ll, null_type, less<ll>, rb_tree_tag, tree_order_statistics_node_update> pbds;
 
#define MAXN 1000000007
 
 
int main() {
	ll h,w;
	cin>>h>>w;
	while (h+w) {
		for (ll i=0;i<h;i++) {
			for (ll j=0;j<w;j++) {
				cout<<"#";
			}
			cout<<endl;
		}
		cout<<endl;
		cin>>h>>w;
	}
	
	
}



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

int main() {
  int n, x;
  std::cin >> n >> x;

  std::vector<int> l_array;
  for (size_t i = 0; i < n; ++i) {
    int li;
    std::cin >> li;
    l_array.push_back(li);
  }

  std::vector<int> d_array;
  d_array.push_back(0);
  for (auto l_i : l_array) {
    const int di_1 = d_array.back();
    d_array.push_back(di_1 + l_i);
  }

  size_t count = 0;
  for (auto d_i : d_array) {
    if (d_i <= x) {
      count++;
    } else {
      break;
    }
  }

  std::cout << count << std::endl;
  return 0;
}


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

using namespace std ;
#define ll long long int

int  powe( ll a , ll b )
{
    if(b==0)
    return 1 ; 
    ll k = powe(a , b/2) ; 
    ll ans = (k*k)%2019 ; 
    if(b%2!=0)
    ans =(ans *a)%2019 ; 
    
    return ans ; 
}
string  s ;
int main()
{

    cin>>s ;
if(s.empty())
{

    cout<<0 ;
    return 0  ;
}



ll pas =  0;
unordered_map<ll ,ll > arr ; 
ll count = 0 ; 
for( ll i = s.length()-1 ;i>=0 ;i--)
{
    ll no = s[i]-'0' ; 
    no = (no*powe(10, s.length()-i-1) ) %2019 ; 
    no+= pas ; 
    no = no%2019 ; 
    if(arr.find(no)==arr.end())
    arr[no] = 0; 
    
    count+= arr[no] ;  
    
    arr[no]++ ; 
    
    
    if(no==0)
    count++ ; 
    pas= no ; 
    
    
    
}

cout << count ; 




}

Measured memory_bytes: 3740
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
vector<int> a(100000);
vector<int> b(100000);
vector<int> c(100000);
int n;
vector<ll> ab(100000);
vector<ll> bc(100000);
vector<ll> abc(100000);

int main(){
  cin >> n;
  for(int i=0;i<n;i++){
    cin >> a.at(i);
  }
  for(int i=0;i<n;i++){
    cin >> b.at(i);
  }
  for(int i=0;i<n;i++){
    cin >> c.at(i);
  }
  sort(a.begin(),a.begin()+n);
  sort(b.begin(),b.begin()+n);
  sort(c.begin(),c.begin()+n);
  for(int i=0;i<n;i++){
    int b_=b.at(i);
    auto it = lower_bound(a.begin(),a.begin()+n,b_);
    int index=it - a.begin();
    ab.at(i)=index;
    //cout << index<<endl;
  }
  for(int i=0;i<n;i++){
    int c_=c.at(i);
    auto it = lower_bound(b.begin(),b.begin()+n,c_);
    int index=it - b.begin();
    bc.at(i)=index;
    //cout << index << endl;
  }
  for(int i=0;i<n-1;i++){
    ll ab_=ab.at(i);
    ab.at(i+1)=ab.at(i+1)+ab_;
    //cout << ab.at(i+1) << endl;
  }
  ll ans=0;
  for(int i=0;i<n;i++){
    ll bc_=bc.at(i);
    if(bc_>0) ans += ab.at(bc_-1);
  }
  cout << ans << endl;
}

Measured memory_bytes: 3712
S = input()
if S[0]!='A':
  print('WA')
else:
  i = 2
  count = 0
  while i < len(S)-1:
  	if S[i] == 'C':
      		count += 1
  	i += 1
  if count != 1:
    print('WA')
  else:
    S = S.replace('A','').replace('C','')
    if S.islower() == False:
      print('WA')
    else:
      print('AC')


Measured memory_bytes: 3060
/*
	Author: zhaodeyin
	Time: 2018.3.25
*/
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <cstdio>
#include <algorithm>
#include <iostream>
using namespace std;
int main(){
	int a,b,c,d;
	cin>>a>>b>>c>>d;
	cout<<min(a,b)+min(c,d)<<endl;
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int a, b; cin >> a >> b;
  if(a == 1) a += 13;
  if(b == 1) b += 13;
  if(a < b) cout << "Bob" << endl;
  else if(a > b) cout << "Alice" << endl;
  else cout << "Draw" << endl;
  return 0;
}

Measured memory_bytes: 256
using System;

class Program
{
    static void Main(string[] args)
    {
        int n500 = int.Parse(Console.ReadLine());
        int n100 = int.Parse(Console.ReadLine());
        int n50 = int.Parse(Console.ReadLine());

        int sum = int.Parse(Console.ReadLine());

        if (sum > (n500 * 500) + (n100 * 100) + (n50 * 50))
        {
            Console.WriteLine("0");
            return;
        }

        int remainderDivIn100 = (sum % 100) / 50;
        if (remainderDivIn100 > n100 + (n50 / 2))
        {
            Console.WriteLine("0");
            return;
        }

        int remainderDivIn50 = (sum % 100) / 50;
        if (remainderDivIn50 >= 1)
        {
            if (n50 >= 1)
            {
                sum -= 50;
                n50 -= 1;
            }
            else
            {
                Console.WriteLine("0");
                return;
            }
        }

        int solutionNum = 0;
        for (int i = 0;i <= n500 ; i++) {
            int sumMinus500i = sum - (500 * i);

            if (sumMinus500i > (n100 * 100 + n50 * 50) || 0 > sumMinus500i)
            {
                continue;
            }
            else
            {
                for (int j = 0; j <= n100; j++)
                {
                    int sumMinus100j = sumMinus500i - (100 * j);

                    if (sumMinus100j > (n50 * 50) || 0 > sumMinus100j)
                    {
                        continue;
                    }
                    else
                    {
                        solutionNum++;
                    }
                }
            } 
        }

        Console.WriteLine(solutionNum.ToString());
    }
}

Measured memory_bytes: 11092
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <queue>
#include <stack>
#include <vector>
#include <algorithm>
#include <map>
#include <set>
#include <deque>

int main(){
  int N, M;
  scanf("%d", &N);
  scanf("%d", &M);
  std::vector<std::vector<char > > A(N, std::vector<char > (N));
  std::vector<std::vector<char > > B(M, std::vector<char > (M));
  for (int i=0; i<N; i++){
    std::string s;
    std::cin >> s;
    for (int j=0; j<N; j++){
      A[i][j]=s[j];
    }
  }
  for (int i=0; i<M; i++){
    std::string s;
    std::cin >> s;
    for (int j=0; j<M; j++){
      B[i][j]=s[j];
    }
  }

  bool ans = false;
  for (int i=0; i<=N-M; i++){
    for (int j=0; j<=N-M; j++){
      bool ok=true;
      for (int k=0; k<M; k++){
        for (int l=0; l<M; l++){
          if (A[k+i][l+j]!=B[k][l]){
            ok=false;
            break;
          }
        }
      }
      ans |= ok;
    }
  }
  printf("%s\n",ans?"Yes":"No");
  return 0;
}


Measured memory_bytes: 888
#include<stdio.h>
#include<stdlib.h>
#include<string.h>


int top = 0;
int S[1000];


void push(int x);
int pop();

void push(int x)
{
	top++;
	S[top] = x;

}
int pop()
{
	top--;
	return S[top+1];

}

int main(void)
{
	int a, b;
	top=0;
	char s[100];
	
	while( scanf("%s", s) != EOF)
	{
	
		if( s[0] == '+')
		{
			a = pop();
			b = pop();
			push(a + b);
		}
		else if( s[0] == '-')
		{
			a = pop();
			b = pop();
			push(b - a);
		}
		else if( s[0] == '*')
		{
			a = pop();
			b = pop();
			push(a * b);
		}
		else
		{
			push(atoi(s));
		}
		
	}
	
	printf("%d\n", pop());
	
	return 0;
	
}





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

const double EPS = 1e-7;

struct Point{
    double x, y;
    Point operator + (Point obj){
        return Point({(x+obj.x), (y+obj.y)});
    }
    Point operator / (double d){
        return Point({x/d, y/d});
    }
    Point operator * (double d){
        return Point({x*d, y*d});
    }
    Point operator - (Point obj){
        return Point({(x-obj.x), (y-obj.y)});
    }
    double norm(){
        return sqrt(x*x + y*y);
    }
    void normalize(){
        double t = norm();
        x /= t, y /= t;
    }
};

double dist(Point a, Point b){
    return sqrt(pow(a.x-b.x,2.0)+pow(a.y-b.y,2.0));
}

vector<Point> v, is;

void getIntersect(int i, int j){
    Point a = v[i], b = v[j];
    Point mid = (a+b)/2.0;
    Point s = mid-a;
    double k = s.norm();
    s.normalize();
    swap(s.x, s.y); s.x *= -1;
    double l = sqrt(1*1 - k*k);
    is.push_back(mid+s*l);
    is.push_back(mid-s*l);
}

int main(){
    int n;
    while(scanf("%d", &n), n){
        v.resize(n);
        is.clear();
        for(int i = 0; i < n; i++){
            scanf("%lf,%lf\n", &v[i].x, &v[i].y);
        }
        for(int i = 0; i < n; i++){
            for(int j = i+1; j < n; j++){
                if(dist(v[i], v[j]) > 2.0)  continue;
                getIntersect(i, j);
            }
        }
        int ans = 1;
        for(Point p : is){
            int tmp = 0;
            for(int j = 0; j < n; j++){
                if(dist(p, v[j]) < 1.0+EPS)    tmp++;
            }
            ans = max(ans, tmp);
        }
        cout << ans << endl;
    }
    return 0;
}


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

int main() {
	
	ios_base::sync_with_stdio(false);

	cin.tie(0);

	string s;

	cin >> s;

	for(int i = 0; i < s.length() - 8; ++i)
		cout << s[i];

	return 0;
}

Measured memory_bytes: 256
//In The Name of Allah
#include <bits/stdc++.h>

using namespace std;

const int N = 1e5 + 10;

vector < int > adj[N];
bool mark[N];
int dp[N];

int dfs(int u)
{
    if (mark[u])
        return dp[u];
    mark[u] = 1;
    int ans = 0;
    for (int v : adj[u])
    {
        if (mark[v])
            ans = max(ans, dp[v] + 1);
        else
        {
            int r = dfs(v);
            ans = max(ans, dp[v] + 1);
        }
    }
    dp[u] = ans;
    return ans;
}

int main()
{
    int n, m, u, v;
    cin >> n >> m;
    for (int i = 0; i < m; i ++)
    {
        cin >> u >> v;
        adj[u].push_back(v);
    }
    fill(dp, dp + N, -1);
    for (int i = 1; i <= n; i ++)
        int r = dfs(i);
    int ans = 0;
    for (int i = 1; i <= n; i ++)
        ans = max(ans, dp[i]);
    cout << ans;
    return 0;
}


Measured memory_bytes: 8192
#include <bits/stdc++.h>
using namespace std;
int main() {
  int n; cin >> n;
  long long rsl=0;
  for(int i=1; i<= n; i++){
  	if(i%3!=0&&i%5!=0)  rsl += i;
  }
  cout << rsl << endl;
}

Measured memory_bytes: 3592
#include<cmath>
#include<algorithm>
#include<iostream>
#include<vector>
#include<climits>
#include<cstdio>
#include<cfloat>

using namespace std;

double EPS = 1e-10;

double add(double a, double b){
  if(abs(a+b) < EPS * (abs(a)+abs(b)))return 0;
  return a+b;
}

struct point{
  double x, y;
  point(){}
  point(double x,double y) : x(x) , y(y){}

  point operator + (point p){
    return point(add(x,p.x), add(y,p.y));
  }

  point operator - (point p){
    return point(add(x,-p.x), add(y,-p.y));
  }

  point operator * (double d){
    return point(x*d,y*d);
  }
};

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

double norm(point a){
  return sqrt(a.x*a.x+a.y*a.y);
}

int main(void){
  double D;
  point p,v;
 
  while(cin >> D,D){
  
    cin >> p.x >> p.y >> v.x >> v.y;
     
    double d=D+1;
    double a=dot(p,v)/norm(p)/norm(v);

    if(abs(1.0 + a) < EPS )d=norm(p);
    else if(abs(1.0 - a) < EPS)d=2.0-norm(p);

    if(d<D || abs(d-D)<EPS)printf("%.8f\n",d);
    else cout << "impossible" << endl;
  }
 
  return 0;
}

Measured memory_bytes: 1272
#include <algorithm>
#include <climits>
#include <complex>
#include <cstring>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <vector>

// using
using namespace std;

// typedef
typedef long long ll;

// define
#define ALL(c) (c).begin(), (c).end()
#define SORT(c) sort(ALL(c))
#define REVERSE(c) reverse(ALL(c))
#define UNIQ(c) unique(ALL(c))
#define FOR(i, a, b, c) for (int i = (int)(a); i < (int)(b); i += (int)(c))
#define REP(i, n) FOR(i, 0, n, 1)
#define RFOR(i, a, b, c) for (int i = (int)(a); i >= (int)(b); i -= (int)(c))
#define RREP(i, n) RFOR(i, n, 0, 1)

// functions
template <class T> T ceil(T a, T b) {
    return (a + b - 1) / b;
}
template <class T> T round(T a, T b) {
    return (a + b / 2) / b;
}
template <class T> T gcd(T a, T b) {
    return b ? gcd(b, a % b) : a;
}
template <class T> T lcm(T a, T b) {
    return a * b / gcd(a, b);
}
template <class T> bool amax(T& a, const T& b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}
template <class T> bool amin(T& a, const T& b) {
    if (b < a) {
        a = b;
        return true;
    }
    return false;
}

// main
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    vector<int> X(3);
    REP(i, 3) {
        cin >> X[i];
    }
    SORT(X);
    int res = X[2] - X[1];
    X[0] += X[2] - X[1], X[1] = X[2];
    if ((X[2] - X[0]) % 2 == 0) {
        res += (X[2] - X[0]) / 2;
    } else {
        res += (X[2] - X[0]) / 2 + 2;
    }
    cout << res << endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <unordered_map>
typedef long long ll;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i == n-1];}
#define printp(x,n) for(ll i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e18)
using namespace std;
const ll MOD = 1e9 + 7;
typedef pair<ll, ll> lpair;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    ll A[100010];
    cin >> N;
    rep(i,0,N) cin >> A[i];
    ll sum = 0;
    rep(i,0,N) sum += A[i];
    ll n = N*(N+1)/2;
    if(sum % n != 0){
        print("NO");
        return 0;
    }
    ll v = sum / n;
    ll cnt4 = 0;
    bool ok = true;
    rep(i,0,N-1){
        ll diff = A[i+1] - A[i];
        if(diff > v){
            ok = false;
        }else if(diff == v){
            continue;
        }else{
            ll v2 = v - diff;
            if(v2 % N != 0){
                ok = false;
            }else{
                cnt4 += v2/N;
            }
        }
    }
    if(!ok){
        print("NO");
    }else{
        if(cnt4 <= v){
            print("YES")
        }else{
            print("NO");

        }
    }



}


Measured memory_bytes: 1024
#include <iostream>
#include <cassert>
#include <climits>
#include <bitset>
#include <stack>
#include <queue>
#include <iomanip>
#include <limits>
#include <string>
#include <cmath>
#include <set>
#include <map>
#include <math.h>
#include <algorithm>
#include <vector>
#include <string.h>
#include <tuple>
#include <time.h>
#include <random>

using namespace std;

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

long long int INF = 3e18;
double Pi = 3.1415926535897932384626;

vector<ll> G[500005];
vector<P> tree[500010];
priority_queue <ll> pql;
priority_queue <P> pqp;
//big priority queue
priority_queue <ll,vector<ll>,greater<ll> > pqls;
priority_queue <P,vector<P>,greater<P> > pqps;
//small priority queue
//top pop

int dx[8]={1,0,-1,0,1,1,-1,-1};
int dy[8]={0,1,0,-1,1,-1,-1,1};
char dir[] = "DRUL";
//ll bit[500005];
//↓,→,↑,←


#define p(x) cout<<x<<endl;
#define el cout<<endl;
#define pe(x) cout<<(x)<<" ";
#define ps(x) cout<<fixed<<setprecision(25)<<x<<endl;
#define pu(x) cout<<(x);
#define pd(x) cerr<<"//"<<(x)<<endl;
#define re(i,n) for(i=0;i<n;i++);
#define pb push_back
#define lb lower_bound
#define ub upper_bound
#define deba(x) cout<< #x << " = " << x <<endl


ll mod = 1000000007;
ll rui(ll number1,ll number2){
    if(number2 == 0){
        return 1;
    }else{
        ll number3 = rui(number1,number2 / 2);
        number3 *= number3;
        number3 %= mod;
        if(number2%2==1){
            number3 *= number1;
            number3 %= mod;
        }
        return number3;
    }
}
ll gcd(ll number1,ll number2){
    if(number1 > number2){
        swap(number1,number2);
    }
    if(number1 == 0 || number1 == number2){
        return number2;
    }else{
        return gcd(number2 % number1,number1);
    }
}
void YES(bool condition){
    if(condition){
        p("YES");
    }else{
        p("NO");
    }
    return;
}
void Yes(bool condition){
    if(condition){
        p("Yes");
    }else{
        p("No");
    }
    return;
}

ll n,m,num,sum,ans,a,b,c,d,e,g,h,w,i,j,k,q,l,r;
ll x[500005],y[500005],z[500005];
ll dp[500005][6],sc[500005][6];
//bool check[5005];
char s[500005],t[500005];
bool flag,dame;

ll  fact[400005];
ll rfact[400005];
void c3_init(){
    fact[0] = rfact[0] = 1;
    for(ll i=1; i<400000; i++){
        fact[i] = (fact[i-1]*i) % mod;
        rfact[i] = rui(fact[i],mod - 2);
    }
}
ll c3(ll n,ll r){
    return (((fact[n] * rfact[r]) % mod) * rfact[n-r]) % mod;
}

int main(){
	cin >> s;
	n = strlen(s);
	ll ans1 = 0,ans2 = 0;
	for(i=0;i<n;i++){
		if(s[i] == '0' && i % 2 == 0)ans1++;
		if(s[i] == '0' && i % 2 == 1)ans2++;
		if(s[i] == '1' && i % 2 == 0)ans2++;
		if(s[i] == '1' && i % 2 == 1)ans1++;
	}
	p(n - max(ans1,ans2));
	return 0;
}

Measured memory_bytes: 25984
import java.io.BufferedReader;
import java.io.InputStreamReader;

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

    public void solve(String[] args) {
        MyScanner scanner = new MyScanner();
        int a = scanner.nextInt();
        System.out.println(a*a*3);



    }

    private static long gcd(long m, long n) {
        if(m < n) return gcd(n, m);
        if(n == 0) return m;
        return gcd(n, m % n);
    }

    private static long lcm(long m, long n) {
        return m * n / gcd(m, n);
    }

    private class MyScanner {
        String[] s;
        int i;
        BufferedReader br;
        String reg = " ";
        MyScanner () {
            s = new String[0];
            i = 0;
            br = new BufferedReader(new InputStreamReader(System.in));
        }
        public String next() {
            try {
                if (i < s.length) return s[i++];
                String line = br.readLine();
                while (line.equals("")) {line = br.readLine();}
                s = line.split(reg, 0);
                i = 0;return s[i++];
            } catch (Exception e) {e.printStackTrace();}
            return null;
        }
        public int nextInt() {
            try {return Integer.parseInt(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public double nextDouble() {
            try {return Double.parseDouble(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
        public long nextLong()  {
            try {return Long.parseLong(next());} catch (Exception e) {e.printStackTrace();}
            return -1;
        }
    }
}


Measured memory_bytes: 23124
import sys
from bisect import bisect_left as bl
input = sys.stdin.readline
N = int(input())
def sieve(n):
    is_prime = [True for _ in range(n+1)]
    is_prime[0] = False

    for i in range(2, n+1):
        if is_prime[i-1]:
            j = 2 * i
            while j <= n:
                is_prime[j-1] = False
                j += i
    table = [ i for i in range(1, n+1) if is_prime[i-1]]
    return is_prime, table
ps = sieve(10 ** 6)
x = bl(ps[1], N)
print(ps[1][x])

Measured memory_bytes: 114544
//INCLUDE
//------------------------------------------
#include <bits/stdc++.h>
//DEFINE
//------------------------------------------
#define ll long long
#define ld long double
#define ALLv(a)  (a).begin(),(a).end()
#define ALL(a,n)  (a),(a)+n
#define vi vector<long long>
#define vd vector<long double>
#define vs vector<string>
//CONST
//------------------------------------------
#define INF 1010000000000000017LL
#define MOD 1000000007LL
#define EPS 1e-12
#define PI 3.14159265358979323846
//REPEAT
//------------------------------------------
#define   FOR(i,m,n) for(ll (i)=(m);   (i)<(n);  (i)++)
#define   REP(i,n)   for(ll (i)=0;     (i)<(n);  (i)++)
#define  REPS(i,x)   for(ll (i)=1;     (i)<=(x); (i)++)
#define  RREP(i,x)   for(ll (i)=(x)-1; (i)>=0;   (i)--)
#define RREPS(i,x)   for(ll (i)=(x);   (i)> 0;   (i)--)
#define  WREP(i,in,j,jn) REP(i,in)REP(j,jn)
//-----------------------------------------
#define ifYN(x) cout<<(x?"Yes":"No")<<"\n" 
#define dcml(n) fixed<<setprecision(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--;return m; } 
ll modPow(ll x,ll n,ll mod=MOD){ 
    return (!n?1:!n%2?modPow(x*x,n/2,mod)%mod:x%mod*modPow(x,n-1,mod)%mod); 
} 
ll GetDigit(ll num){ 
    ll digit=0; 
    while(num!=0){num/=10;digit++;} 
    return digit; 
} 


using namespace std;
//-------------------------------------------
int main(){
  ll N;cin>>N;
  ll d[N];REP(i,N)cin>>d[i];
  ll ans=0;
  REP(i,N-1){
    FOR(j,i+1,N){
      ans+=d[i]*d[j];
    }
  }cout<<ans<<"\n";
}


Measured memory_bytes: 256
from collections import defaultdict
 
N,W = map(int, input().split())
WV = []
for i in range(N):
    WV.append(list(map(int, input().split())))
 
dp = defaultdict(int)
 
dp[0] = 0
 
for w,v in WV:
    for nw, nv in list(dp.items()):
        if nw+w <= W:
            dp[nw+w] = max(dp[nw+w], nv+v)
            
print(max(dp.values()))

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

using ll = long long;
using ull = unsigned long long;
using st = string;
using db = double;
using vll = vector<long long>;
using vvll = vector<vll>;
using vchar = vector<char>;
#define rep(i, m, n) for (int i = (int)(m); i < (int)(n); i++)
#define vrep(vec) for(auto& i : vec)
#define vin(vec) for(auto& i : vec) cin >> i
#define all(v) v.begin(), v.end()
ll mod = 1000000007;

int main(){
  ll a, b, c, x;
  cin >> a >> b >> c >> x;
  ll ans = 0;
  rep(i, 0, a + 1)rep(j, 0, b + 1) rep(k, 0, c + 1){
    if(500 * i + 100 * j + 50 * k == x) ans++;
  }
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		// 整数の入力
		long a = sc.nextLong();
		long b = sc.nextLong();
		long d = a;
		long e = b;
		
		b = Math.min(e, d);
		a = Math.max(e, d);
		d = b;
		while(b != 0){
			b = a % b;
			a = d;
			d = b;
		}
		int c = (int)(Math.pow(a, 0.5) + 1);
		// 文字列の入力
		boolean[] g = new boolean[c];
		for(int i = 0; i < c; i++){
			g[i] = true;
			
		}
		for(int i = 2; i < c; i++){
			if(g[i]){
				for(int j = 2 * i; j < c; j += i){
					g[j] = false;
				}
			}
			
		}
      //System.out.println(c);
		int f = 1;
		for(int i = 2; i < c;i++){
			if(a % i == 0){
				if(g[i]){
					f++;
                  	while(a % i == 0){
                    	a = a / i;
                    }
				}
			}
		}
      
		if(a > 1){
        	f++;
          //System.out.println("000");
        }
		System.out.println(f);
      
      //System.out.println(a);
		
		
	}
}

Measured memory_bytes: 37404
import java.util.*;

public class Main {
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int K = sc.nextInt();
    int[] memo = new int[N+1];
    int ans =0;
    for (int i=0; i<N; i++) {
      memo[0] = 1;
      memo[i+1] = min(memo[i],K);
    }
    System.out.println(memo[N]);
  }
  
  public static int min(int x,int y) {
    return Math.min(x * 2, x + y);  
  }
}

Measured memory_bytes: 22868
import java.util.*;
import java.lang.Math;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    
   	int n = sc.nextInt();
    String shops[] = new String[n];
    String shops2[] = new String[n];
    String names[] = new String[n];
    String points[] = new String[n];
    String[] stack;
    String[] stack2;
    List<Integer> pList;
    Map<String, Integer> rank = new HashMap<String, Integer>();
    int start;
    int end;
    
    for(int i = 0;i < n;i++){
      names[i] = sc.next();
      points[i] = sc.next();
      shops[i] = names[i] + " " + points[i] + " ";
      shops2[i] = shops[i];
      rank.put(names[i] + " " + points[i] + " ",i + 1);
    }
    
    Arrays.sort(shops2);
    
    stack = shops2[0].split(" ");
    names[0] = stack[0];
    pList =  new ArrayList<Integer>();
    pList.add(Integer.parseInt(stack[1]));
    start = 0;
    
    for(int i = 1;i < n; i++) {
      	stack2 = shops2[i].split(" ");
      	names[i] = stack2[0];
    	if(stack[0].equals(stack2[0])){
        	pList.add(Integer.parseInt(stack2[1]));
          	if(i == n - 1){
            	Collections.sort(pList);
          		for(int j = 0; j < i + 1 - start;j++) {
            		points[start + j] = String.valueOf(pList.get(i - start -j));           
                }
            }
        } else {
          Collections.sort(pList);
          for(int j = 0; j < i - start;j++) points[start + j] = String.valueOf(pList.get(i - start -j -1));
          start = i;
          pList =  new ArrayList<Integer>();
          pList.add(Integer.parseInt(stack2[1]));
          if(i == n - 1) points[i] = stack2[1];
        } 
      	stack = stack2;
    }
	
    for(int i = 0;i < n;i++){
      System.out.println(rank.get(names[i] + " " + points[i] + " "));
    }
    
  }
}


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

int main() {
    int X, A, B;
    cin >> X >> A >> B;
    if (B - A > X){
        cout << "dangerous" << endl;
    }else if (B - A > 0){
        cout << "safe" << endl;
    }else{
        cout << "delicious" << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <cstdio>
#include <vector>
#include <algorithm>
#include <queue>
#include <utility>

using namespace std;

template <class T>
using gp_queue=priority_queue<T, deque<T>, less<T>>;

using Weight=long long;
static const Weight INF=1LL<<57;

struct Edge {
    size_t src, dst;
    Weight weight;
    Edge() {}
    Edge(size_t src, size_t dst, Weight weight=1):
        src(src), dst(dst), weight(weight)
    {}
};

bool operator<(const Edge &e, const Edge &f) {
    if (e.weight != f.weight) {
        return e.weight > f.weight;
    } else {
        return e.src!=f.src? e.src<f.src : e.dst<f.dst;
    }
}

using Edges=vector<Edge>;
using Vertex=vector<Edge>;
using Graph=vector<Vertex>;

void join(Graph &g, size_t s, size_t d, Weight w=1) {
    // non-directed
    g[s].push_back(Edge(s, d, w));
    g[d].push_back(Edge(d, s, w));
}

void connect(Graph &g, size_t s, size_t d, Weight w=1) {
    // directed
    g[s].push_back(Edge(s, d, w));
}

vector<vector<Weight>> shortest_distance(Graph &g) {
    /* Johnson */
    size_t V=g.size();
    vector<Weight> h(V);
    for (size_t k=0; k<V; ++k)
        for (size_t i=0; i<V; ++i)
            for (const Edge &e: g[i])
                if (h[e.dst] > h[e.src] + e.weight) {
                    h[e.dst] = h[e.src] + e.weight;
                    if (k == V-1)
                        return vector<vector<Weight>>();
                }

    for (size_t i=0; i<V; ++i)
        for (Edge &e: g[i])
            e.weight += h[e.src] - h[e.dst];

    vector<vector<Weight>> d(V, vector<Weight>(V, INF));
    vector<vector<size_t>> prev(V, vector<size_t>(V, -1));
    for (size_t s=0; s<V; ++s) {
        gp_queue<Edge> q; q.push(Edge(s, s, 0));
        d[s][s] = 0;
        while (!q.empty()) {
            Edge e=q.top(); q.pop();
            if (~prev[s][e.dst]) continue;

            prev[s][e.dst] = e.src;
            for (const Edge &f: g[e.dst]) {
                if (d[s][f.dst] > e.weight + f.weight) {
                    d[s][f.dst] = e.weight + f.weight;
                    q.push(Edge(f.src, f.dst, e.weight+f.weight));
                }
            }
        }
        for (size_t u=0; u<V; ++u)
            if (d[s][u] < INF)
                d[s][u] += h[u] - h[s];
    }

    for (size_t v=0; v<V; ++v)
        for (Edge &e: g[v])
            e.weight += h[e.dst] - h[e.src];

    return d;
}

int main() {
    size_t V, E;
    scanf("%zu %zu", &V, &E);

    Graph g(V);
    for (size_t i=0; i<E; ++i) {
        size_t s, t;
        Weight d;
        scanf("%zu %zu %lld", &s, &t, &d);

        connect(g, s, t, d);
    }

    vector<vector<Weight>> d=shortest_distance(g);
    if (d.empty())
        return !printf("NEGATIVE CYCLE\n");

    for (vector<Weight> w: d)
        for (size_t i=0; i<V; ++i)
            if (w[i] < INF) {
                printf("%lld%c", w[i], i<V-1? ' ':'\n');
            } else {
                printf("INF%c", i<V-1? ' ':'\n');
            }

    return 0;
}

Measured memory_bytes: 3072
#include<stdio.h>
#include<math.h>

char primes[300000];
int main(){
  int i,j,s=sqrt(300000)+1,n,sum;
  primes[0]=primes[1]=1;
  for(i=2;i<s;i++){
    if(primes[i]==0){
      for(j=2*i;j<300000;j+=i) primes[j]=1;
    }
  }
  do{
    scanf("%d",&n);
    if(!n) break;
    for(j=0,i=0,sum=0;i<n;i++){
      while(primes[j]) j++;
      sum+=j;
      j++;
    }
    printf("%d\n",sum);
  }while(1);
  return 0;
}

Measured memory_bytes: 0
n = int(input())
str_list = [input() for _ in range(n)]

AC = 0
WA = 0
TLE = 0
RE = 0

for s in str_list:
    if s == "AC":
        AC += 1
    elif s == "WA":
        WA += 1
    elif s == "TLE":
        TLE += 1
    elif s == "RE":
        RE += 1

print(f"AC x {AC}")
print(f"WA x {WA}")
print(f"TLE x {TLE}")
print(f"RE x {RE}")


Measured memory_bytes: 16332
#include <stdio.h>
#include <algorithm>
#include <assert.h>
#include <bitset>
#include <cmath>
#include <complex>
#include <deque>
#include <functional>
#include <iostream>
#include <limits.h>
#include <map>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string.h>
#include <string>
#include <time.h>
#include <unordered_map>
#include <unordered_set>
#include <vector>

#pragma warning(disable:4996)
#pragma comment(linker, "/STACK:336777216")
using namespace std;

#define mp make_pair
#define all(x) (x).begin(), (x).end()
#define ldb ldouble

typedef tuple<int, int, int> t3;
typedef long long ll;
typedef unsigned long long ull;
typedef double db;
typedef long double ldb;
typedef pair <int, int> pii;
typedef pair <ll, ll> pll;
typedef pair <ll, int> pli;
typedef pair <db, db> pdd;

int IT_MAX = 1 << 20;
ll MOD = 1000000007;
const int INF = 0x3f3f3f3f;
const ll LL_INF = 0x3f3f3f3f3f3f3f3f;
const db PI = acos(-1);
const db ERR = 1e-10;
#define szz(x) (int)(x).size()
#define rep(i, n) for(int i=0;i<n;i++)
#define Se second
#define Fi first

int in[100050];
int main() {
	int mx = 0, i;
	int N, H;
	scanf("%d %d", &N, &H);
	for (i = 1; i <= N; i++) {
		int t1, t2;
		scanf("%d %d", &t1, &in[i]);
		mx = max(mx, t1);
	}
	sort(in + 1, in + N + 1);

	int ans = (H + mx - 1) / mx;
	for (i = 1; i <= N; i++) {
		H = max(0, H - in[N + 1 - i]);
		ans = min(ans, (H + mx - 1) / mx + i);
	}
	return !printf("%d\n", ans);
}
//*/

Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <algorithm>
#include <cmath>
#include <deque>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <iomanip>
#include <bitset>
#include <set>
#include <map>
#include <stdio.h>
#include <numeric>
#include <cstring>

#define rep(i,n) for (int i = 0; i < (n); i++)
#define rep1(i,n) for (int i = 1; i < (n); i++)
#define FOR(i,a,b) for (int i=(a); i < (b); i++)
#define MOD 1000000007 //10^9+7
using namespace std;
using ll = long long;
using PII = pair<int, int>;
const int INF = numeric_limits<int>::max();

// 負の数にも対応した % 演算
long long mod(long long val, long long m) {
    long long res = val % m;
    if (res < 0) res += m;
    return res;
}

//greatest common divisor
long long gcd(ll a, ll b) 
{
    if (a % b == 0) {
        return b;
    } else {
        return gcd(b, a % b);
    }
}

//least common multiple
long long lcm(ll a, ll b)
{
    return a / gcd(a, b) * b ;
}

int main()
{
    ll x, y; cin >> x >> y;
    int i = 0;
    int ans = 0;
    while (x <= y) {
        x *= 2;
        i++;
        ans++;
    }
    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 256
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;

/*
<url:https://arc067.contest.atcoder.jp/tasks/arc067_b>
問題文============================================================
 東西方向にのびる直線上に、N 個の町があります。 町には、西から順に 1 から N までの番号がついています。
 直線上には座標が設定されていて、東に行くほど座標が大きくなります。 町 i の座標は Xi です。
 
 あなたは今、町 1 にいて、これからほかの全ての町を訪れたいです。 移動する手段は次の 2 種類あります。
 
 直線上を歩いて移動する。 東西どちらに歩いても、1 移動する度に疲労度が A 上がります。
 
 好きな場所へテレポートする。 テレポートをすると、移動した距離によらず疲労度が B 上がります。
 
 この 2 種類の移動を繰り返して全ての町を最適に回った時、疲労度の上昇値の合計の最小値がいくつになるか求めてください。
 
=================================================================

解説=============================================================

================================================================
*/
ll solve(){
    ll N,A,B; cin >> N >> A >> B;
    vector<ll> X(N); for(auto &in:X) cin >> in;
    ll res = 0;
    for(int i = 0; i < N-1;i++){
        res += min(A*(X[i+1]-X[i]),B);
    }
    return res;
}
int main(void) {
	cin.tie(0); ios::sync_with_stdio(false);
    cout << solve() << endl;
	return 0;
}


Measured memory_bytes: 1024
#include <bits/stdc++.h>
#define MOD 1000000007
using namespace std;
typedef long long ll;
typedef pair<int, int> P;
typedef tuple<ll, ll, ll> T;

int K, S;

int main(void){
    
    scanf("%d %d", &K, &S);
    
    int ans = 0;
    for(int x = 0; x <= K; ++x){
        for(int y = 0; y <= K; ++y){
            int z = S - x - y;
            if(0 <= z && z <= K) ++ans;
        }
    }
    printf("%d\n", ans);
    
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
//#include <ext/pb_ds/assoc_container.hpp>
//#include <ext/pb_ds/tree_policy.hpp>
//using namespace __gnu_pbds;
using namespace std;
//typedef tree<int, nuint_type, less<int>, rb_tree_tag, tree_order_statistics_node_update> new_data_set; 
#define int long long
#define MOD 1000000007
#define what_is(x) cerr << #x << " is " << x << endl;
#define loop(i,a,n) for(int i=a;i<n;i++)
#define pb emplace_back
#define mp make_pair
#define ff first
#define ss second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, szof(x))
#define sortall(x) sort(aint(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626 
#define fastio() ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
typedef pair<int, int> pt;
//https://tradingeconomics.com/forecast/stock-market

signed main() {

	fastio();
//	#define LOCAL_DEFINE	
	#ifdef LOCAL_DEFINE
		freopen("input.txt","r",stdin);
		freopen("output.txt","w",stdout);
	#endif
	double a,b;
	cin>>a>>b;
	int p=round(a/0.08),q=round(b/0.1);
	//cout<<p<<" "<<q<<endl;
	int m=max(p,q);
	if(floor(m*0.08)==a && floor(m*0.1)==b)
	{
		cout<<m<<endl;
	}else{
		cout<<-1;
	}

	return 0;
}

// https://github.com/FatihSevbanUyanik/Caltech-UCSD-Birds-PyTorch
// https://github.com/zctpig/Caltech-UCSD-Birds-200-2011/blob/master/%E2%80%9C%E2%80%9Cpytorch_caltech_birds_classification_ipynb%E2%80%9D%E7%9A%84%E5%89%AF%E6%9C%AC%E2%80%9D%E7%9A%84%E5%89%AF%E6%9C%AC.ipynb
// https://github.com/vinodjatav/Bird-Identification-using-ResNet50/blob/master/Bird_Identification_ResNet50_final_correct_model.ipynb
// https://github.com/AdrienBenamira/bird_classification_MVAchallenge
// https://www.kaggle.com/c/mva-recvis-2018/leaderboard
// https://github.com/Louis-Verret/mva-pixel2mesh
// https://github.com/bdvllrs/bird-classification-recvis



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

int main() {
    int k;
    cin >> k;
    if(k<=12){
        cout << k << endl;
        return 0;
    }
    queue<ll> que;
    vector<ll> lun;
    rep(i,12){
        que.push(i+1);
        lun.push_back(i+1);
    }
    que.pop();
    int i=12;
    while(i<k){
        ll  t = que.front();
        que.pop();
        if(t%10==0){
            que.push(t*10);
            que.push(t*10+1);
            lun.push_back(t*10);
            lun.push_back(t*10+1);
            i += 2;
        } else if (t%10==9){
            que.push(t*10+8);
            que.push(t*10+9);
            lun.push_back(t*10+8);
            lun.push_back(t*10+9);
            i += 2;
        } else {
            que.push(t*10+(t%10-1));
            que.push(t*10+(t%10));
            que.push(t*10+(t%10+1));
            lun.push_back(t*10+(t%10-1));
            lun.push_back(t*10+(t%10));
            lun.push_back(t*10+(t%10+1));
            i += 3;
        }
    }
    cout << lun[k-1] << endl;
}

Measured memory_bytes: 4576
n,t = map(int,input().split())

dic = {}
for val in range(n):
    c,ti = map(int,input().split())
    if ti <= t:
        dic[c] = ti

if dic == {}:
    print("TLE")
    exit()

# sort
dic = sorted(dic.items() ,key=lambda x:x[0])
print(dic[0][0])


Measured memory_bytes: 38384
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

int main(int argc, char *argv[])
{
    int in, i;
    char line[256];

    for (i=1;; i++) {

        memset(line, 0, sizeof(line));
        if (!fgets(line, sizeof(line), stdin)) {
            fprintf(stderr, "error input val\n");
            return -1;
        }

        if (sscanf(line, "%d", &in) != 1) {
            fprintf(stderr, "error input format\n");
            return -1;
        }

        if (!in) {
            break;
        }
        printf("Case %d: %d\n", i, in);
    }

    return 0;
}

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

from sys import stdin
    
def main():
    a,b,c = [int(x) for x in stdin.readline().rstrip().split()]
    if a < c and c < b:
        print('Yes')
    elif b < c and c < a:
        print('Yes')
    else:
        print('No')

if __name__=='__main__':
    main()

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

int main() {
	// your code goes here
	int a,b,n;
	int sum;
	cin >> n >> a >> b;
	int count=0;
	for(int i=1;i<n+1;i++){
		sum = i/10000+i/1000%10+i/100%10+i/10%10+i%10;
//		cout << "i ga " << i << "notoki " << sum ;
		if((a<=sum)&&(sum<=b)){
			count=count+i;
		} 
//		cout << " count ha " << count << endl;
	}
	cout << count << endl;	
	
	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
 
int main(){ 
int n,s=0;
cin>>n;
vector<int> a(n);
for(int i=0; i<n; i++){
cin>>a[i];
}
sort(a.begin(), a.end());
for(int i=0; i<n; i++){
  if(a[i]==a[i+1]){
  cout<<"NO"<<endl;
    return 0;
  }
}
  cout<<"YES"<<endl;
}

Measured memory_bytes: 1024
#include <iostream>
#include <string>
#include <vector>
#include <math.h>
#include <stdio.h>
#include <algorithm>
#include <cmath>
#include <cstdlib>
#include <stack>
#include <istream>
#include <map>
#include <set>
#include <queue>
#define rep0(i,n) for (int i = 0; i <= (n); ++i)
#define rep1(i,n) for (int i = 1; i <= (n); ++i)
#define REP(a,b) for (int i = a; i <= (b); ++i) 
#define mREP(a,b) for (int i = a; i == (b); --i) 
typedef long long ll;
using namespace std;
int main() {
cin.tie(0);
ios::sync_with_stdio(false);
/*
	　　　  　 ,ﾍ／L──- 、
	　　　   　Lﾆ)r_」=＝= ｲ
	　　 　,ﾍ、i ﾉノλﾉﾊﾉﾍ
	　　   ,'　｀(ﾊﾘ ﾟ ヮﾟﾉi)　',
	　　 .i　　 >〈(つ,i!と)　　i
	　　  vﾍγk´_/___i,ゝﾍノ
	　　　　　 ｀ﾞr_,ｨ_ｧﾞ´
*/
vector<int>a(3);
rep0(i, 2)cin >> a[i];
sort(a.begin(), a.end());
int k;
cin >> k;
rep1(j, k) {
	a[2] *= 2;
}
int sum = a[0] + a[1] + a[2];
cout << sum << endl;
return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#include<string>
#include<vector>
using namespace std;
typedef pair<int, int>P;
typedef long long ll;
#define rep(i,n)for(ll i=0;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll MOD = 1000000007;
const ll INF = 1e16;
const ll MAX_N = 5000100;
//max=({});
//条件式が真ならwhileの中身を回し続ける
//printf("%d\n", ans);

//pairの入力
//vector<pair<ll, ll>>work(n);
//rep(i, n) {
//	ll a, b;
//	cin >> a >> b;
//	work[i] = make_pair(a, b);
//for(auto p:mp)(mapの探索)
//printf("%.10f\n",なんちゃら)
//最大公約数
ll gcd(ll x, ll y) {
	return y ? gcd(y, x % y) : x;
}

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

//組み合わせの余りを求める
ll fac[MAX_N], finv[MAX_N], inv[MAX_N];

void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX_N; 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 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;
}

// a^n mod を計算する
ll modpow(long long a, long long n, long long mod) {
	long long res = 1;
	while (n > 0) {
		if (n & 1) res = res * a % mod;
		a = a * a % mod;
		n >>= 1;
	}
	return res;
}

ll dx[8] = { 0,0,-1,1 };
ll dy[8] = { -1,1,0,0 };

//long longしか使わない
//素数は1より大きい
//main関数以外で配列の宣言の中に変数入れると死ぬ
int main() {
	ll n, k;
	cin >> n >> k;
	vector<ll>s(n + 1);
	rep(i, n + 1) {
		s[i] = i;
	}
	rep(i, n) {
		s[i + 1] += s[i];
	}
	ll ans = 1;
	for (ll i = k;i <= n;++i) {
		ans += s[n] - s[n - i] - s[i - 1] + 1;
		ans = ans % MOD;
	}
	cout << ans << endl;
	return 0;
}


Measured memory_bytes: 4756
import java.util.*;
import static java.lang.System.*;
import java.io.*;

public class Main {
	public static void main(String[] args) {
		FastScanner sc = new FastScanner();
		PrintWriter out = new PrintWriter(System.out);
		int n = sc.nextInt();
		int y = sc.nextInt();
		int[] ans = {-1, -1, -1};
		for(int i = 0; i <= n; i++) {
			for(int j = 0; j <= n; j++) {
				int ten = i;
				int five = j;
				int one = n - (ten + five);
				if (one < 0)  break;
				int value = ten * 10000 + five * 5000 + one * 1000;
				if (value == y) {
					ans[0] = ten;
					ans[1] = five;
					ans[2] = one;
				}				
			}
		}		

		for(int i: ans)
			out.print(i + " ");

		out.close();
	}

	

static class FastScanner {
    private final InputStream in = System.in;
    private final byte[] buffer = new byte[1024];
    private int ptr = 0;
    private int buflen = 0;
    private boolean hasNextByte() {
        if (ptr < buflen) {
            return true;
        }else{
            ptr = 0;
            try {
                buflen = in.read(buffer);
            } catch (IOException e) {
                e.printStackTrace();
            }
            if (buflen <= 0) {
                return false;
            }
        }
        return true;
    }
    private int readByte() { if (hasNextByte()) return buffer[ptr++]; else return -1;}
    private static boolean isPrintableChar(int c) { return 33 <= c && c <= 126;}
    public boolean hasNext() { while(hasNextByte() && !isPrintableChar(buffer[ptr])) ptr++; return hasNextByte();}
    public String next() {
        if (!hasNext()) throw new NoSuchElementException();
        StringBuilder sb = new StringBuilder();
        int b = readByte();
        while(isPrintableChar(b)) {
            sb.appendCodePoint(b);
            b = readByte();
        }
        return sb.toString();
    }
    public long nextLong() {
        if (!hasNext()) throw new NoSuchElementException();
        long n = 0;
        boolean minus = false;
        int b = readByte();
        if (b == '-') {
            minus = true;
            b = readByte();
        }
        if (b < '0' || '9' < b) {
            throw new NumberFormatException();
        }
        while(true){
            if ('0' <= b && b <= '9') {
                n *= 10;
                n += b - '0';
            }else if(b == -1 || !isPrintableChar(b)){
                return minus ? -n : n;
            }else{
                throw new NumberFormatException();
            }
            b = readByte();
        }
    }
    public int nextInt() {
        long nl = nextLong();
        if (nl < Integer.MIN_VALUE || nl > Integer.MAX_VALUE) throw new NumberFormatException();
        return (int) nl;
    }
    public double nextDouble() { return Double.parseDouble(next());}
}
}


Measured memory_bytes: 22868
#include <iostream>
#include <iomanip>
#include <string>
#include <sstream>
#include <bitset>
#include <algorithm>
#include <cmath>
#include <numeric>
#include <utility>
#include <set>
#include <map>
#include <tuple> 
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <list>
using namespace  std;
using ll = long long;
using P = pair<ll, ll>;
#define REP(i, n) for(long long (i)=0, i_bound = (long long)(n); (i)<i_bound; ++i)
#define FOR(i, a, b) for(long long (i)=(a); (i)<(b); ++i)
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend()
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
const long long MOD = static_cast<long long>(1e9) + 7LL;
const long long INF = 1234567891234567890LL;
int main(){
    cin.tie(0);
    cout.sync_with_stdio(false);
    ll N, K;
    ll R, S, P;
    string T;
    cin >> N >> K >> R >> S >> P >> T;
    ll res = 0;
    map<char, char> m;
    map<char, int> sc;
    m['p'] = 's';
    m['s'] = 'r';
    m['r'] = 'p';
    sc['r'] = R;
    sc['s'] = S;
    sc['p'] = P;
    for(int i=0; i<K; i++){
        char pre = '#';
        bool done = false;
        for(int j=0; i+K*j<N; j++){
            if(pre == T[i+K*j] and !done){
                done = true;
                continue;
            }
            pre = T[i+K*j];
            done = false;
            res += sc[m[pre]];
        }
    }
    cout << res << endl;
    return 0;
}

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

int main() {
	string ss;
	cin >> ss;
	int len = ss.length();
	int mid = len/2;
	if (len%2==0){
		mid = (len-2)/2;
	}
	
	while (ss.substr(0,mid)!=ss.substr(mid, mid)){
		mid--;
	}
	cout << mid*2 << endl;
	
	
	
}


Measured memory_bytes: 256