akhauriyash/Code-Regression huggingface dataset:
#ifndef LOCAL
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#else
#include <iostream>
#include <iomanip> 
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <memory>
#include <cctype>
#include <cstring>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <algorithm>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#endif
using namespace std;
#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; }; sim > rge<c> range(c i, c j) { return rge<c>{i, j}; } sim > auto dud(c* x) -> decltype(cerr << *x, 0); sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; } eni(!=) cerr << boolalpha << i; ris; } eni(==) ris << range(begin(i), end(i)); } sim, class b dor(pair < b, c > d) { ris << "(" << d.first << ", " << d.second << ")"; } sim dor(rge<c> d) { *this << "["; for (auto it = d.b; it != d.e; ++it) *this << ", " + 2 * (it == d.b) << *it; ris << "]"; }
#else
sim dor(const c&) { ris; }
#endif
};
#define imie(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// #include <ext/pb_ds/assoc_container.hpp> 
// #include <ext/pb_ds/tree_policy.hpp> 
// using namespace __gnu_pbds; 
// #define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update> 

template<typename T> void setmax(T& x, T y) {x = max(x, y);}
template<typename T> void setmin(T& x, T y) {x = min(x, y);}
#define fix(a) fixed << setprecision(a)
#define forn(i, n) for (int i = 0; i < int(n); i++)
#define rep(i, a, b) for (int i = int(a); i < int(b); i++)
#define all(V) V.begin(), V.end()
#define rall(V) V.rbegin(), V.rend()
#define len(V) (int)V.size()
#define ll long long
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define endl '\n'

void solve(){
  string s;
  cin >> s;
  int x = 0;
  int y = 0;
  for (auto c: s){
    if (c == '0') x++;
    else y++;
  }
  cout << min(x,y)*2;
}

int main() {
  ios::sync_with_stdio(false);
  // cin.tie(0); cout.tie(0);
  int t = 1;
  // cin >> t;
  forn(i, t){
    solve();
  }
}

/* 

k (k-1) (k-1)

2 6 3
4 6 5
6 6 7
7 7 7

*/

Measured memory_bytes: 3768
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <vector>
using namespace std;
// #include "prettyprint.hpp"
long MOD = 1000000007;

int main() {
  long N, K;
  cin >> N >> K;
  long sN = sqrt(N);
  long dp[K + 5][sN + 5];

  // vector<NumSet> ns;
  vector<long> ns;

  long num = 1;
  while (num <= N) {
    long start = num;
    long next = N / num;
    long end = N / next;
    // ns.push_back({start, end, next});
    ns.push_back(end - start + 1);

    num = end + 1;
    // cout << "start: " << start << endl;
    // cout << "end: " << end << endl;
    // cout << "next: " << next << endl;
  }

  for (long i = 0; i < ns.size(); i++) {
    // dp[1][i] = ns[i].end - ns[i].start + 1;
    dp[1][i] = ns[i];
  }

  for (long i = 2; i <= K; i++) {
    long sum[ns.size()];
    sum[ns.size() - 1] = dp[i - 1][0];
    for (int j = 1; j < ns.size(); j++) {
      sum[ns.size() - 1 - j] = sum[ns.size() - j] + dp[i - 1][j];
    }
    for (long j = 0; j < ns.size(); j++) {
      dp[i][j] = sum[j] * ns[j];
      dp[i][j] %= MOD;
    }
  }

  long sum = 0;
  for (long i = 0; i < ns.size(); i++) {
    sum += dp[K][i];
    sum %= MOD;
  }
  cout << sum << endl;
  return 0;
}

Measured memory_bytes: 26360
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define REP(i,a,b) for (int i = a; i <b; i++)
typedef long long ll;
#define int ll
typedef vector<int> vi;
typedef vector<long long> vl;
typedef pair<int,int> pi;
#define trace(x) cout<<#x<<"="<<x<<"\n";
#define llp 1000000007
#define mod 1000000007

template < typename F, typename S >
ostream& operator << ( ostream& os, const pair< F, S > & p ) {
    return os << "(" << p.first << ", " << p.second << ")";
}

template < typename T >
ostream &operator << ( ostream & os, const vector< T > &v ) {
    os << "{";
    typename vector< T > :: const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "}";
}

template < typename T >
ostream &operator << ( ostream & os, const set< T > &v ) {
    os << "[";
    typename set< T > :: const_iterator it;
    for ( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << *it;
    }
    return os << "]";
}

template < typename F, typename S >
ostream &operator << ( ostream & os, const map< F, S > &v ) {
    os << "[";
    typename map< F , S >::const_iterator it;
    for( it = v.begin(); it != v.end(); it++ ) {
        if( it != v.begin() ) os << ", ";
        os << it -> first << " = " << it -> second ;
    }
    return os << "]";
}

#define deb(x) cerr << #x << " = " << x << endl;


int32_t main(){
	ios::sync_with_stdio(false);
	int n;
	cin>>n;
	string s;
	cin>>s;
	vi a(26);
	a.clear();
	a.resize(26);
	int ans=1;
	for(int i=0;i<s.size();i++){
		a[s[i]-'a']++;
	}
	for(int i=0;i<26;i++){
		ans=(ans*(a[i]+1))%mod;
	}
	ans--;
	if(ans<0){
		ans+=mod;	}

		cout<<ans<<"\n";


	return 0;
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#include<algorithm>
#include<math.h>
using namespace std;
 
template <class T> using V = vector<T>;
 
using ll = long long;
using db = double;
using st = string;
using ch = char;
using vll = V<ll>;
using vpll =V<pair<ll,ll>>;
using vst = V<st>;
using vdb = V<db>;
using vch = V<ch>;
 
 
#define FOR(i,a,b) for(ll i=(a);i<(ll)(b);i++)
#define rFOR(i,a,b) for(ll i=(a);i>(ll)(b);i--)
#define oFOR(i,a,b) for(ll i=(a);i<(ll)(b);i+=2)
#define bgn begin()
#define en end()
#define SORT(a) sort((a).bgn,(a).en)
#define REV(a) reverse((a).bgn,(a).en)
#define M(a,b) max(a,b)
#define rM(a,b) min(a,b)
#define fi first
#define se second
#define sz size()
#define gcd(a,b) __gcd(a,b)
#define co(a) cout<<a<<endl;
#define ci(a) cin>>a;
 
 
ll sum(ll n) {
  ll m=0;
  FOR(i,0,20){
    m+=n%10;
    n/=10;
    if(n==0){
      break;
    }
  }
  return m;
}
 
 
ll combi(ll n,ll m) {
  ll ans=1;
  rFOR(i,n,n-m){
    ans*=i;
  }
  FOR(i,1,m+1){
    ans/=i;
  }
  return ans;
}
 
 
ll lcm(ll a,ll b){
  ll n;
  n=a/gcd(a,b)*b;
  return n;
}
 
 
/****************************************\
| Thank you for viewing my code:)        |
| Written by RedSpica a.k.a. RanseMirage |
| Twitter:@asakaakasaka                  | 
\****************************************/
 
 
signed main() {
  ll n;
  	ci(n);
  FOR(i,0,10){
    if(pow(2,i)>n) {
      co(pow(2,i-1))
         break;
         }
                      }
         }

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
const int N = 1e5 + 10;
using ll = long long;
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	string a, b;
	cin >> a >> b;
	cout << b + a;
}


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

