akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
using namespace std;
int main(){
    int A, B, count = 0, num;
    cin >> A >> B;
    for(int i = A; i <= B; i++){
        vector<int> a(5), b(5);
        num = i;
        for(int j = 0; j < 5; j++){
            a[j] = num % 10;
            num /= 10;
        }
        b = a;
        reverse(b.begin(), b.end());
        if(a == b) count++;
    }
    cout << count << endl;
}

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

int main(){
    string s;
    cin >> s;
    int ans = 0;
    string last;

    for(int i = 0; i<s.size(); i++){
        string t;
        t.push_back(s[i]);


        if(t != last){
            last.clear();
            last.push_back(s[i]);
            ans++;
        }

        else{
            last.clear();
            if(i == s.size() - 1){
                cout << ans << endl;
                return 0;
            }

            last.push_back(s[i]);
            last.push_back(s[i + 1]);
            ans++;
            i++;
        }
    }

    cout << ans << endl;

}


Measured memory_bytes: 644
/*
  
  Author: Arnab Sinha
	
  ███████╗██╗  ██╗███████╗██████╗         ██╗      ██████╗  ██████╗██╗  ██╗███████╗██████╗  █████╗  █████╗ 
  ██╔════╝██║  ██║██╔════╝██╔══██╗        ██║     ██╔═══██╗██╔════╝██║ ██╔╝██╔════╝██╔══██╗██╔══██╗██╔══██╗
  ███████╗███████║█████╗  ██████╔╝        ██║     ██║   ██║██║     █████╔╝ █████╗  ██║  ██║╚██████║╚██████║
  ╚════ █║██╔══██║██╔══╝  ██╔══██╗        ██║     ██║   ██║██║     ██╔═██╗ ██╔══╝  ██║  ██║ ╚═══██║ ╚═══██║
  ███████║██║  ██║███████╗██║  ██║███████╗███████╗╚██████╔╝╚██████╗██║  ██╗███████╗██████╔╝ █████╔╝ █████╔╝
  ╚══════╝╚═╝  ╚═╝╚══════╝╚═╝  ╚═╝╚══════╝╚══════╝ ╚═════╝  ╚═════╝╚═╝  ╚═╝╚══════╝╚═════╝  ╚════╝  ╚════╝                                                                                                        
*/
 
#include<bits/stdc++.h>
#define IOS ios::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define li long long int
#define ld long long double
#define all(v) v.begin(),v.end()
#define sort(a) sort(all(a))
#define rev(a) reverse(all(a))
#define pb push_back
#define INF 1e18+10
#define MINF -1e18-10
#define rep(i,a,b) for(li i=a;i<b;i++)
#define vli vector<li>
#define MAXN 1e5+10
using namespace std;
 
li power(li a, li b, li mod) { a%=mod; li ret = 1; while(b){ if(b&1) ret*=a; a*=a;; if(ret>=mod) ret%=mod; if(a>=mod) a%=mod; b>>=1; } return ret; }
 
template <class T> void read(T& x){
	cin>>x;
}
 
template <class T, class... U> void read(T& x, U&... u){
	read(x);
	read(u...);
}
 
template <class A> void read(vector<A>& v){
	for(auto &it:v)
		read(it);
}
 
template <class A> void print(A x){
	cout<<x;
}
 
template <class A> void printl(A x){
	cout<<x<<endl;
}
 
template <class A> void print(vector<A>& v)
{
	for(auto &it:v){
		print(it);
		cout<<' ';
	}
	cout<<'\n';
}
 
void solve()
{
	li n;
	cin>>n;
	li count = 0;
	bool ok = false;
	rep(i,0,n){
		li x,y;
		cin>>x>>y;

		if(count==3){
			cout<<"Yes\n";
			return;
		}
		if(x==y and ok == false){
			ok = true;
			count = 1;
		}
		else if(ok==true and x==y){
			count+=1;
		}
		else if(x!=y){
			ok = false;
			count = 0;
		}
	}

	if(count==3){
		cout<<"Yes\n";
		return;
	}
	else{
		cout<<"No\n";
	}
}

 
int main()
{
	IOS;
 	
 	#ifndef ONLINE_JUDGE
	freopen("input.txt","r",stdin);
	freopen("output.txt","w",stdout);
	#endif

 	solve();
 
	return 0;
}

Measured memory_bytes: 3648
#include <bits/stdc++.h>
#include <cstdlib>
#include <cmath>
#include <algorithm>
using namespace std;
using ll = long long;
using P = pair<ll,ll>;
using Graph= vector<vector<ll>>;
struct edge{ll to ; ll cost ;} ;
using graph =vector<vector<edge>> ;
#define rep(i,n) for (ll i=0; i < (n); ++i)
#define rep2(i,n,m) for(ll i=n;i<=m;i++)
#define rep3(i,n,m) for(ll i=n;i>=m;i--)
#define pb push_back
#define eb emplace_back
#define ppb pop_back
#define mpa make_pair
#define fi first
#define se second 
#define set20 cout<<fixed<<setprecision(20) ;
const ll INF=1e18 ;
inline void chmax(ll& a,ll b){a=max(a,b);}
inline void chmin(ll& a,ll b){a=min(a,b);}
double pi=acos(-1) ;
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;}
 

 int main(){
  ll h,w ; cin>>h>>w ;
  ll n ; cin>>n ;
  vector<ll> A(n) ;
  rep(i,n) cin>>A[i] ;
  ll sum=0 ;
  ll all = h*w ;
  vector<ll> B(all) ;
  rep(i,n){
    ll now= A[i] ;
    rep2(j,sum,sum+A[i]-1){
      B[j]=i+1 ;
    }
    sum+= A[i] ;
  }
  rep(i,h){
    rep(j,w){
      ll ans=0 ;
      if(i%2==0) ans= B[i*w+j] ;
      else ans= B[i*w+(w-1-j)] ;
      if(j==w-1) cout<<ans<<endl ;
      else cout<<ans<<" " ;
    }
  }
  
   return 0 ;
}



Measured memory_bytes: 3716
#include <iostream>
#include <array>
#include <algorithm>
#include <vector>
#include <bitset>
#include <set>
#include <unordered_set>
#include <cmath>
#include <complex>
#include <deque>
#include <iterator>
#include <numeric>
#include <map>
#include <unordered_map>
#include <queue>
#include <stack>
#include <string>
#include <tuple>
#include <utility>
#include <limits>
#include <iomanip>
#include <functional>
#include <cassert>
using namespace std;