bool check( string s , string t)
{
    for( int i=0;i<s.length() ;i++)
    {
        if( s[i] != t[i] && s[i] != '?' )
            return false;
    }
    return true;
}
int main()
{
   string s,t;
   cin>>s>>t;

   bool found = false;
   for( int  i=s.length() - t.length();i>= 0 ;i--)
   {
       string temp = s.substr(i , t.length() );
        if( check(temp , t  ) )
        {
            for(int j=0;j<t.length() ;j++)
            {
                s[j+i] = t[j];
            }
            found = true;
            break;
        }
   }
   if( found )
   {
       for(unsigned int i=0;i<s.length() ;i++)
       {
           if( s[i] =='?')
               s[i] = 'a';
       }
       cout<<s;
   } else cout<<"UNRESTORABLE";
}

Measured memory_bytes: 3544
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}

fn min(a: &i64, b: &i64) -> i64 {
    if *a <= 0i64 {
        *b
    } else if *b <= 0i64 {
        *a
    } else if *a < *b {
        *a
    } else {
        *b
    }
}

fn max(a: &i64, b: &i64) -> i64 {
    if *a < *b {
        *b
    } else {
        *a
    }
}

fn abs(a: &i64, b: &i64) -> i64 {
    if *a - *b <= 0 {
        *b - *a
    } else {
        *a - *b
    }
}

fn main() {
    input! {
        n: chars
    }
    print!("{}", if n[0] == '7' || n[1] == '7' || n[2] == '7' {"Yes".to_string()} else {"No".to_string()})
}


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

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

    std::vector<int> h(n);
    for(int i = 0; i < n; ++i){
        std::cin >> h.at(i);
    }
    
    std::vector<int> vari(n - 1);
    for(int i = n - 1; i > 0; --i){
        if(h.at(i) < h.at(i - 1)){
            h.at(i - 1) -= 1;
            vari.at(i - 1) = h.at(i) - h.at(i - 1);
        }
    }

    std::string ans = "Yes";
    if(0 < std::count_if(vari.begin(), vari.end(), [](int a){return a < 0;})){
        ans = "No";
    }

    std::cout << ans << std::endl;

    return 0;
}

Measured memory_bytes: 1024
import math
from functools import reduce
def gcd_list(numbers):
    return reduce(math.gcd, numbers)
k =int(input())
ans1=0
ans2=0
ans3=0
ans=0
p=[0,0,0]
if k==1:
    print(k)
    exit()
for i in range(1,k+1):
    ans1+=i
for a in range(2,k+1):
    for b in range(1,k+1):
        if a<b:
            continue
        for c in range(1,k+1):
            if b<c:
                continue
            if a==b and b==c:
                continue
            p[0]=a
            p[1]=b
            p[2]=c
            if a==b or b==c:
                ans2+=gcd_list(p)
            else:
                ans3+=gcd_list(p)
ans=ans1+ans2*3+ans3*6
print(ans)

Measured memory_bytes: 9656
H, W = map(int, input().split())
arr = []

for _ in range(H):
  s = input()
  if '#' in s:
    arr.append(s)

j = 0
while len(arr[0]) > j:
  if '#' not in [arr[i][j] for i in range(len(arr))]:
    for i in range(len(arr)):
      arr[i] = arr[i][:j] + arr[i][(j+1):]
  else:
    j += 1

for s in arr:
  print(s)

Measured memory_bytes: 3064
from collections import deque


def main():
    input()
    (edges := deque()).append(
        (friendliness := deque(sorted(int(x) for x in input().split()))).pop())
    ans = 0
    while friendliness:
        ans += edges.popleft()
        edges.append(popped := friendliness.pop())
        edges.append(popped)
    print(ans)


if __name__ == '__main__':
    main()


Measured memory_bytes: 32600
N = int(input())
names = []
for i in range(N):
    names.append(input())

M,A,R,C,H= 0,0,0,0,0

for i in range(N):
    if names[i][0]=='M':
        M+=1
    elif names[i][0]=='A':
        A+=1
    elif names[i][0]=='R':
        R+=1
    elif names[i][0]=='C':
        C+=1
    elif names[i][0]=='H':
        H+=1

print(M*A*R + M*A*C + M*A*H + M*R*C + M*R*H + M*C*H + A*R*C + A*R*H + A*C*H + R*C*H)

Measured memory_bytes: 9772
#include<bits/stdc++.h>
using namespace std;
#define int long long
signed main(){
  int a,b,c;
  cin>>a;
  while(true){
    c=sqrt(a);
	if(c*c==a){
      b=a;
      break;
    }
    a--;
  }
  cout<<b<<"\n";
}

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

#define ll long long
typedef pair <int, int> ii;
typedef pair <ll, int> lli;
#define ar array
#define pb push_back
#define fi first
#define se second
#define sz size
#define mp make_pair
#define nl '\n'
#define all(x) (x).begin(), (x).end()
#define int_max numeric_limits<int>::max()
#define int_min numeric_limits<int>::min()
#define ll_max numeric_limits<ll>::max()
#define ll_min numeric_limits<ll>::min()

#define sim template < class c
#define ris return * this
#define dor > debug & operator <<
#define eni(x) sim > typename \
  enable_if<sizeof dud<c>(0) x 1, debug&>::type operator<<(c i) {
sim > struct rge { c b, e; };
sim > rge<c> range(c i, c j) { return rge<c>{i, j}; }
sim > auto dud(c* x) -> decltype(cerr << *x, 0);
sim > char dud(...);
struct debug {
#ifdef LOCAL
~debug() { cerr << endl; }
eni(!=) cerr << boolalpha << i; ris; }
eni(==) ris << range(begin(i), end(i)); }
sim, class b dor(pair < b, c > d) {
  ris << "(" << d.first << ", " << d.second << ")";
}
sim dor(rge<c> d) {
  *this << "[";
  for (auto it = d.b; it != d.e; ++it)
    *this << ", " + 2 * (it == d.b) << *it;
  ris << "]";
}
#else
sim dor(const c&) { ris; }
#endif
};
#define im(...) " [" << #__VA_ARGS__ ": " << (__VA_ARGS__) << "] "