using ll=long long;
template<class T> using V = vector<T>;
template<class T, class U> using P = pair<T, U>;
using vll = V<ll>;
using vvll = V<vll>;
#define rep(i, k, n) for (ll i=k; i<(ll)n; ++i)
#define REP(i, n) rep(i, 0, n)
#define ALL(v) v.begin(),v.end()
template < class T > inline bool chmax(T& a, T b) {if (a < b) { a=b; return true; } return false; }
template < class T > inline bool chmin(T& a, T b) {if (a > b) { a=b; return true; } return false; }
#define DEBUG_VLL(vec) REP(sz, vec.size()) std::cerr<<vec[sz]<<(sz==vec.size()-1?'\n':' ');

const long long MOD = 1000000007;
const long long HIGHINF = (long long)1e18;
const int INF = (int)1e9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n, m; cin >> n >> m;
    ll a = (n + 1) / 2, b = (n + 1) / 2 + 1;
    set<ll> dis;
    for (int i = 0; i < m; i++) {
        ll ab1 = b - a - 1, ab2 = n - b + a - 1;
        if (dis.find(ab1) != dis.end() || dis.find(ab2) != dis.end() || ab1 == ab2) {
            a--;
            ab1 = b - a - 1, ab2 = n - b + a - 1;
        }
        dis.insert(ab1), dis.insert(ab2);
        // cout << ab1 << ' ' << ab2 << '\n';
        cout << a << ' ' << b << '\n';
        a--, b++;
    }
    return 0;
}


Measured memory_bytes: 11992
#include <string>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <map>
#include <queue>
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cmath>
#include <ctime>
#include <cstring>
#include <cctype>
#include <cassert>
#include <limits>
#include <functional>
#include <iomanip>
#include <complex>
#include <bitset>
#define rep(i,n) for(int (i)=0;(i)<(int)(n);++(i))
#define rer(i,l,u) for(int (i)=(int)(l);(i)<=(int)(u);++(i))
#define reu(i,l,u) for(int (i)=(int)(l);(i)<(int)(u);++(i))
#if defined(_MSC_VER) || __cplusplus > 199711L
#define aut(r,v) auto r = (v)
#else
#define aut(r,v) __typeof(v) r = (v)
#endif
#define each(it,o) for(aut(it, (o).begin()); it != (o).end(); ++ it)
#define all(o) (o).begin(), (o).end()
#define pb(x) push_back(x)
#define mp(x,y) make_pair((x),(y))
#define mset(m,v) memset(m,v,sizeof(m))
#define INF 0x3f3f3f3f3f3f3f3fLL
#define SIZE 200010

using namespace std;
typedef vector<int> vi; typedef pair<int, int> pii; typedef vector<pair<int, int> > vpii; typedef long long ll;
typedef pair<int,ll> pill; typedef pair<ll,int> plli; 
typedef pair<double, int> pdi;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }
typedef complex<double> P;
long long int MOD = 1000000007;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main(){
	string str;
	cin>>str;
	int n=str.size();
	int ans=n;
	for(int i=1;i<str.size();i++){
		if(str[i]!=str[i-1]){
			ans=min(ans,max(i,n-i));
		}
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 512
using System;
using System.Linq;
using System.Collections.Generic;
class ProgramE
    {
        static void Main(string[] args)
        {
            
            //入力
            string[] input = Console.ReadLine().Split(' ');
            int h = int.Parse(input[0]);
            int n = int.Parse(input[1]);
            int INF = 100000000;
            long sum = 1;
            
            int[] a = new int[n];
            int[] b = new int[n];
            int[] dp = new int[h + 10000];


            //値を代入する
            for(int i = 0;i < n;i++)
            {
                string[] input2 = Console.ReadLine().Split(' ');
                a[i] = int.Parse(input2[0]);
                b[i] = int.Parse(input2[1]);
            }


            for(int i = 0;i <= h;i++)
                dp[i] = INF;

            int  res = h;
            for(int i = 0; i <= h;i++)
            {
                for(int j = 0;j < n;j++)
                {
                    if(i > a[j])
                        dp[i] = Math.Min(dp[i],dp[i-a[j]]+b[j]);
                    else
                        dp[i] = Math.Min(dp[i],b[j]);
                }

            }
            
            Console.WriteLine(dp[h]);
            
            }
        } 
    

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

int main(){
    int N;
    cin>>N;
    vector<int> point(N);
    int temp;
    for(int i=0;i<N-1;i++){      
       cin>> temp;
       point.at(temp-1)+=1;
    }
    for(int i=0;i<N;i++){      
        cout<<point.at(i)<<endl;
    }
}

Measured memory_bytes: 4000
#include <bits/stdc++.h>
using namespace std;
int main()
{
	long long n,k,x,ans;
	cin >> n >> k;
	n = n - k*(n/k);
	ans = n;
	while(1)
	{
		x = abs(n-k);
		if(x<n)
			ans = x;
		else
			break;
		n = x;
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <set>
#include <map>
#include <queue>
#include<limits.h>
#include<iomanip>
//setprecision(12)
#include <cassert>
#define rep(i, n) for(int i = 0; i < n; i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define REP(i, m, n) for(int i = m; i < n; i++)
#define ALL(v) v.begin(),v.end()
#define RALL(v) v.rbegin(),v.rend()
#define Cout(x) cout << x << endl;
#define check(v) rep(i,v.size()) cout << v[i] << endl;
#define vint(x) vector<int> x
#define vll(x) vector<long long> x
#define vstr(x) vector<string> x
const long long LLINF = 1LL<<60;
const int INF = 1e9;
const long long MOD = 1000000007;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
typedef long long ll;
#define pint pair<int,int>
#define pll pair<ll,ll>
using namespace std;
//オーバーフローに気をつけろよおおおおおお
//確認忘れるなよおおおおおお

int gcd(int x, int y){
    return y?gcd(y,x%y):x;
}

int lcm(int x, int y){
    return x/gcd(x,y)*y;
}
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    ll ans = 0;
    int k; cin >> k;
    REP(i,1,k+1) REP(j,1,k+1) REP(u,1,k+1) {
        ans+=gcd(gcd(i,j),u);
    }
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3624
import sys

input = sys.stdin.readline


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

    l = [A, B, C]
    l.sort()
    if l[0] == l[1] == 5 and l[2] == 7:
        print("YES")
    else:
        print("NO")


if __name__ == "__main__":
    main()


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

int main() {
    int  T, X;
    cin >> T >> X;
    for (int i = 1; i <= 3; i++)
    {
        if ((i*T*X)%2 == 1)
            {
                cout << "Yes";
                return 0;
            }
    }
    
    cout << "No";
    return 0;
}

Measured memory_bytes: 384
#include<iostream>
#include<algorithm>
#include<vector>
#include<stack>
#include<queue>
#include<cstdio>
#include<climits>
#include<cmath>
#include<cstring>
#include<string>
#include<complex>
#include<map>

#define f first
#define s second

#define REP(i,n) for(int i=0; i<(int)(n); i++)
#define FOR(i,c) for(__typeof((c).begin()) i=(c).begin(); i!=(c).end(); i++)
#define ALL(c) (c).begin(), (c).end()
#define EPS (1e-10)
using namespace std;

typedef unsigned int uint;
typedef long long ll;
typedef complex<double> P;

template<int m>
class Prime{
  std::vector<bool> p;
  std::vector<int> ps;
public:
  Prime(){
    p = std::vector<bool>(m,true);
    p[0]=p[1]=false;
    for(int i=4;i<m;i+=2)
      p[i]=false;
    ps.push_back(2);
    for(int i=3;i<m;i+=2){
      if(p[i]){
        ps.push_back(i);
        for(int j=i+i;j<m;j+=i)
          p[j]=false;
      }
    }
  }

  bool isPrime(int n){
    return p[n];
  }

  int operator [] (int n){
    if(n<ps.size()) return ps[n];
    else return 0;
  }

  int size(){
    return ps.size();
  }
};

#define MAX (60000)
int main(){
  Prime<MAX> p;
  int n;
  while(cin>>n, n){
    int cnt = 0;
    for(int i=0; ; i++){
      if(p[i] + p[i] > n) break;
      if(p.isPrime(n - p[i]))
	cnt++;
    }
    cout << cnt << endl;
  }
  return 0;
}

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

int main()
{
    int n;
    string s;
    cin >> n >> s;
    if(n % 2 == 1){
        cout << "No" << endl;
        return 0;
    }
    for(int i =0, j = n/2; j < n; i++,j++){
        if(s[i] != s[j]) {
            cout << "No" << endl;
            return 0;
        }
    }
    
    cout << "Yes" << endl;
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using static System.Console;
class Program
{
    static void Main()
    {
        string[] input = ReadLine().Split();
        long a = long.Parse(input[0]);
        long b = long.Parse(input[1]);

        int c = 1;
        while (true)
        {
            a *= 2;
            if (a > b)
                break;
            c++;
        }
        WriteLine(c.ToString());
    }
}

Measured memory_bytes: 13140
#include <stdlib.h>
#include <stdio.h>
int compare(const void *a,const void *b){
    return *(int*)a - *(int*)b;
}
int main()
{   
    int i,n,d[101],cnt=1;
    scanf("%d",&n);
        for(i=0;i<n;i++){
            scanf("%d",&d[i]);
        }
        qsort(d,n,sizeof(int),compare);
        for(i=0;i<n-1;i++){
            if(d[i]<d[i+1]){
                cnt++;
            }
        }
    printf("%d",cnt);
    return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}
int sgn(const double&r){return (r>EPS)-(r<-EPS);} // a>0  : sgn(a)>0
int sgn(const double&a,const double&b){return sgn(a-b);} // b<=c : sgn(b,c)<=0

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n;
	cin>>n;
	string s,t;
	cin>>s>>t;
	rep(i,s.size()){
		cout<<s[i]<<t[i];
	}
	cout<<endl;
}


Measured memory_bytes: 256
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		long n=sc.nextLong();
		long sum = 0;
		int i=1;
		while(i<(n-i)/i) {
			if(n%i==0) 
				sum+=(n-i)/i;
			i++;
		}
		System.out.print(sum);
		

	}

}

Measured memory_bytes: 23892
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		// TODO 自動生成されたメソッド・スタブ
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));

		String[] tmpArray = br.readLine().split(" ");

		int a = Integer.parseInt(tmpArray[0]);
		int b = Integer.parseInt(tmpArray[1]);

		if(a <= 8 && b <= 8){
			System.out.println("Yay!");
		}
		else {
			System.out.println(":(");
		}
	}

}


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

#define rep2(x,fr,to) for(int x=(fr);x<(to);x++)
#define rep(x,to) for(int x=0;x<(to);x++)
#define repr(x,fr,to) for(int x=(fr);x>=(to);x--)
#define all(c) c.begin(),c.end()
#define sz(v) (int)v.size()

using namespace std;
typedef long long  ll; typedef vector<int> VI; typedef pair<int,int> pii; typedef vector<ll> VL; const int MD = 1e9 + 7;
void dbg(){cerr<<"\n";} template <class F,class ...S> void dbg(const F& f, const S&...s){cerr <<f <<": "; dbg(s...);}

int main()
{
	cin.tie(0); ios_base::sync_with_stdio(false);
	int n, q;
	cin >>n;
	VI ct(101000);
	ll ans = 0;
	rep(i, n){
		int a; cin >>a;
		ct[a]++; ans +=a;
	}
	cin >>q;
	while(q--){
		int b, c;
		cin >>b >>c;
		ans += (ll)(c-b) * ct[b];
		ct[c] +=ct[b]; ct[b] =0;
		cout << ans <<"\n";
	}
	return 0;
}


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

#define ll long long
#define pb push_back
#define endl '\n'
#define fcin ios::sync_with_stdio(false); cin.tie(nullptr);
#define inf 0x3f3f3f3f

const int W = 1e9+9;
const int N = 101;
int w[N], v[N];
int n;
ll maxw;