// custom sort example
//sort(all(a), [ ]( const auto& c, const auto& d) {
	//if (c.fi.se != d.fi.se) {
		//return c.fi.se < d.fi.se; // lower first
	//}
	//if (c.fi.fi != d.fi.fi) {
		//return c.fi.fi > d.fi.fi; // higher first
	//}
	//return c.se > d.se; // higher first
//});

struct chash {
    static uint64_t splitmix64(uint64_t x) {
        // http://xorshift.di.unimi.it/splitmix64.c
        x += 0x9e3779b97f4a7c15;
        x = (x ^ (x >> 30)) * 0xbf58476d1ce4e5b9;
        x = (x ^ (x >> 27)) * 0x94d049bb133111eb;
        return x ^ (x >> 31);
    }

    size_t operator()(uint64_t x) const {
        static const uint64_t FIXED_RANDOM = chrono::steady_clock::now().time_since_epoch().count();
        return splitmix64(x + FIXED_RANDOM);
    }
};

template <class T>
auto lbf(const std::set<std::pair<T, T>>& s, T first)
{
   static constexpr T min = std::numeric_limits<T>::min();

   return s.lower_bound({first, min});
}

int MOD = 1000000007;

ll pw(ll n, ll k) {
	ll r = 1;
	for(; k; k >>= 1) {
		if(k&1) r = r * n % MOD;
		n = n * n % MOD;
	}
	return r;
}
ll inv(ll n) { return pw(n, MOD-2); }

int main () {
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	#ifdef LOCAL
		freopen("input.txt", "r", stdin);
	#endif
	int a, b, c;
	cin >> a >> b >> c;
	cout << b / c - a / c + (a % c == 0 ? 1 : 0) << nl;
}


Measured memory_bytes: 3580
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
using ll = long long;

#define rep(i, n) for (ll i = 0; i < ll(n); i++)
#define repd(i, n) for (ll i = n - 1; i >= 0; i--)
#define all(x) x.begin(), x.end()

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

    int a;
    cin >> a;
    
    cout << a * (1 + a + (int)pow(a, 2)) << endl;
}

Measured memory_bytes: 3500
#import numpy as np
import sys, math
from itertools import permutations, combinations
from collections import defaultdict, Counter, deque
from math import factorial#, gcd
from bisect import bisect_left #bisect_left(list, value)
sys.setrecursionlimit(10**7)
enu = enumerate
MOD = 10**9+7
def input(): return sys.stdin.readline()[:-1]
pl = lambda x: print(*x, sep='\n')

T = input()

res = ''
for i, t in enu(T):
    if t=='?':
        res += 'D'
    else:
        res += t

print(res)


Measured memory_bytes: 9764
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bitset>
#include<set>
#include<map>
#include<stack>
#include<queue>
#include<deque>
#include<list>
#include<iomanip>
#include<cmath>
#include<cstring>
#include<functional>
#include<cstdio>
#include<cstdlib>
using namespace std;

#define repr(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rep(i, n) repr(i, 0, n)
#define INF 2e9
#define MOD 1000000007
//#define MOD 998244353
#define LINF (long long)4e18
#define jck 3.141592

const double EPS = 1e-10;

using ll = long long;
using Pi = pair<int,int>;
using Pl = pair<ll,ll>;

ll modpow(ll a, ll n, ll m){
    if(n == 0) return 1;
    ll half = modpow(a,n/2,m);
    ll res = half * half % m;
    if(n & 1) res = res * (a%m) % m;
    return res;
}


int main(){
    int n,k; cin >> n >> k;
    vector<ll> ans(k+1);
    ll ans2 = 0;
    for(int i = k; i >= 1; i--){
        int now = k/i;
        ans[i] += modpow(now,n,MOD);
        ans[i] %= MOD;
        ans2 += ans[i]*i%MOD;
        ans2 %= MOD;
        for(int j = i+i; j <= k; j += i){
            ans2 -= ans[j]*i%MOD;
            ans[i] -= ans[j];
            ans2 %= MOD;
            ans[i] %= MOD;
            if(ans2 < 0) ans2 += MOD;
            if(ans[i] < 0) ans[i] += MOD;
        }
    }
    cout << ans2 << endl;
}


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

int main(){
	long long N;
	map<string, long long> memo;
	cin >> N;
	for(long long i = 0; i < N; i++) {
		string tmp;
		cin >> tmp;
		memo[tmp]++;
	}

	cout << "AC x " << memo["AC"] << endl;
	cout << "WA x " << memo["WA"] << endl;
	cout << "TLE x " << memo["TLE"] << endl;
	cout << "RE x " << memo["RE"] << endl;

}

Measured memory_bytes: 3640
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#define rep(i, n) for(int i = 0; i < (int)(n); ++i)
#define REP(i, n) for(int i = 1; i < (int)(n); ++i)
using namespace std;