int main(){
    fcin;
    cin >> n >> maxw;
    int tot = 0;
    for(int i = 0; i < n; i++){
        cin >> w[i] >> v[i];
        tot+=v[i];
    }
    // dp[i]: min weight for total value exactly i 
    vector<ll> dp((int)1e5+5, 1e18L + 8);
    dp[0] = 0;
    for(int i = 0; i < n; i++){
        for(int vi = tot - v[i]; vi >= 0; vi--){
            dp[vi + v[i]] = min(dp[vi + v[i]], dp[vi] + w[i]);
        }
    }
    int ans = 0;
    for(int i = 0; i <= tot; i++)
        if(dp[i] <= maxw) ans = max(ans, i);

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

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

int main(){

	int N,cnt=1,tmp;
	char s[100010];
	int i,j;
	scanf("%d",&N);
	
	scanf("%s",s);
	
	#if 0
	for(i=0;i<N-1;i++){
		for(j=i+1;j<N;j++){
			if(s[i]!=s[j]){
				cnt++;
				i=j-1;
				break;
			}
			
		}
	}
	#endif
	#if 1
	// tmp x x x i 
	//           tmp x x x x
	tmp=0;
	for(i=1;i<N;i++){
			if(s[tmp]!=s[i]){
				cnt++;
				tmp=i;
			}
			//else if(i==N-1)cnt++;
		//printf("%d,",tmp);
	}
	#endif
	
	printf("%d\n",cnt);
	return 0;
 }

Measured memory_bytes: 256
N = gets.to_i
array = gets.chomp.split.map(&:to_i)
array.sort!
array.reverse!

total = 1
if array.include?(0)
    puts "0"
    total = nil
else
    array.each do |i|
        total = total * i
        if total > 1000000000000000000
            puts "-1"
            total = nil
            break
        end
    end
end

puts total if total


Measured memory_bytes: 24188
#include <iostream>
#include <string>
#include <algorithm>
//#include <cassert>
//#include <array>
#include <queue>
//#include <stack>
//#include <vector>
//#include <map>
//#include <set>
//#include <unordered_map>
//#include <unordered_set>

#define REP(i, n) for (int i = 0; i < (int)(n); i++)
#define REP1(i, n) for (int i = 1; i <= (int)(n); i++)

using namespace std;

int a, b, c;

void solve() {
	int ans;
	cin >> a >> b >> c;
	priority_queue<int> q;
	q.push(a);
	q.push(b);
	q.push(c);
	a = q.top(); q.pop();
	b = q.top(); q.pop();
	c = q.top(); q.pop();
	ans = a * 10 + b + c;

	cout << ans << endl;
	return;
}

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

Measured memory_bytes: 256
#include<iostream>
#include<math.h>
#include<string>
using namespace std;

#define rep(i,n) for(i=0;i<n;i++)
int main(){
    int i;
    int sum=0;
    int N,K;
    cin>>N>>K;
    int pos[N];
    rep(i,N){
        cin>>pos[i];
    }
    rep(i,N){
        if(abs(pos[i]-K)<abs(pos[i])){
            sum+=2*abs(pos[i]-K);
        }else{
            sum+=2*abs(pos[i]);
        }
    }
    cout<<sum<<endl;
}


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

cnt = {}
for a in A:
	if a in cnt:
		cnt[a] += 1
	else:
		cnt[a] = 1

cnt = sorted(cnt.items(), key=lambda x: x[0], reverse=True)

cand2 = []
cand4 = []
for key,value in cnt:
	if value >= 4:
		cand4.append(key)
	if value >= 2:
		cand2.append(key)
cand4.append(0)
cand2.append(0)
cand2.append(0)

print(max(cand4[0] * cand4[0], cand2[0] * cand2[1]))

Measured memory_bytes: 22052
#include <iostream>
using namespace std;
int main()
{
	int a[3];
	for (int i = 0;i < 3;i++)
	{
		cin >> a[i];
	}
	if ((a[0] == a[1]&&a[2]!=a[0] )|| (a[0] == a[2]&&a[1]!=a[0]) || a[1] == a[2]&&a[0]!=a[1]) cout << "Yes\n";
	else cout << "No\n";
}


Measured memory_bytes: 256
#include <stdio.h>

int main (void)
{
  long a , b , x , c = 0;
  scanf("%ld %ld %ld",&a,&b,&x);
  
  
  if(a%x==0)
    c=1;
    printf("%ld",(b/x)-(a/x)+c);
  
  return 0;
}
  

Measured memory_bytes: 128
#include<stdio.h>

int main(void) {
	int h = 1, i, j, k;
	int n, x;
	int ans;
	for (ans = 0; h == 1; ans = 0) {
		scanf("%d %d", &n, &x);
		if (n == 0 && x == 0) {
			h = 2;
		}
		for (i = 1; i <= n - 2; i++) {
			for (j = i + 1; j <= n - 1; j++) {
				for (k = j + 1; k <= n; k++) {
					if (i + j + k == x) ++ans;
				}
			}
		}
		if(h == 1) printf("%d\n", ans);
	}
	return 0;
}


Measured memory_bytes: 2060
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <stack>
#include <queue>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <ctime>

using namespace std;

inline int toInt(string s) {int v; istringstream sin(s);sin>>v;return v;}
template<class T> inline string toString(T x) {ostringstream sout;sout<<x;return sout.str();}

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef long long LL;
typedef unsigned long long ULL;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define REP(i,n)  FOR(i,0,n)

#define MP make_pair
#define EACH(i,c) for(auto i: c)
#define SORT(c) sort((c).begin(),(c).end())

#define ALL(a)  (a).begin(),(a).end()

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

	if(s[1] == 'B') cout << "ARC" << endl;
	else cout << "ABC" << endl;

	return 0;
}


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