int main() {
    int n, m, d;
    cin >> n >> m >> d;
    if (d == 0) {
        cout << fixed << setprecision(10) << 1.0 / n * (m - 1) << endl;
    } else {
        cout << fixed << setprecision(10) << 1.0 / n / n * (n - d) * 2 * (m - 1) << endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
int main(){
	int i,j,t,n,ans[4];
for(i=0;i<4;i++){
	scanf("%d%d",&t,&n);
	if(t==1){
		ans[i]=n * 6000;
	}
	if(t==2){
		ans[i]=n * 4000;
	}
	if(t==3){
		ans[i]=n * 3000;
	}
	if(t==4){
		ans[i]=n * 2000;
	}
}
for(i=0;i<4;i++){
	printf("%d\n",ans[i]);
}
return 0;
}

Measured memory_bytes: 600
#include <iostream>
#include <string>

using std::cout;
using std::endl;
using std::cin;
using std::string;
using ll = long long;

int main() {
	// Input
	int N;
	cin >> N;
	int M, A, R, C, H;
	M = A = R = C = H = 0;
	for(int i = 0; i < N; ++i) {
		string name;
		cin >> name;
		switch(name.at(0)) {
		case 'M': ++M;
		break; case 'A': ++A;
		break; case 'R': ++R;
		break; case 'C': ++C;
		break; case 'H': ++H;
		break;
		}
	}
	// Calculation
	ll ma = M * A; ll mr = M * R; ll mc = M * C;
	ll ar = A * R; ll ac = A * C;
	ll rc = R * C;
	ll ans = ma * (R + C + H); ans += mr * (C + H); ans += mc * H;
	ans += ar * (C + H); ans += ac * H;
	ans += rc * H;
	// Output
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
import numpy as np

n = int(input())

d = list(map(int,input().split()))

m = int(input())

t = list(map(int,input().split()))


pd = {}
sd = {}

for i in range(n):
    if d[i] in pd:
        pd[d[i]] += 1
    else:
        pd[d[i]] = 1

for i in range(m):
    if t[i] in sd:
        sd[t[i]] += 1
    else:
        sd[t[i]] = 1


flag = True
for s in sd.keys():
    if s in pd:
        if sd[s] <= pd[s]:
            continue
        else:
            flag = False
    else:
        flag = False

if flag:
    print("YES")
else:
    print("NO")






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

#define rep(i,x,y) for(ll i=(x);i<(y);i++)
#define rrep(i,x,y) for(ll i=(ll)(y)-1;i>=(x);i--)
#define all(x) (x).begin(),(x).end()
#ifdef LOCAL
#define dump(x)  cerr << #x << " = " << (x) << endl
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl
#define dassert(...) assert(__VA_ARGS__)
#else
#define dump(x)
#define debug(x)
#define dassert(...)
#endif
//#define int long long

typedef long long ll;
const ll MOD = 1e9 + 7;
const long double EPS = 1e-8;

void solve(std::string S){
    rep(i,0,(S.size()-1)/2) {
        if (S[i] != S[(S.size()-1)/2 - i - 1]) {
            cout << "No" << endl;
            return;
        }
    }
    rep(i,(S.size()+3)/2 - 1,S.size()) {
        if (S[i] != S[S.size() - i + (S.size()+3)/2 - 2]) {
            cout << "No" << endl;
            return;
        }
    }
    rep(i,0,S.size()) {
        if (S[i] != S[S.size() - i - 1]) {
            cout << "No" << endl;
            return;
        }
    }
    cout << "Yes" << endl;
}

signed main(){
    // ios_base::sync_with_stdio(false);
    // cin.tie(NULL);
    std::string S;
    std::cin >> S;
    solve(S);
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <math.h>
#include <map>
#include <string.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;


int main()
{
//回答が整数の場合
int ans=0;
//整数値の入力
int n,m,i;
cin >> n >> m;
//行列の入力
int table[m]={};
for (int i = 0; i < m; ++i) {
    cin >> table[i];
}

sort(table, table + m);
int table1[m-1]={};

for(i=0;i<m-1;++i){
    table1[i]=table[i+1]-table[i];
}
sort(table1, table1 + (m-1));
for(i=0;i<m-n;++i){
    ans=ans+table1[i];
}


//回答
cout << ans << endl;
return 0;
}

Measured memory_bytes: 1024
'use strict;'
function main() {
  const input = require("fs").readFileSync("/dev/stdin", "utf-8").trim();
  const lines = input.split('\n');
  const totalNum = lines[0].split(' ')[0];
  const dislikeNum = lines[1].split(' ');
  const likeNum = [];
  for(var i = 0; i < 10; i++) {
    if(inArray(dislikeNum, i)) {
      likeNum.push(i + '');
    }
  }
  var res = totalNum;
  while(1) {
   var noMatch = false;
   for(var i = 0; i < res.length; i++) {
     if(dislikeNum.indexOf(res[i]) > -1) {
       res = parseInt(res) + 1;
       res = res + '';
       noMatch = true;
       break;
     }
   }
   if(!noMatch) {
     break;
   }
  }
  console.log(res);
  // const res = getResult(totalNum, likeNum);
  // if(res.flag) {
  //   console.log(likeNum[0] === '0' ? likeNum[1] + res.str : likeNum[0] + res.str);
  // } else {
  //   console.log(res.str);
  // }
}

function inArray(arr, data) {
  for( var i = 0; i < arr.length; i++ ) {
    if(arr[i] == data) {
      return true
    } else {
      return false
    }
  }
  return false;
}

// function getResult(sourceNum, likeNum) {
//   const item = sourceNum[0];
//   const resObj = sourceNum.length - 1 ? getResult(sourceNum.slice(1), likeNum) : {};
//   const resStr = resObj.str || '';
//   const flag = resObj.flag;
//   if(!flag) {
//     if(likeNum.indexOf(item) > -1) {
//       return {
//         str: item + resStr,
//         flag: false
//       };
//     } else {
//       const bigger = getBigger(likeNum, item);
//       if(bigger) {
//         let str = '';
//         for(let i = 0; i < resStr.length; i++) {
//           str += likeNum[0];
//         }
//         return {
//           str: bigger + str,
//           flag: false
//         };
//       } else {
//         let str = '';
//         for(let i = 0; i < resStr.length; i++) {
//           str += likeNum[0];
//         }
//         return {
//           str: likeNum[0] + str,
//           flag: true
//         };
//       }
//     }
//   } else {
//     const bigger = getBigger(likeNum, item);
//     if(bigger) {
//       let str = '';
//       for(let i = 0; i < resStr.length; i++) {
//         str += likeNum[0];
//       }
//       return {
//         str: bigger + str,
//         flag: false
//       };
//     } else {
//       let str = '';
//       for(let i = 0; i < resStr.length; i++) {
//         str += likeNum[0];
//       }
//       return {
//         str: likeNum[0] + str,
//         flag: true
//       };
//     }
//   }
// }

// function getBigger(arr, num) {
//   for(let i = 0; i < arr.length; i++) {
//     if(arr[i] > num) {
//       return arr[i] + ''
//     }
//   }
//   return null;
// }

main();


Measured memory_bytes: 10512
// Bismillahir Rahmanir Rahim
// AtCoder-b

#include<bits/stdc++.h>
using namespace std;
long long sum = 0;

int main(){
	int n,m,num;
	cin>>n>>m;
	for(int i = 0; i < m; ++i)
	  cin>>num,sum += num;
	  
	  if(n < sum)
	  cout<<-1<<endl;
	  else cout<<n - sum<< endl;
	return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <vector>
#include <queue>
#include <stack>
#include <cmath>

using namespace std;

const int MAXN = 200000 + 1000;
const int MAXK = 20;


int n, p[MAXN];
pair<int, int> rmq[MAXN][MAXK];
vector<int> ans;

pair<int, int> query(int l, int r)
{
	if((r - l + 1) & 1) r++;
	// cerr << l << ' '<< r << endl;
	int k = log2(r - l + 1);
	// cerr << k << endl;
	return min(rmq[l][k], rmq[r - (1 << k) + 1][k]);
}

struct State
{
	pair<int, int> v;
	int l, r;
	State(int _l = 0, int _r = 0) : v(query(_l, _r)), l(_l), r(_r)
	{}
	bool operator < (const State &s) const
	{
		return v > s.v;
	}
};
priority_queue<State> pq;

int main()
{
	ios::sync_with_stdio(false);
	// freopen("1.in", "r", stdin);
	// freopen("1.out", "w", stdout);

	cin >> n;
	for(int i = 0; i < n; i++)
		cin >> p[i];
	for(int i = 0; i < n; i++)
		rmq[i][0] = rmq[i][1] = make_pair(p[i], i);
	for(int j = 2; j < MAXK; j++)
		for(int i = 0; i + (1 << (j - 1)) < n; i++)
			rmq[i][j] = min(rmq[i][j - 1], rmq[i + (1 << (j - 1))][j - 1]);

	pq.push(State(0, n - 1));

	while(!pq.empty())
	{
		State s = pq.top();
		pq.pop();
		int p0 = s.v.second, l = s.l, r = s.r;
		int p1 = query(p0 + 1, r).second;
		ans.push_back(p[p0]);
		ans.push_back(p[p1]);
		if(l <= p0 - 1) pq.push(State(l, p0 - 1));
		if(p0 + 1 <= p1 - 1) pq.push(State(p0 + 1, p1 - 1));
		if(p1 + 1 <= r)	pq.push(State(p1 + 1, r));
	}
	for(int i = 0; i < n; i++)
		cout << ans[i] << ' ';
	cout << endl;

	return 0;
}


Measured memory_bytes: 35188
// lcmとかはg++ -std=c++17 default.cppみたいなかんじで
//vector<vector<ll>> piyo(tate,vector<ll> (yoko));

#include <bits/stdc++.h>
#define mod 1000000007
#define INF 1000000000
#define ll long long
#define ln cout<<endl;
#define Yes cout<<"Yes"<<endl;
#define No cout<<"No"<<endl;
#define double long double
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define rep(i,n) REP(i,0,n)
using namespace std;

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

    ll a,b,c,d,m,n,maxi=0,f=0,mini=INF,sum=0;
    string str1,str2;
    cin>>n;
    vector<ll> v(n);
    rep(i,n)cin>>v[i];
    vector<pair<ll,ll>> p(n);
    rep(i,n) p[i]=make_pair(v[i],1+i);
    sort(p.begin(),p.end());
    rep(i,n) cout<<p[i].second<<" ";
}


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

#define EOSET -1
#define NOTMEMBER -2

int comp( const void *c1, const void *c2 )
{
  int tmp1 = *(int *)c1;
  int tmp2 = *(int *)c2;

  if( tmp1 < tmp2 )  return -1;
  if( tmp1 == tmp2 ) return  0;
  if( tmp1 > tmp2 )  return  1;
}

void rmdup(int x[]){
  int  i,j,d;  
  for(i=0; x[i] != EOSET; i++){
    for(j=i+1;  x[j]  !=  EOSET; j++){   
      if(x[j]  ==  x[i]){x[j] = NOTMEMBER;}
    }
  }
  d = 0; 
  for(i=0; x[i] != EOSET; i++){
    if(x[i]  ==  NOTMEMBER){d++;}
    else{ 
      if(d > 0){ 
        x[i-d] = x[i];
      }
    }
  }
  x[i-d] = x[i]; 
} 
int main(){
  int numbera[100]={0};
  int numberb[100]={0};
  int a,b,k;
  scanf("%d %d %d", &a,&b,&k);
  //printf("%d\n",a);
  //printf("%d\n",b);
  //printf("%d\n",k);
  
  for(int i=0;i<k;i++){
    if(a+i<=b){
      numbera[i]=a+i;
    }
    if(a<=b-i){
      numberb[i]=b-i;
    }
  }
  int numberc[201]={0};
  for(int j=0;j<100;j++){
    numberc[j]=numbera[j];
  }
  for(int l=0;l<100;l++){
    numberc[l+100]=numberb[l];
  }
  numberc[200]=EOSET;
   // for(int t=0;t<200;t++){
   // printf("%d\n",numberc[t]);
    
  //}
  
  rmdup(numberc);
  qsort(numberc, 200, sizeof(int), comp );
  
  int buffer=0;
  //printf("%s\n", S);
  for(int t=0;t<200;t++){
    if(1<=numberc[t]){
      if(numberc[t]!=buffer){
      printf("%d\n",numberc[t]);}
      buffer=numberc[t];
    }
  }
  return 0;
}

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

typedef int ll;
typedef vector<ll> v1;
typedef vector<vector<ll>> graph;

const ll INF = 1 << 29;
ll n,m,p;
ll a[5001];
ll b[5001];
ll c[5001];
ll idx=0;
graph g;
graph rg;
graph cost;
ll dist[2501];
bool is_update;
v1 vis;
v1 mem;

void rdfs(ll x){
    vis[x] = 1;
    ll siz = rg[x].size();
    for(ll y : rg[x]){
        if(vis[y] == 0) rdfs(y);
    }
}

void dfs(ll x){
    // if(vis[x]) return;
    vis[x] = 1;
    ll siz = g[x].size();
    for(ll i = 0;i < siz;i++){
        if(mem[g[x][i]]){
            if(vis[g[x][i]] == 0) dfs(g[x][i]);
            a[idx] = x;
            b[idx] = g[x][i];
            c[idx] = cost[x][i];
            idx++;
        }
    }
}

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cin >> n >> m >> p;
    g = graph(n+1);
    rg = graph(n+1);
    cost = graph(n+1);
    for(ll i = 0;i < m;i++){
        ll a,b,c;
        cin >> a >> b >> c;
        rg[b].push_back(a);
        g[a].push_back(b);
        cost[a].push_back(c-p);
    }
    vis = v1(n+1,0);
    rdfs(n);
    mem = vis;
    vis = v1(n+1,0);
    dfs(1);
    for(ll i = 0;i <= 2500;i++){
        dist[i] = -INF;
    }

    dist[1] = 0;
    for(ll i = 0;i < n;i++){
        for(ll j = 0;j < idx;j++){
            dist[b[j]] = max(dist[b[j]],dist[a[j]]+c[j]);
        }
    }
    for(ll j = 0;j < idx;j++){
        if(dist[b[j]] < dist[a[j]]+c[j]) is_update = true;
    }
    if(is_update) cout << -1 << endl;
    else cout << max(dist[n],0) << endl;

    return 0;
}


Measured memory_bytes: 896
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
vector<int>adj[100001];
int dp[100001];
bool visited[100001];
int dist[100001];

int dfs(int src)
{
  if(dp[src]!=0)
  {
    return dp[src];
  }

  if(adj[src].size()==0)
  {
    dp[src]=0;
    visited[src]=true;
    return 0;
  }

 if(visited[src]==false)
 {
   visited[src]=true;
   for(int i=0;i<adj[src].size();i++)
   {
     // if(visited[adj[src][i]]==false)
     // {
     //   dp[src]=max(1+dfs(adj[src][i]),dp[adj[src][i]]);
     // }
     // else{
     //   dp[src]=max(dfs(adj[src][i]),dp[adj[src][i]]+1);
     //   //return dp[src]+1;
     // }
     dp[src]=max(1+dfs(adj[src][i]),dp[src]);

   }

 }
  //cout<<"src "<<src<<" dp[src] "<<dp[src]<<endl;

 //dp[src]=dp[src]+1;
return dp[src];
}


int main()
{
  int n,m;
  cin>>n>>m;
  //bool visited[n+1];
  memset(visited,0,sizeof(visited));
  memset(dp,0,sizeof(dp));
  memset(dist,0,sizeof(dist));
  for(int i=1;i<=n;i++)
  {
    visited[i]=false;
  }

  for(int i=0;i<m;i++)
  {
    int a,b;
    cin>>a>>b;
    adj[a].push_back(b);
  }


  for(int i=1;i<=n;i++)
  {
    if(visited[i]==false)
    {
      int k =dfs(i);
    }

  }

  //cout<<" distances of all nodes "<<endl;
  int final=0;
  for(int i=1;i<=n;i++)
  {
    //cout<<i<<" "<<dp[i]<<endl;
    final=max(final,dp[i]);
  }
  cout<<final<<endl;



}


Measured memory_bytes: 11968
import bisect
N = int(input())
A = sorted(list(map(int, input().split())))
B = sorted(list(map(int, input().split())))
C = sorted(list(map(int, input().split())))
ali = [0] * (N+1)
bli = [N - bisect.bisect_left(C,B[i]+1) for i in range(N)]
for i in range(N):
    ali[i+1] = ali[i] + bli[i]
print(sum([ali[N]-ali[bisect.bisect_left(B,A[i]+1)] for i in range(N)]))

Measured memory_bytes: 28636
import sys
import socket

hostname = socket.gethostname()

if hostname == 'F451C':
    sys.stdin = open('b1.in')


def read_int_list():
    return list(map(int, input().split()))


def read_str_list():
    return input().split()


def read_int():
    return int(input())


def read_str():
    return input()


def main():
    N = read_int()
    S = read_str()
    res = S.count('ABC')
    print(res)


main()


Measured memory_bytes: 3700
#include<stdio.h>
#include<stdlib.h>
struct crystal
{
	long long x;
	long long h;
	long long t;
}mon[200005];
int inc(const void *a, const void *b)
{
    struct crystal m = *(struct crystal *)a;
    struct crystal n = *(struct crystal *)b;
    if(m.x<n.x)return -1;
    else return 1;
}
int erfen(long long x,int n)
{
    int l=0,r=n,mid=(r+l)/2;
    while(l<r)
    {
        mid=(r+l)/2;
        if(mon[mid].x>x)r=mid;
        else l=mid;
        if(r==l+1)return l;
    }
    return -1;
}
int main()
{
    int n,a;
	long long d,sum=0,kill;
    scanf("%d%lld%d",&n,&d,&a);
    for(int i=0;i<n;i++)scanf("%lld%lld",&mon[i].x,&mon[i].h);
    qsort(mon,n,sizeof(struct crystal),inc);
    mon[0].t=mon[0].h;
    for(int i=1;i<n;i++)mon[i].t=mon[i].h-mon[i-1].h;
    int l,r;
    for(int i=0;i<n;i++)
    {
    	if(mon[i].t<=0)mon[i+1].t+=mon[i].t;
    	else
        {
            l=i;
            r=erfen(mon[i].x+2*d,n)+1;
            if(mon[l].t%a==0)kill=mon[l].t/a;
            else kill=mon[l].t/a+1;
            sum+=kill;
            mon[r].t+=kill*a;
            mon[l].t-=kill*a;
            mon[i+1].t+=mon[i].t;
        }
	}
    printf("%lld\n",sum);
}

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

// template {{{  0 
// using {{{ 1
using ll = long long int;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vii = vector<pii>;
using vll = vector<pll>;
// }}} 1
// definition {{{ 1
// scaning {{{ 2
#define Scd(x) scanf("%d", &x)
#define Scd2(x,y) scanf("%d%d", &x, &y)
#define Scd3(x,y,z) scanf("%d%d%d", &x, &y, &z)
#define Scll(x) scanf("%lld", &x)
#define Scll2(x,y) scanf("%lld%lld", &x, &y)
#define Scll3(x,y,z) scanf("%lld%lld%lld", &x, &y, &z)
#define Scc(c) scanf("%c", &c);
#define Scs(s) scanf("%s", s);
#define Scstr(s) scanf("%s", &s);
// }}} 2
// constants {{{ 2
#define EPS (1e-7)
#define INF (2e9)
#define PI (acos(-1))
// }}} 2
// systems {{{ 2
#define Repe(x,y,z) for(ll x = z; x < y; x++)
#define Rep(x,y) Repe(x,y,0)
#define RRepe(x,y,z) for(ll x = y-z-1; x >= 0; x--)
#define RRep(x,y) RRepe(x,y,0)
// }}} 2
// output {{{ 2
#define YesNo(a) (a)?printf("Yes\n"):printf("No\n")
#define YESNO(a) (a)?printf("YES\n"):printf("NO\n")
// }}} 2
// }}} 1
// input {{{ 1
// }}} 1
// }}} 0

int main() {

    int N;
    Scd(N);

    int sign = 0;
    ll ans = 0;
    ll mi = INF;

    ll a;
    Rep(i,N){
        Scll(a);
        sign ^= (a<0);
        a = abs(a);
        ans += a;
        mi = min( mi, a );
    }

    printf ("%lld\n", ans - ( sign ? mi*2 : 0 ) );


    return 0;
}





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

#define  ll long long int
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define si(a) a.size()
#define p pair< ll,ll >
#define v vector< ll >
#define vi vector<p>
#define mem(tabl,i) memset(tabl, i, sizeof(tabl))
#define sp(x,y) fixed<<setprecision(y)<<lf(x)
#define debug(c) cout << #c << " = " << c << endl;
#define  f(i,a,b) for(int i=a;i<b;i++)
#define fe(i,a,b) for(int i=a;i<=b;i++)
#define Mod 1000000007

const int N = 1e5 + 5;

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

           string s;
           ll n,k,b,c,x,y,z;
           ll counter=0,counter1=0,counter2=0;
           ll sum=0,result=0,ans=0, flag=0;
           cin>>n>>k>>b;
           swap(n,k);
           swap(n,b);
           cout<<n<<" "<<k<<" "<<b<<endl;

}



Measured memory_bytes: 256
n, m = gets.split.map(&:to_i)
regs = []
m.times do
  s, c = gets.split.map(&:to_i)
  regs << [s-1, c.to_s]
end

(0..999).each do |i|
  str = i.to_s
  next if str.length != n

  if regs.all? { |reg| str[reg[0]] == reg[1] }
    puts str
    exit 0
  end
end
puts '-1'

Measured memory_bytes: 1788
#include<bits/stdc++.h>
using namespace std;
int main(){
    long n;
    cin >> n;
    int summ = 0;
    set<int>sets;
    int i=1;
    while(summ < n){
        summ += i;
        sets.insert(i);
        i++;
    }
    if(summ > n){
        sets.erase(summ-n);
    }
    for(int j:sets){
        cout<<j<<endl;
    }
}

Measured memory_bytes: 3764
#include <iostream>
#include <vector>
#include<list>
#include <algorithm>
#include <string>
#include <math.h>
#include<map>
#include <utility>
#include <cstring>
#include <iomanip>
#include<queue>
#include<set>

using namespace std;
#define REP(i,k,n) for(int i=k;i<n;i++)
 
#define INF 1000000000
typedef long long  ll;

#define MOD 1000000007

int N,M;
vector<vector<int> > e;
vector<bool> used;
vector<int> ans;

void dfs(int s){
  ans.push_back(s+1);
  used[s] = true;
  REP(i,0,e[s].size()){
    int v = e[s][i];
    if(!used[v])
      return dfs(v);
  }
  return;
}

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

  e.resize(N);
  int count[N];
  REP(i,0,N){
    count[i] = 0;
  }
  REP(i, 0, M)
  {
    int a, b;
    cin >> a >> b;
    a--;
    b--;
    count[a]++;
    count[b]++;
  }
  REP(i,0,N){
    if(count[i]%2==1){
      cout << "NO" << endl;
      return 0;
    }
  }
  cout << "YES" << endl;
      return 0;
}


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

int main(){
    int n,k,ans = 0,move1 = 0,move2 = 0,movemin=0;
    cin >> n >> k;
    vector<int>x(n);
    for(int i=0;i<n;i++){
        cin >> x.at(i);
    }
    for(int i=0;i<n;i++){
        move1 = 2 * x.at(i);
        move2 = 2 * (k - x.at(i));
        movemin = min(move1,move2);
        ans += movemin;
    }
    cout << ans << endl;
    return 0;
}

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

using namespace std;

using ll = long long;
using P = pair<ll, ll>;
using Graph = vector<vector<ll>>;
#define rep(i, n) for(ll i=0;i<(ll)(n);i++)
#define rep2(i, m, n) for(ll i=m;i<(ll)(n);i++)
#define rrep(i, n, m) for(ll i=n;i>=(ll)(m);i--)
const int dx[4] = {1, 0, -1, 0};
const int dy[4] = {0, 1, 0, -1};
const int ddx[8] = {0, 1, 1, 1, 0, -1, -1, -1};
const int ddy[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll MOD = 1000000007;
const ll INF = 1000000000000000000L;
#ifdef __DEBUG

/**
 * For DEBUG
 * https://github.com/ta7uw/cpp-pyprint
 */
#include "cpp-pyprint/pyprint.h"

#endif

void Main() {
    ll N, M;
    cin >> N >> M;
    cout << (N == M ? "Yes" : "No") << '\n';
}

int main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    Main();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define ALL(a)  (a).begin(),(a).end()
#define SUM(a)  accumulate((a).begin(),(a).end(),0)
#define SORT(a) sort(ALL(a))
#define REV(a) reverse(ALL(a))
#define dump(x)  cerr << #x << " = " << (x) << endl;
typedef long long ll;
const int INTINF = 1<<30;
const ll LLINF = 1LL<<62;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;
const int DX[8]={ 0, 1, 0,-1, 1, 1,-1,-1};
const int DY[8]={ 1, 0,-1, 0, 1,-1, 1,-1};


int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n;
  cin >> n;
  ll ans = 1;
  REP(i,n){
      ans *= (i+1);
      ans %= MOD;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256
#include <iostream>
#include <cstdlib>
#include <algorithm>
#include <stack>
//逆ポーランド記法で与えられた数式の計算結果を出力してください。
using namespace std;

int mypop();
stack<int> s;
int main(){
	string x;
	while(cin >> x){
		switch(x[0]){
			case '+':
				{
				int a = mypop();
				int b = mypop();
				s.push(b + a);
				break;
				}
			case '-':
				{
				int a = mypop();
				int b = mypop();
				s.push(b - a);
				break;
				}
			case '*':
				{
				int a = mypop();
				int b = mypop();
				s.push(b * a);
				break;
				}
			case '/':
				{
				int a = mypop();
				int b = mypop();
				s.push(b / a);
				break;
				}
			default:
				s.push(stoi(x));
				break;
		}
	}
	cout << s.top() << endl;
}
int mypop(){
	int a = s.top();
	s.pop();
	return a;
}



Measured memory_bytes: 3164
#include <iostream>
#include <climits>
#include <math.h>
#include <algorithm>

using namespace std;

int main() {
    long long N, a, b, c, d, e;
    cin >> N >> a >> b >> c >> d >> e;

    long long x = min({ a, b, c, d, e });

    long long ans = N / x + (N % x == 0 ? 0 : 1) + 4;

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

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

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

  vector<int> L(n);
  rep(i,n) cin >> L[i];

  int ans = 0;
  rep(i,n) rep(j,n) rep(k,n){
    if((i<j)&(j<k)){
      int A,B,C;
      A = L[i];
      B = L[j];
      C = L[k];
      if((A+B>C)&(B+C>A)&(C+A>B)&(A!=B)&(B!=C)&(C!=A)) ans++;
    }
    else continue;
  }

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

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

using namespace std;

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

    int wa=0;
        for(int i=0;i<a;i++){
            wa++;
            k--;
            if(k==0){
                cout<<wa<<endl;
                return 0;
            }
        }
    
    for(int i=0;i<b;i++){
       k--;
        if(k==0){
                cout<<wa<<endl;
                return 0;
            }
    }
    for(int i=0;i<c;i++){
            wa--;
            k--;
            if(k==0){
                cout<<wa<<endl;
                return 0;
            }
        }
    

}



Measured memory_bytes: 3636
#include <iostream>
#include <cstring>
#include <cstdlib>
#include <set>
#include <vector>
#include <map>
#include <cstdio>
#include <utility>
#include <algorithm>
#include <cmath>
#include <queue>
#include <stack>
#include <cassert>
#include <climits>
using namespace std;
typedef long long ll;
#define DEBUG
#ifdef DEBUG
	#define debug printf
#else
	#define debug(...)
#endif
int main(int argc, char const *argv[])
{
	string s;
	cin>>s;
	if(int(s.size()) == 2)
	{
		cout<<s<<endl;
	}
	else
	{
		reverse(s.begin(),s.end());
		cout<<s<<endl;
	}
	return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define _GLIBCXX_DEBUG
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using ld = long double;
#define rep2(i, s, n) for (int i = (s); i < (int)(n); i++)
#define rep3(i, n) for (int i = 1; i < (int)(n+1); i++)
#define rep4(i, s, n) for (int i = (s); i < (int)(n+1); i++)
#define repr(i,n) for (int i = (n-1); i>=0;i--)
#define repr2(i,s,n) for (int i = (n-1); i>=(int)(s);i--)
#define repr3(i,n) for(int i = (n);i>0;i--)
#define stlen(s) ll s.size()-1
#define all(v) v.begin(), v.end()
#define cout(n) cout<<std::fixed<<std::setprecision(n)
using Graph = vector<vector<int>>;
using Grid = vector<vector<int>>;
const ll INF = 10011032323450010;
const ld PI = 3.14159265358979323846;



int main() {
     
    int N,M,sum=0;
    cin>>N>>M;
    int A[103];
    rep(i,N){
        cin>>A[i];
        sum+=A[i];
    }
    sort(A,A+N);
    reverse(A,A+N);
    if(A[M-1]<(double)sum/(4*M)){
        cout<<"No"<<endl;
    }
    else{
        cout<<"Yes"<<endl;
    }

    

return 0;
}


Measured memory_bytes: 3564
(defun split (str delim)
  (let ((res (make-array 1 :element-type 'string
                           :fill-pointer 0
                           :adjustable t)))
    (loop for i from 0 below (length str)
          with start = 0
          when (eq (char str i) delim)
          do (vector-push-extend (subseq str start i) res)
             (setf start (1+ i))
          finally (let ((tail (subseq str start)))
                    (when tail
                      (vector-push-extend tail res))))
    res))


(let* ((aopb (split (read-line) #\Space))
       (a (parse-integer (aref aopb 0)))
       (op (char (aref aopb 1) 0))
       (b (parse-integer (aref aopb 2))))
  (if (eq op #\+)
      (format t "~A~%" (+ a b))
      (format t "~A~%" (- a b))))

Measured memory_bytes: 12388
#include<stdio.h>

int main(){
    int n,i,a,min=1000000,max=-1000000;
    long int sum=0;
    scanf("%d",&n);
    for(i=0;i<n;i++){
          scanf("%d",&a);
          if(min>a){min=a;}
          if(max<a){max=a;}
          sum+=a;
          }
    printf("%d %d %lld\n",min,max,sum);
    return 0;
    }


Measured memory_bytes: 2120
# coding=UTF-8
from collections import deque
from operator import itemgetter
from bisect import bisect_left, bisect
import itertools
import sys
import math
import numpy as np
import time
sys.setrecursionlimit(10**6)
input = sys.stdin.readline


def main():
    x, n = map(int, input().split())
    p = list(map(int, input().split()))
    if n == 0 or x not in p:
        print(x)
    else:
        for i in range(200):
            num1 = x-i
            num2 = x+i
            if num1 not in p and num2 not in p:
                print(min(num1, num2))
                break
            elif num1 not in p:
                print(num1)
                break
            elif num2 not in p:
                print(num2)
                break


if __name__ == '__main__':
    main()


Measured memory_bytes: 27124
S = str(input())
T = str(input())

result =0
index = 0
Min = len(T)

while True:
    sum = 0
    temp = S[index : index + len(T)]
    
    for i in range (len(T)):
        if temp[i] != T[i]:
            sum+=1
    
    Min = min(Min,sum)
    
    index +=1
    
    if index + len(T) >  len(S):
        break
    
print(Min)
    
    
    

Measured memory_bytes: 9060
from collections import deque
a = deque(list(input()))
b = deque(list(input()))
c = deque(list(input()))
dict_p = {"a":a, "b":b, "c": c}
next = "a"
while True:
    if len(dict_p[next]) == 0:
        print(next.upper())
        exit()
    next = dict_p[next].popleft()

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

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

    // middle, final, retest
    int m, f, r, sum = 0;
    while (true) {
        cin >> m >> f >> r;
        sum = m + f;
        if (m == -1 && f == -1 && r == -1)
            break;

        // when absence from middle or final
        if (m == -1 || f == -1) {
            cout << "F" << endl;
        } else if (sum >= 80) {
            cout << "A" << endl;
        } else if (65 <= sum && sum < 80) {
            cout << "B" << endl;
        } else if (50 <= sum && sum < 65) {
            cout << "C" << endl;
        } else if (30 <= sum && sum < 50) {
            if (50 <= r) {
                cout << "C" << endl;
            } else {
                cout << "D" << endl;
            }
        } else if (sum < 30) {
            cout << "F" << endl;
        }
    }
}


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

int main() {
  int X, H;
  cin >> X;
  H = 0;
  
  // 嬉しさ 500円玉 1000、5円玉 5  
  
  H = X / 500 * 1000;
    
  if ((X % 500) != 0) {
    H = H + ((X % 500) / 5 * 5);
  }
  
  cout << H;
    
}

Measured memory_bytes: 256