int main() {
  int A, B, K, count = 0, count2 = 0;
  cin >> A >> B >> K;
  for (int i = 1; i <= min(A, B); i++) {
    if (A % i == 0 && B % i == 0) {
      count++;
    }
  }
  for (int i = 1; i <= min(A, B); i++) {
    if (A % i == 0 && B % i == 0) {
      count2++;
      if (count2 == count + 1 - K) {
        cout << i;
      }
    }
  }
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
#define endl "\n" 
#define pi acos(-1)
#define ll long long 
using namespace std;
int main()
{
	ios::sync_with_stdio(false);
	cin.tie(NULL);cout.tie(NULL);

	int q=1;//cin>>q;
	while(q--){
		int n,a=0,b=0,c=0,d=0;cin>>n;
	string s[n];
	for(int i=0;i<n;i++)
	{
		cin>>s[i];
		if(s[i]=="AC")
			a++;
		else if(s[i]=="WA")
			b++;
		else if(s[i]=="TLE")
			c++;
		else if(s[i]=="RE")
			d++;
	}
	cout<<"AC"<<" "<<"x"<<" "<<a<<endl;
	cout<<"WA"<<" "<<"x"<<" "<<b<<endl;
	cout<<"TLE"<<" "<<"x"<<" "<<c<<endl;
	cout<<"RE"<<" "<<"x"<<" "<<d<<endl;
	}
	return 0;
}

Measured memory_bytes: 6784
n=int(input())
a=list(map(int,input().split()))
b=list(map(int,input().split()))
ans=0
for i in range(n):
    tmp=min(a[i],b[i])
    b[i]-=tmp
    ans+=tmp
    tmp=min(a[i+1],b[i])
    ans+=tmp
    a[i+1]-=tmp
print(ans)

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

#define F first
#define S second
#define PB push_back

using namespace std;

typedef long long LL;
typedef pair<int, int> PII;
typedef priority_queue<int> HEAP;
typedef priority_queue<int, vector<int>, greater<int> > RHEAP;

const int N = 100010, M = 1010;

int n, m = -2;
string res;

int main()
{
	cin >> n;
	if (!n) res = "0";
	else
	{
		for (int i = n; i; i /= m)
		{
			if (i % abs(m))
			{
				res += "1";
				if (m < 0) i -- ;
			}
			else res += "0";
		}
		reverse(res.begin(), res.end());
	}
	
	cout << res << endl;
	return 0;
}

Measured memory_bytes: 256
using System;
class Program
{
	static void Main(string[] args)
	{
		string[] input = Console.ReadLine().Split(' ');
		int a = int.Parse(input[0]);
		int b = int.Parse(input[1]);
		
		int times = a * b;

		int dived = times%2;

		string str = (dived == 0) ? "Even"
								  : "Odd";
		Console.WriteLine(str);
	}
}

Measured memory_bytes: 13140
#include <iostream>
#include <string>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <map>
#include <set>
#include <algorithm>
#include <queue>
#include <stack>
#include <functional>
#include <bitset>
#include <assert.h>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vl> vvl;
typedef vector<char> vc;
typedef vector<string> vs;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef pair<ll,ll> P;
typedef vector<P> vpl;
typedef tuple<ll,ll,ll> tapu;
#define rep(i,n) for(ll i=0; i<(n); i++)
#define REP(i,a,b) for(int i=(a); i<(b); i++)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
const int inf = 1<<30;
const ll linf = 1LL<<62;
const int MAX = 510000;
ll dy[8] = {0,1,0,-1,1,-1,1,-1};
ll dx[8] = {1,0,-1,0,1,-1,-1,1};
const double pi = acos(-1);
const double eps = 1e-7;
template<typename T1,typename T2> inline bool chmin(T1 &a,T2 b){
	if(a>b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline bool chmax(T1 &a,T2 b){
	if(a<b){
		a = b; return true;
	}
	else return false;
}
template<typename T1,typename T2> inline void print2(T1 a, T2 b){cout << a << " " << b << endl;}
template<typename T1,typename T2,typename T3> inline void print3(T1 a, T2 b, T3 c){
	cout << a << " " << b << " " << c << endl;
}
const int mod = 1e9 + 7;
//const int mod = 998244353;

vvl G(101010);
vl dp(101010,-1);
ll n,m;
vvl reses(101010);
vvl mul(101010);
vvl rmul(101010);

ll cp(ll u, ll p){
	if(dp[u] != -1) return dp[u];
	ll res = 1;
	for(auto v : G[u]){
		if(v == p) continue;
		ll t = cp(v,u) + 1;
		reses[u].push_back(t%m);
		res *= t;
		res %= m;
	}
	return dp[u] = res;
}

vl ans(101010);

void dfs(ll u, ll p, ll id, ll acc){
	if(p == -1) ans[u] = dp[u];
	else{
		acc *= mul[p][id] * rmul[p][id+1] % m;
		acc = (acc + 1) % m;
		ans[u] = acc * dp[u] % m;
	}
	ll now = 0;
	for(auto v : G[u]){
		if(v == p) continue;
		dfs(v,u,now,acc);
		now++;
	}
}

int main(){
	cin >> n >> m;
	rep(i,n-1){
		ll x,y; cin >> x >> y; x--; y--;
		G[x].push_back(y);
		G[y].push_back(x);
	}
	cp(0,-1);
	rep(i,n){
		if(reses[i].empty()) continue;
		ll siz = reses[i].size();
		mul[i].resize(siz+1);
		rmul[i].resize(siz+1);
		mul[i][0] = 1;
		rmul[i][siz] = 1;
		rep(j,reses[i].size()){
			mul[i][j+1] = mul[i][j] * reses[i][j] % m;
		}
		for(ll j=siz-1; j>=0; j--){
			rmul[i][j] = reses[i][j] * rmul[i][j+1] % m;
		}
	}
	dfs(0,-1,0,1);
	rep(i,n) cout << ans[i] % m << "\n";
}

Measured memory_bytes: 30464
#include <bits/stdc++.h>
using namespace std;
#include <math.h>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int64_t INF = 1LL << 60;

int main() {
 	 int64_t N,A,B;
   cin>>N>>A>>B;
   if(B<A){cout<<0<<endl;}
   else if(N==1){if(A!=B){cout<<0<<endl;}
                 else{cout<<1<<endl;}}
   else{
   cout<<(B-A)*(N-2)+1<<endl;
   }
	return 0;
}

Measured memory_bytes: 256
import java.util.*

fun main(args: Array<String>) {
    val b = Array(3) { IntArray(3) { 0 } }
    val check = Array(3) { Array(3) { false } }
    for (i in 0 until 3) {
        b[i] = readLine()!!.split(' ').map { it.toInt() }.toIntArray()
    }
    val N = readLine()!!.toInt()
    for (i in 0 until N) {
        val x = readLine()!!.toInt()
        for (j in 0 until 3) {
            for (k in 0 until 3) {
                if (b[j][k] == x) {
                    check[j][k] = true
                }
            }
        }
    }
    val ok = (check[0][0] && check[0][1] && check[0][2])
            || (check[1][0] && check[1][1] && check[1][2])
            || (check[2][0] && check[2][1] && check[2][2])
            || (check[0][0] && check[1][0] && check[2][0])
            || (check[0][1] && check[1][1] && check[2][1])
            || (check[0][2] && check[1][2] && check[2][2])
            || (check[0][0] && check[1][1] && check[2][2])
            || (check[0][2] && check[1][1] && check[2][0])
    println(if (ok) "Yes" else "No")
}

Measured memory_bytes: 36420
#include<iostream>
#include<string>
#include<algorithm>
#include<vector>
#include<iomanip>
#include<math.h>
#include<complex>
#include<queue>
#include<deque>
#include<stack>
#include<map>
#include<set>
#include<bitset>
#include<functional>
#include<assert.h>
#include<numeric>
using namespace std;
typedef pair<int,int> P;
typedef long long ll;
typedef long double ld;
const int inf=1e9+7;
const ll longinf=1LL<<60;
#define REP(i,m,n) for(int i=(int)(m) ; i < (int) (n) ; ++i )
#define rep(i,n) REP(i,0,n)
#define F first
#define S second

const int mx=100010;
const ll mod=1e9+7;

int main(){
  ll s,t;
  cin >> s >> t;
  pair<ll,ll> a,b;
  cin >> a.F >> a.S >> b.F >> b.S;
  if(a.F<b.F) swap(a,b);
  if(a.F*s+a.S*t == b.F*s+b.S*t){ cout << "infinity" << endl; return 0; }
  ll A = a.F*s+a.S*t;
  ll B = b.F*s+b.S*t;
  if(A > B){ cout << 0 << endl; return 0; }
  ll dis = b.F*s+b.S*t - (a.F*s+a.S*t);
  ll mome = (a.F-b.F)*s;
  cout << (mome/dis)*2+(mome%dis!=0?1:0) << endl;

  return 0;  
}

Measured memory_bytes: 256
# ABC061B - Counting Roads
n, m = list(map(int, input().rstrip().split()))
lst = [list(map(int, input().rstrip().split())) for _ in range(m)]
ans = [0] * n
for i in lst:
    for j in i:
        ans[j - 1] += 1
for i in ans:
    print(i)

Measured memory_bytes: 3060
#include<iostream>
#include<algorithm>
#include<vector>
#include<queue>
#include<stack>
#include<string>
#include<map>
#include<set>
#include<tuple>
#include<cmath>
#include<iomanip>


#define MOD 1000000007
#define INF 1001001001
#define MIN -1001001001
#define rep(i,k,N) for(int i=k;i<N;i++)
#define MP make_pair
#define MT make_tuple //tie,make_tuple は別物
#define PB push_back
#define PF push_front
#define all(x) (x).begin(),(x).end()


using namespace std;
typedef long long ll;
typedef vector<ll> v;
typedef vector<vector<ll>> vv;

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

void YN(bool ans){
    if(ans)cout<<"Yes"<<endl;
    else cout <<"No"<<endl;
    return;
}

int main(){
    ll x;
    cin>>x;
    if(x<1200)cout<<"ABC";
    else cout<<"ARC";
    return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner sc = new Scanner(System.in);

		int N = sc.nextInt();
		int A = sc.nextInt();

		boolean can = false;

		for (int i = 0; i <= A; i++) {

			if(N%500 <= A) {
				can = true;
				break;
			}
		}
		if(can) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
}


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

## 2パターンとも試す
ans1 = 0
ans2 = 0
  
med = sum(X)//N
for n in range(N):
  ans1 += (X[n]-med)**2

med += 1
for n in range(N):
  ans2 += (X[n]-med)**2
  
ans = min(ans1,ans2)
  

print(ans)

Measured memory_bytes: 3064
a,b,c=map(int,input().split())

count=0
while True:
    if a%2==0 and b%2==0 and c%2==0: pass
    else: break
    if a==b==c: count=-1; break
    a,b,c=b//2+c//2,c//2+a//2,a//2+b//2
    count+=1

print(count)

Measured memory_bytes: 3060
#include<iostream>
using namespace std;
inline long long int min(long long int a, long long int b)
{
  return (a>b?b:a);
}
int main()
{
  	long long int n, a, b;
  cin>>n>>a>>b;
  ////////if(a>b)swap(a,b);
  if((b - a)%2)
    cout<<min(min(n - a, b - 1),min(n - b, a - 1) + 1 + (b -a - 1)/2)<<endl;
  else cout<<(b - a)/2<<endl;
  
}


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

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

        int cnt = 1;
        char n = S[0];
        for (int i = 1; i < N; ++i) {

                if (S[i] != n) {
                        n = S[i];
                        cnt++;
                }
        }
        cout << cnt << endl;


}


Measured memory_bytes: 512
N, K = map(int, input().split())
H = []
for _ in range(N):
  h = int(input())
  H.append(h)

H.sort()

ans = 1e9
for i in range(K-1, N):
  diff = H[i] - H[i-K+1]
  ans = min(ans, diff)

print(ans)

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

int n,k;
int a[200005];
int b[200005];
int ans;

int main(){

cin.tie(0);
ios::sync_with_stdio(false);

cin>>n>>k;

for(int i=0; i<n; i++){
  cin>>a[i];
}

sort(a,a+n);

int cnt=1;
int nn=a[0];
for(int i=0; i<n; i++){
  if(a[i]>nn){
    nn=a[i];
    cnt++;
  }
  b[cnt-1]++;
}

for(int i=cnt; i<n; i++){
  b[i]=234567;
}

sort(b,b+n);

for(int i=0; i<cnt-k; i++){
  ans+=b[i];
}

cout<<ans<<endl;

}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
using P = pair<int, int>;
const int inf = 1e9;
const int MAX = 1e5+5;
const ll MOD = 1e9+7;
#define REP(i, n) for (int i = 0; i < (n); ++i)

struct edge{
    int to;
    int cost;
};
using graph = vector<vector<edge>>;

int main(){
    int n, k; cin >> n >> k;
    deque<int> dq;
    priority_queue<int, vector<int>, greater<int>> pq;
    int value;
    REP(i, n){
        cin >> value;
        dq.push_back(value);
    }
    int ans = 0;
    int execute_num = min(n,k);
    for(int i=0; i<=execute_num; i++){
        for(int j=0; j<=execute_num-i; j++){
            deque<int> dq_copy = dq;
            priority_queue<int, vector<int>, greater<int>> pq;
            for(int l=0; l<i; l++){
                pq.push(dq_copy.front());
                dq_copy.pop_front();
            }
            for(int l=0; l<j; l++){
                pq.push(dq_copy.back());
                dq_copy.pop_back();
            }
            for(int l=0; l<k-i-j; l++){
                if(!pq.empty()){
                    value = pq.top();
                    if(value < 0) pq.pop();
                }
            }
            int tmp_ans = 0;
            while(!pq.empty()){
                tmp_ans += pq.top();
                pq.pop();
            }
            ans = max(ans, tmp_ans);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 256
fun main(args: Array<String>) {
    val D = readLine()!!.toInt()
    if(D == 25){
        println("Christmas")
    } else if(D == 24){
        println("Christmas Eve")
    } else if(D == 23){
        println("Christmas Eve Eve")
    } else if(D == 22){
        println("Christmas Eve Eve Eve")
    }
}


Measured memory_bytes: 31304
using System;
using System.Collections.Generic;
using System.Linq;
using static Atcoder;
using System.Threading.Tasks;
using System.ComponentModel;

public class Hello
{
    private const long INF = 1000000007;
    public static void Main()
    {
        int[] NX = IntLine();
        List<int> city = new List<int>();
        int[] c = new int[NX[0] + 1];
        c = IntLine();
        city = c.ToList();
        city.Add(NX[1]);
        city.Sort();
        long ans = city[1] - city[0];
        for (int i = 1; i < NX[0]; i++)
        {
            ans = GCD(ans, (city[i + 1] - city[i]));
        }
        Console.WriteLine(ans);
    }
}

public class Atcoder
{
    public static void Swap<T>(ref T a, ref T b)
    {
        var t = a;
        a = b;
        b = t;
    }
    public static long LCM(long a, long b)
    {
        long c = a * b;
        if (a < b) Swap(ref a, ref b);
        long d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return c / b;
    }
    public static long GCD(long a, long b)
    {
        if (a < b) Swap(ref a, ref b);
        long d = a % b;
        while (d != 0)
        {
            a = b;
            b = d;
            d = a % b;
        }
        return b;
    }
    public static string StrReverce(string s)
    {
        return new string(s.Reverse().ToArray());
    }
    public static bool IsPrime(int n)
    {
        if (n < 2) return false;
        if (n == 2) return true;
        if (n % 2 == 0) return false;

        //double sqrtNum = Math.Sqrt(n);
        for (int i = 3; i < n; i += 2)
        {
            if (n % i == 0) return false;
        }
        return true;
    }
    public static string[] SpRead(char c)
    {
        return Console.ReadLine().Split(c);
    }
    public static string ToConvertBit(int N, int e)
    {
        string ret = "";
        int r = 0;
        while (N != 0)
        {
            r = N % e;
            ret += r.ToString();
            N -= r;
            N /= e;
        }
        ret = StrReverce(ret);
        return ret;
    }
    public static int IntRead()
    {
        return int.Parse(Console.ReadLine());
    }
    public static long LongRead()
    {
        return long.Parse(Console.ReadLine());
    }
    public static long[] LongLine()
    {
        return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
    }
    public static int[] IntLine()
    {
        return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
    }
}


Measured memory_bytes: 23264
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cstdlib>
#include<vector>
#include<map>
#include<queue>
#include<set>
#include<stack>
#include<cctype>
#include<cstring>
#include<utility>
const int inf=0x7fffffff;
typedef long long int ll;
int a[5][4][11];
int main()
{
#ifdef DEBUG
	freopen("in", "r", stdin);
//	freopen("out", "w", stdout);
#endif
	memset(a,0,sizeof(a));
	int n;
	scanf("%d", &n);
	while(n--){
		int b,f,r,v;scanf("%d%d%d%d", &b,&f,&r,&v);
		a[b][f][r]+=v;
	}
	for(int i=1;i<=4;i++){
		for(int j=1;j<=3;j++){
			for(int k=1;k<=10;k++){ 
				printf(" %d", a[i][j][k]);
			}
			printf("\n");
		}
		if(i!=4){for(int z=0;z<20;z++)printf("#");
		printf("\n");}
	}
	
	//insert code
	return 0;
}
//aog1_6_c.cc

Measured memory_bytes: 1192
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(ll i = 0, i##_len = (n); i < i##_len; i++)
#define reps(i, s, n) for(ll i = (s), i##_len = (n); i < i##_len; i++)
#define rrep(i, n) for(ll i = (n) - 1; i >= 0; i--)
#define rreps(i, e, n) for(ll i = (n) - 1; i >= (e); i--)
#define all(x) (x).begin(), (x).end()
#define sz(x) ((ll)(x).size())
#define len(x) ((ll)(x).length())

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    // std::ifstream in("input.txt");
    // std::cin.rdbuf(in.rdbuf());
    ll n;
    cin >> n;
    vector<pair<string, ll>> st(n);
    rep(i, n) cin >> st[i].first >> st[i].second;
    string x;
    cin >> x;
    bool f = false;
    ll ans = 0;
    rep(i, n) {
        if (st[i].first == x) {
            f = true;
            continue;
        }
        if (f) {
            ans += st[i].second;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#include<string.h>
int main()
{
    int n,i,j,cnt=0,fla=1,flg;
    char s[15],t[15];
    scanf("%s",s);
    scanf("%s",t);
    n=strlen(s);
    i=strlen(t);
    if((i-n)==1)
    {
        for(j=0;j<n;j++)
        {
            if(s[j]!=t[j]){fla=0;break;}
        }
        if(fla) printf("Yes\n");
        else printf("No\n");
    }
    else printf("No\n");
    return 0;
}


Measured memory_bytes: 1644
#include <iostream>

typedef long long ll;
const ll MOD = 998244353;

ll N, S, A[3005], dp[3005][3005];

ll fast_exp(ll b, ll e) {
  ll res = 1;
  while (e) {
    if (e & 1)  res = (res * b) % MOD;
    b = (b * b) % MOD;
    e >>= 1;
  }
  return res % MOD;
}

ll solve(int i, int s) {
  if (s == 0) return fast_exp(2, i+1);
  if (i == -1)  return 0;
  if (dp[i][s] != -1) return dp[i][s];
  int ans = (2*solve(i-1, s)) % MOD;
  if (A[i] <= s)
    ans = (ans + solve(i-1, s - A[i])) % MOD;
  return dp[i][s] = ans;
}

int main() {
  std::cin >> N >> S;
  for (int i = 0; i < N; ++i) {
    std::cin >> A[i];
    for (int j = 0; j <= S; ++j)
      dp[i][j] = -1;
  }

  std::cout << solve(N-1, S) << "\n";

  return 0;
}


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

#define int long long

using namespace std;

int adj[800][800];

vector < int > a[805];
int level[805];
int vis[805];

int odd=0;
int even=0;

void dfs(int n,int cur)
{
        if(cur%2)
                odd++;
        else
                even++;
        level[n]=cur;
        vis[n]=1;

        for(int i=0;i<a[n].size();i++)
        {
                if(vis[a[n][i]]==0)
                        dfs(a[n][i],cur+1);
        }
}

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


        int t1, t2;
        for(int i=0;i<m;i++)
        {
                cin>>t1>>t2;    
                adj[t1][t2]=1;
                adj[t2][t1]=1;
        }

        for(int i=1;i<=n;i++)
        {
                for(int j=1;j<=n;j++)
                {
                        if(i==j)
                                continue;
                        if(adj[i][j]==0)
                                a[i].push_back(j);
                }
        }

        vector < pair < int , int > > arr;

        for(int i=1;i<=n;i++)
        {
                if(vis[i]==0)
                {
                        odd=0;
                        even=0;
                        dfs(i,1);
                        arr.push_back({odd,even});
                }
        }

        for(int i=1;i<=n;i++)
        {
                for(int j=0;j<a[i].size();j++)
                {
                        int temp=level[i]-level[a[i][j]];
                        if(temp<0)
                                temp*=-1;
                        if(temp%2==0)
                        {
                                cout<<-1<<endl;
                                return 0;
                        }
                }
        }

        int dp[705][705]={0};

        dp[0][arr[0].first]=1;
        dp[0][arr[0].second]=1;

        for(int i=1;i<arr.size();i++)
        {
                for(int j=0;j<=700;j++)
                {
                        if(dp[i-1][j]==1)
                        {
                                dp[i][j+arr[i].first]=1;
                                dp[i][j+arr[i].second]=1;
                        }
                }
        }

        int cur=arr.size()-1;
        int ans=m;
        for(int i=1;i<=n;i++)
        {
                if(dp[cur][i]==1)
                {
                        int temp1=i*(i-1)/2;
                        int temp2=(n-i)*(n-i-1)/2;
                        ans=min(ans,temp1+temp2);
                }
        }
        cout<<ans<<endl;

        return 0;
}


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

int main(){
    ll a,b;
    cin>>a>>b;
    cout<<a*b<<endl;
    return 0;
}


Measured memory_bytes: 3584
#include <algorithm>
#include <iostream>
#include <limits.h>
#include <math.h>
#include <queue>
#include <set>
#include <stdlib.h>
#include <string>
#include <vector>
#include <cstdio>
#include <iomanip>
#define ll long long
#define rep2(i,a,b) for(int i=a;i<=b;i++)
#define rep(i,n) for(int i=0;i<n;i++)
#define rep3(i,a,b) for(int i=a;i>=b;i--)
#define REP(e,v) for(auto e:v)
#define queint queue<int>
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pq priority_queue<int>//大きい順
#define pqg priority_queue<int,vec,greater<int>>//小さい順
#define pb push_back
#define vec vector<int>
#define vecvec vector<vector<int>>
#define vecll vector<ll>
#define vecvecll vector<vector<ll>>
#define bs binary_search
#define All(c) (c).begin(),(c).end()
#define mp make_pair
using namespace std;
int in(){int x;scanf("%d",&x);return x;}
string stin(){string s;cin>>s;return s;}
ll lin(){ll x;scanf("%lld",&x);return x;}
int main(){
    int n=in();
    vec a(n);
    rep(i,n){
        a[i]=-in();
    }
    vec q;
    q.pb(a[0]);
    for(int i=1;i<n;i++){
        auto id = upper_bound(All(q),a[i]);
        if(id-q.begin() == q.size()){
            q.pb(a[i]);
        }else{
            q[id-q.begin()]=a[i];
        }
    }
    cout<<q.size()<<endl;
}

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

int main(){
  int n;
  cin >> n;
  ll a[n];
  ll s = 0;
  rep(i,n) {
    cin >> a[i];
    s ^= a[i];
  }
  rep(i,n) cout << (s^a[i]) << " ";
  cout << endl;
  return 0;
}


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

int A[3];

int main() {
    cin >> A[0] >> A[1] >> A[2];

    sort(A, A+3);


    if (A[0] == A[1] && A[1] != A[2]) cout << "Yes" << endl;
    else if (A[0] != A[1] && A[1] == A[2])cout << "Yes" << endl;
    else cout << "No" << endl;
     

    return 0;
}

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

using namespace std;
typedef long long ll;


int main(){

    int n;
    cin>>n;
    vector<int>a;
    for (int i=0; i<n; i++){
        int x;
        cin>>x;
        a.push_back(x);
    }
    vector<int>dp(n, 1e9+5);
    dp[0]=0;
    dp[1]=abs(a[1]-a[0]);
    for (int i=2; i<n; i++){
        dp[i]=min(dp[i-1]+abs(a[i]-a[i-1]), dp[i-2]+abs(a[i]-a[i-2]));

    }
    cout<<dp[n-1];
    return 0;
}


Measured memory_bytes: 1144
# Your code here!
line = gets.split(' ').map(&:to_i)

takahashi_hp = line[0]
takahashi_ap = line[1]
aoki_hp = line[2]
aoki_ap = line[3]

takahashi_turn = (aoki_hp/takahashi_ap.to_f).ceil
aoki_turn = (takahashi_hp/aoki_ap.to_f).ceil

if takahashi_turn <= aoki_turn
    print "Yes"
else
    print "No"
end

Measured memory_bytes: 14300