akhauriyash/Code-Regression huggingface dataset:
#include <iostream>

#include <climits>

int main(){
	int *array;
	int n,max=-INT_MAX,min=INT_MAX;
	long long sum=0;
	std::cin >> n;
	array= new int[n];

		for(int i=0;i<n;i++){
		std::cin >> array[i];
		max = std::max(max, array[i]);
		min = std::min(min, array[i]);
		sum += array[i];
		}
	std::cout << min << " " << max << " " << sum << std::endl;
	delete [] array;
}

Measured memory_bytes: 1236
#include<bits/stdc++.h>
#define rep(a,b,c) for(int a=b;a<c;a++)
#define repm(a,b,c) for(int a=(b-1);a>=c;a--)
#define pb push_back
#define str string
#define INF 1<<64
#define sf(a) scanf("%d",&a)
using namespace std;
int replac(str s){double ans=0;rep(i,0,s.length()){ans+=(s[i]-'0')*pow(10,s.length()-i-1);}return (int)ans;}
typedef pair<int,int> pii;
vector<pii> vii;
long long int n=0,cade[100005];

signed main(){
    fill(cade,cade+100005,0);
    cin.tie(0);
    ios::sync_with_stdio(false);
    cin >> n;
    long long ans=0;
    int m;
    rep(i,1,n+1){
        cin >> m;
        vii.push_back(make_pair(m,i));
    }
    sort(vii.begin(),vii.end());
    int k=1;
    rep(j,0,n){
        int score=vii[j].second;
        int a=max((k-score),(score-k));
        if(a%2)ans++;

       // cout << score << vii[j].first<< " " << j << k << ans <<endl;
         k++;
    }

    int answ=ans/2;
    if(ans%2)answ++;
    cout << answ << endl;
return 0;
}



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

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    int a[50], b[50];
    for (int i = 0; i < m; i++) cin >> a[i] >> b[i];

    for (int i = 0; i < n; i++) {
        int cnt = 0;
        for (int j = 0; j < m; j++) {
            if (a[j] == i+1 || b[j] == i+1) cnt++;
        }
        cout << cnt << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
long long int sequence[200005];

int main(){
    int n;
    cin>>n;
    long long int ans=0;
    for(int i=0;i<n;i++){
        cin>>sequence[i];
    }
    if(sequence[0]>0){
        cout<<-1;
        return 0;
    }
    for(int i=1;i<n;i++){
        if(sequence[i]-sequence[i-1]>1){
            cout<<-1;
            return 0;
        }
        if(sequence[i]==sequence[i-1]+1){
            ans++;
        }
        else{
            ans+=sequence[i];
        }
    }
    cout<<ans;
    return 0;
}


Measured memory_bytes: 1792
# -*- coding: utf-8 -*-
import sys
input = sys.stdin.readline

n,m = list(map(int,input().split()))
ps = [list(input().split()) for i in range(m)]
ps = [[int(v1),v2] for v1,v2 in ps]
pac = [0 for _ in range(n+1)]
pwa = [0 for _ in range(n+1)]
for p,s in ps:
    if pac[p]==1:
        continue
    if s=="AC":
        pac[p]=1
    else:
        pwa[p]+=1
ret_ac = sum(pac)
ret_penalty = 0
for i,v in zip(pac,pwa):
    if i==1:
        ret_penalty+=v
print("{} {}".format(ret_ac,ret_penalty))

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

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

#define pb push_back
#define rep(i, n) for(int i = 0; i < (n); i++)
#define FOR(i, a, n) for(int i = a; i < (n); i++)
#define mod (ll)(1e9+7)
#define int ll
#define INF 100000000

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

signed main() {
	ll d, n;
  cin >> d >> n;
  if(n == 100) n = 101;
  cout << (ll)(pow(100, d) * n) << endl;
	return 0;
}

Measured memory_bytes: 256
import java.util.Scanner;

public class Main {
	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int h = sc.nextInt();
		sc.close();

		System.out.println((a + b) * h / 2);
	}
}


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

bool odd(int n) {
    return n % 2 != 0;
}

int main()
{
    int N; cin >> N;
    vector<int> U(N), V(N);
    for (int i = 0; i < N; i++) {
        int x, y;
        cin >> x >> y;
        U[i] = x + y;
        V[i] = x - y;
    }
    for (int i = 0; i < N; i++) {
        if (odd(U[i]) != odd(U[0])) {
            cout << -1 << endl;
            return 0;
        }
    }
    vector<int> A(31);
    for (int i = 0; i < 31; i++) A[i] = 1 << (30 - i);
    if (!odd(U[0])) A.push_back(1);
    cout << A.size() << endl;
    for (int n : A) cout << n << " ";
    cout << endl;
    for (int i = 0; i < N; i++) {
        long long u = 0, v = 0;
        for (int j = 0; j < A.size(); j++) {
            bool uplus = u < U[i], vplus = v < V[i];
            cout << "LDUR"[uplus * 2 + vplus];
            u += (uplus ? +1 : -1) * A[j];
            v += (vplus ? +1 : -1) * A[j];
        }
        cout << endl;
    }
    return 0;
}

Measured memory_bytes: 256
using System;
using System.Linq;
using System.Collections.Generic;

namespace Algorithm
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = Console.ReadLine();
            var ans = "";

            for (var i = int.Parse(N); i < 1000; i++)
            {
                ans = i.ToString();
                if (ans[0] == ans[1] && ans[1] == ans[2]) break;
            }
            Console.WriteLine(ans);
        }
    }
}


Measured memory_bytes: 13140
while True:
    # read score
    m, f, r = map(int, input().split())
    
    # end judgment
    if m == f == r == -1:
        break
    
    # grades judgment
    if m == -1 or f == -1:
        print('F')
    elif (m+f) >= 80:
        print('A')
    elif 65 <= (m+f) < 80:
        print('B')
    elif 50 <= (m+f) < 65:
        print('C')
    elif 30 <= (m+f) < 50 and r >= 50:
        print('C')
    elif 30 <= (m+f) < 50 and r < 50:
        print('D')
    elif (m+f) < 30:
        print('F')




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

using namespace std;

long long p[100005], v[100005], z[50];

long long calc(long long x){
	long long y = 0;
	while(x > 1){
		x = x / 2;
		++y;
	}
	return y;
}

int main()
{
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	
	long long n, m, s = 0;
	cin >> n >> m;
	for(long long i = 0; i < n; ++i) cin >> p[i];
	sort(p, p + n);
	for(long long i = 0; i < n; ++i){
	    v[i] = calc(p[i]);
	    ++z[v[i]];
	}
//	for(long long i = 0; i < n; ++i) cout << p[i] << " " << v[i] << endl;
    while(m > 0){
    	int pw = v[n - 1];
    	if(m < z[pw]) sort(p, p + n);
    	if(pw == 0){
    		for(long long i = n - 1; i >= 0; --i){
    			if(m){
    			    p[i] = p[i] / 2;
    			    --m;
    			}
    			else break;
			}
			break;
		}
    	for(long long i = n - 1; i >= 0; --i){
    		if(v[i] == pw and m){
    			p[i] = p[i] / 2;
    			--v[i];
    			--m;
    			++z[v[i]];
			}
			else break;
		}
	}
	for(long long i = 0; i < n; ++i){
	    s += p[i];
//	    cout << p[i] << endl;
	}
	cout << s;

	return 0;
}



Measured memory_bytes: 1792
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <algorithm>
#include <string>
#include <sstream>
#include <complex>
#include <vector>
#include <list>
#include <queue>
#include <deque>
#include <stack>
#include <map>
#include <set>
#include <numeric>
//#include <function>
using namespace std;
typedef long long unsigned int ll;

#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))

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


int main() {

  int A, B;
  cin >> A >> B;

  int tmp = 0;
  if (A > B) {

    tmp += A;
    A--;
  }else{

    tmp += B;
    B--;
  }
  tmp += max(A, B);

  cout << tmp << endl;

  return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ull unsigned long long
# define lli long long int
# define ulli unsigned long long int
#define ll long long
#define db double
#define ldb long double
#define vi vector<int>
#define vull vector<ull>
#define vll vector<ll>
#define pb push_back
#define eb emplace_back
#define si set<int>
#define sll set<ll>
#define ins insert
#define rep(i,n) for(int i=0;i<n;i++)
#define vpp vector<pair<int,int>>
#define mp make_pair
#define ft first
#define sc second
#define MAX 9999999
#define MOD 1000000007
using namespace std;
//ll prime[9999999];
// //Modular Exponentiation
// ll fastExpo(ll x, ll n) {
//   if (n == 0) return 1;
//   if ((n & 1) == 0) return fastExpo((x * x) % MOD, n / 2) % MOD;
//   return ((x % MOD) * fastExpo((x * x) % MOD, (n - 1) / 2)) % MOD;
// }
//   //Euclidean Algorithm
// ll gcd(ll a, ll b) {
//   return (b == 0) ? a : gcd(b, a % b);
// }
//  // Extended Euclidean Algorithm
//   ll exgcd(ll a,ll b,ll &x, ll &y){
//   if(b==0){
//     x=1,y=0;
//     return a;
//   }
//    ll x1,y1;
//     ll d=exgcd(b,a%b,x1,y1);
//    x=y1;
//    y=x1-y1*(a/b);
//    return d;
//  }

// void sieve() {
//   prime[0] = 0;
//   prime[1] = 0;
//   for (int i = 2; i < 9999999; i++) {
//     prime[i] = 1;
//   }
//   for (int i = 2; i * i < 9999999; i++) {
//     if (prime[i] == 1) {
//       for (int j = i * i; j < 9999999; j += i) {
//         prime[j] = 0;
//       }
//     }
//   }
// }
// int fi[10009];
// void fun(){
//   for(int i=0;i<10009;i++)fi[i]=i;
//   for(int i=2;i<10009;i++)
//   {   if(fi[i]==i)
//       {
//         for(int j=i;j vt<10009;j+=i)
//         fi[j]=fi[j]*(i-1)/i;
//       }
//   }
//

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(0);
  cout.tie(0);
  //  cout << fixed;
  // cout.precision(2);

  ll n, mm, k;
  cin >> n >> mm >> k;
  ll a[n] = {}, b[mm] = {};
  map<pair<int, int>, int>m;
  while (k--) {
    ll c, d;
    cin >> c >> d;
    c--, d--;
    a[c]++;
    b[d]++;
    m[ {c, d}] = 1;
  }
  ll mxr = *max_element(a, a + n);
  ll mxc = *max_element(b, b + mm);
  vector<int>l, r;
  for (int i = 0; i < n; i++)
  {
    if (a[i] == mxr)
      l.pb(i);
  }
  for (int j = 0; j < mm; j++) {
    if (b[j] == mxc)
      r.pb(j);
  }
  int f = 1;
  for (int i = 0; i < l.size(); i++)
  {
    for (int j = 0; j < r.size(); j++)
    {
      if (!m[ {l[i], r[j]}])
      {
        f = 0;
        break;
      }
    }
    if (!f)break;
  }
  if (f == 0)
    cout << mxr + mxc;
  else
    cout << mxr + mxc - 1;
  return 0;
}







Measured memory_bytes: 30844
#pragma warning (disable:4996)
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
#include <string>
#include <cstdio>
#include <cmath>
#define inf 0X7f7f7f7f
#define MS_I(x) memset(x,-inf,sizeof(x))
#define MS(x) memset(x,0,sizeof(x))
#define MSI(x) memset(x,inf,sizeof(x))
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
using namespace std;

int main()
{
	int a, b, c, d;
	scanf("%d %d %d %d", &a, &b, &c, &d);
	int minn = inf;
	minn = min(minn, a + c);
	minn = min(minn, a + d);
	minn = min(minn, b + c);
	minn = min(minn, b + d);
	cout << minn;
	return 0;
}

Measured memory_bytes: 256
//http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=ALDS1_10_C&lang=jp




#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)

using namespace std;

const int MAX_q=160;
const int MAX_L=1010;
bool done[MAX_L][MAX_L];
int memo[MAX_L][MAX_L];
int q;
string x,y;

int LCS(int i,int j)
{
    int res;

    if(i<0) return 0;
    if(j<0) return 0;

    if (done[i][j]) return memo[i][j];

    else if(x[i]==y[j])
    {
        res=LCS(i-1,j-1)+1;
    }
    else{
        int res1=LCS(i-1,j);
        int res2=LCS(i,j-1);
        res=max(res1,res2);
    }
    done[i][j]=true;
    memo[i][j]=res;
    return res;
}

int main()
{
    int res;
    cin>>q;
    rep(i,q)
    {
        cin>>x>>y;
        res=LCS(x.length()-1,y.length()-1);
        cout<<res<<"\n";
        rep(j,MAX_L)
        {
            rep(k,MAX_L)
            {
                done[j][k]=false;
            }
        }
    }


    return 0;
}


Measured memory_bytes: 8092
import java.io.PrintWriter;
import java.util.*;
public class Main {
   
	static int c;
	static int []w;
	static int []v;
	static long [][]dp;
	static int n;
	
	public static long KnapSack(int idx,int remw) {
		if(remw<0) {
			return -(int) 1e9;
		}
		if(idx==n) {
			return 0;
		}
		if(dp[idx][remw]!=-1) {
			return  dp[idx][remw];
		}	
		long take=v[idx]+KnapSack(idx+1,remw-w[idx]);
		long leave=KnapSack(idx+1,remw);
		return dp[idx][remw]=Math.max(take, leave);
	}
	
	public static void main(String[] args) {
    Scanner sc=new Scanner (System.in);
    PrintWriter pw=new PrintWriter(System.out);
    n=sc.nextInt();
    c=sc.nextInt();
    w=new int[n];
    v=new int[n];
    dp=new long[n][c+1];
    for(long[] x:dp)
        Arrays.fill(x, -1);
    for(int i=0;i<n;i++) {
    	w[i]=sc.nextInt();
    	v[i]=sc.nextInt();
    }
    pw.println(KnapSack(0,c));
    pw.flush();
	}

}


Measured memory_bytes: 131712
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <bitset>
#include <map>
#include <set>
#include <vector>
#include <list>
#include <queue>
#include <sstream>
#include <cmath>
#include <functional>
#include <climits>
using namespace std;

#define rep(i,n) for(int i=0;i<n;i++)
#define reps(s,i,n) for(int i=s;i<n;i++)
#define rev(i,n) for(int i=n-1;i>=0;i--)
#define skip(i,n,p) for(int i=0;i<n;i+=p)
#define all(a)  (a).begin(),(a).end()
#define int64 long long
#define debug cerr << __FILE__ << ":" << __LINE__ << endl;
#define INF 2147483647

struct Init {
    Init() {
        cin.tie(0);
        ios::sync_with_stdio(false);
        cout.precision(20);
        cout << fixed;
        // setw(6) << setfill('0')
    }
} init;

template <typename _Ty>
ostream& operator << (ostream& ostr, const vector<_Ty>& v) {
    for(int i = 0; i < (int) v.size(); i++) {
        ostr << v[i] << (i + 1 != v.size() ? " " : "");
    }
    return ostr;
}

template <typename _K, typename _V>
ostream& operator << (ostream& ostr, const map<_K, _V>& v) {
    ostr << "{";
    for (auto iter = v.begin(); iter != v.end(); ++iter) {
        ostr << (*iter).first << ": " << (*iter).second << ", ";
    }
    ostr << "}";
    return ostr;
}

template <typename _K>
ostream& operator << (ostream& ostr, const set<_K>& v) {
    for (auto iter = v.begin(); iter != v.end(); ++iter) {
        ostr << *iter << (iter != v.end() ? " " : "");
    }
    return ostr;
}

template <typename _K, typename _V>
ostream& operator << (ostream& ostr, const pair<_K, _V>& v) {
    ostr << "(" << v.first << ", " << v.second << ")";
    return ostr;
}

vector<string> split(const string &s, char delim) {
    vector<string> result;
    stringstream ss(s);
    string item;
    while (getline(ss, item, delim)) {
        if (!item.empty()) {
            result.push_back(item);
        }
    }
    return result;
}

int main() {
    int N, K; cin >> N >> K;
    vector<int> L(N); rep(i, N) cin >> L[i];

    sort(all(L));
    int64 ans = 0;
    rep(i, K) ans += L[i];

    cout << ans << endl;
}


Measured memory_bytes: 3664
#include<iostream>
using namespace std;
int main()
{
  int n;
  cin>>n;
  int a[n+1];
  for(int i=1;i<=n;i++)
  {
    cin>>a[i];
  }
  float sum=0;
  for(int i=1;i<=n;i++)
  {
    sum=sum+(1/float(a[i]));
  }
  cout<<(1/sum);
  return 0;
}

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

int main(){
  int N;cin>>N;
  vector<int>a(N);
  rep(i,N) cin>>a[i];
  sort(a.begin(),a.end());
  cout<<a[N-1]-a[0]<<endl;
}

Measured memory_bytes: 3536
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <string>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int mod = 1000000007;

int main() {
    ios::sync_with_stdio(false);
    int n, a[102] = {}, b = 0;
    cin >> n;
    for (int i = 0; i < n; i++) cin >> a[i];
    sort(a, a + n); reverse(a, a + n);
    for (int i = 0; i < n; i++) b += a[i] * (!(i % 2) * 2 - 1);
    cout << b;
}


Measured memory_bytes: 256
// ********* Assalamualaikum****** IN the name of my Almighty****:):)***
#include<bits/stdc++.h>
using namespace std;
#define suni ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl "\n"
#define f(i,a,b) for(int i=a;i<= b;i++)
#define ff(i,a,b) for(int i= a;i>=b;i--)
#define T int t; cin >>t; while(t--)
#define vi  vector<int>
#define vll vector<long long>
#define vs vector<string>
#define vp vector<pair
#define pii pair<int,int>
#define pb push_back
#define mk make_pair
#define b(a) a.begin(),a.end()
#define rb(a) a.rbegin(),a.rend()
#define I  int
#define ll long long
#define st string
#define C char
#define MN int main()
#define fa(u,v) for(auto u:v)

 MN
 {
     I n;
     cin>> n;
     map<I,I>m;
     f(i,1,n) {
         I a;
         cin>>a;
         m[a]++;
     }
     I cnt=0;
     fa(u,m){
         if(u.second>=u.first) cnt+=(u.second-u.first);
         else cnt+=u.second;
     }
     cout<<cnt<<endl;
 }
//*******Happy Coding*******???******



Measured memory_bytes: 8060
#include <iostream>
#define ll long long
using namespace std;

int main() {
    ll n;
    cin >> n;
    ll sum, result = 0;
    cin >> sum;
    n--;

    while (n--) {
        ll temp;
        cin >> temp;
        result += temp * sum;
        sum += temp;

        sum %= 1000000007;
        result %= 1000000007;
    }

    cout << result;
}


Measured memory_bytes: 3624
from collections import Counter
N,K = map(int, input().split())
A = list(map(int, input().split()))
A = list(map(lambda x: x%K, A))

"""
j - i < K and
Sj - Si == j - i (mod K)
Sj - j == Si - i (mod K) この変形が肝だ…
"""

S = [0 for _ in range(N+1)]
for i in range(N):
  S[i+1] = (S[i] + A[i] - 1) % K
ans = 0
C = Counter(S[:K])
for k,v in C.items():
  ans += v * (v-1) // 2
  
for i in range(K,N+1):
  deln = S[i-K]
  C[deln] -= 1
  addn = S[i]
  if addn in C:
    ans += C[addn]
    C[addn] += 1
  else:
    C[addn] = 1
    
print(ans)

Measured memory_bytes: 159368
#include <cstdio>
#include <cstring>
#include <vector>
#include <map>
#include <algorithm>

#define rep(i, j) FOR(i, 0, j)
#define FOR(i, j, k) for(int i = j; i < k; ++i)

using namespace std;

int main(){
  int a[6][2] = { {3,4},{4,3},{1,4},{-1,5},{3,-1},{2,1} };
  char p[128];
  while(scanf("%s", p) & p[0] != '#'){
    int n = 0;
    for(int i = 0; p[i] != '\0'; ++i){
      n = a[n][p[i] - '0'];
      if(n == -1) break;
    }
    puts(n == 1 ? "Yes":"No");
  }
  return 0;
}

Measured memory_bytes: 948
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;

using Pair = System.Collections.Generic.KeyValuePair<int, int>;

class Program
{
	public Program() { }

	static void Main(string[] args)
	{
		new Program().prog();
	}
	Scanner cin;
	const int MOD = 1000000007;
	const int INF = int.MaxValue;
	const double EPS = 1e-7;
	const double PI = 3.1415926536;

	void prog()
	{
		cin = new Scanner();
		int[,] dir8 = new int[8, 2] { { -1, -1 }, { -1, 0 }, { -1, 1 }, { 0, -1 }, { 0, 1 }, { 1, -1 }, { 1, 0 }, { 1, 1 } };
		int[,] dir4 = new int[4, 2] { { -1, 0 }, { 0, -1 }, { 0, 1 }, { 1, 0 } };

		int a = cin.nextInt();
		int b = cin.nextInt();
		if (a > 0)
		{
			Console.WriteLine("Positive");
		}
		else if(a == 0 || b == 0 || (a < 0 && b > 0))
		{
			Console.WriteLine("Zero");
		}
		else
		{
			if ((b - a) % 2 == 0)
			{
				Console.WriteLine("Negative");
			}
			else
			{
				Console.WriteLine("Positive");
			}
		}
	}
}

class Scanner
{
	string[] s;
	int i;

	char[] cs = new char[] { ' ' };

	public Scanner()
	{
		s = new string[0];
		i = 0;
	}

	public string next()
	{
		if (i < s.Length) return s[i++];
		string st = Console.ReadLine();
		while (st == "") st = Console.ReadLine();
		s = st.Split(cs, StringSplitOptions.RemoveEmptyEntries);
		i = 0;
		return next();
	}

	public int nextInt()
	{
		return int.Parse(next());
	}

	public long nextLong()
	{
		return long.Parse(next());
	}

	public double nextDouble()
	{
		return double.Parse(next());
	}
}

Measured memory_bytes: 2904
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define rep(i,n) for( int i = 0; i < n; i++ )
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define INF 2000000000
#define mod 1000000007
#define INF2 1000000000000000000


int main(void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    int N, K;
    cin >> N >> K;
    int ans = 1;
    int cnt = 0;
    while (ans < K && cnt < N) {
        ans *= 2;
        cnt++;
    }
    while (cnt < N) {
        ans += K;
        cnt++;
    }
    cout << ans << endl;

    return 0;
}


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

const long long INF = 1e7 + 1;
const long long MOD = 1000000007;
const long double PI = 3.1415926;

#define FOR(i,r,n) for(ll i = (ll)(r); i < (ll)(n); ++i)
#define RFOR(i,r,n) for(ll i = (ll)(n-1); i >= r; --i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(x) x.begin(),x.end()
#define RALL(x) x.rbegin(),x.rend()

using ll = long long int;
using ull = unsigned long long int;
using vi = vector<ll>;
using vp = vector<pair<ll, ll>>;
using vs = vector<string>;
using vc = vector<char>;
using lst = list<ll>;

ll n, m, k, ans = 0, sum = 0, cnt = 0;
string s;
char c;

/*--------------------template--------------------*/

int main() {
    cin >> n >> k;
    cout << (n*3+k)/2 << endl;
}


Measured memory_bytes: 256
/*
  AOJ 0145
  Title:Cards
  @kankichi573
*/
#include <stdio.h>
#include <string.h>
#include <limits.h>

#define max(x,y) (((x)>(y))?(x):(y))
#define min(x,y) (((x)<(y))?(x):(y))

int n,a[100],b[100],memo[100][100];
int solve(int start,int len)
{
  int i,min_,cost,cost1,cost2,ret;

#ifdef DEBUG
  for(i=0;i<len;i++)
    printf("%d %d|",a[start+i],b[start+i]);
  printf("[%d]\n",len);
#endif
  if(ret=memo[start][len])
    return(ret);
  if(len==1)
    return(0);
  if(len==2)
    {
      cost = a[start]*b[start]*a[start+1]*b[start+1];
#ifdef DEBUG
      printf("%d*%d*%d*%d=%d \n",a[start],b[start],
           a[start+1],b[start+1],cost);
#endif
      return(cost);
    }
  min_=INT_MAX;
  for(i=0;i<len-1;i++)
    {

      cost = a[start]*b[start+i]*a[start+i+1]*b[start+len-1];
#ifdef DEBUG
      printf("%d*%d*%d*%d=%d [%d]\n",a[start],b[start+i],
           a[start+i+1],b[start+len-1],cost,i);
#endif
      cost1=solve(start,i+1);
      cost2=solve(start+i+1,len-1-i);
#ifdef DEBUG
      printf("c12=%d %d\n",cost1,cost2);
#endif
      cost += (cost1+cost2);
      min_=min(min_,cost);
    }
  memo[start][len]=min_;
  return(min_);
}

main()
{
  int i,ret;
  
  scanf("%d",&n);
  
  for(i=0;i<n;i++)
    scanf("%d %d",&a[i],&b[i]);
  
  ret=solve(0,n);
  printf("%d\n",ret);
  
  return(0);
}

Measured memory_bytes: 632
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
Q = int(input())
ans = sum(A)
num = Counter(A)
for i in range(Q):
    b,c = map(int,input().split())

    ans += (c-b)*num[b]
    num[c] += num[b] 
    num[b] = 0
    
    print(ans)

Measured memory_bytes: 24136
import java.util.Scanner;

public class Main {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = Integer.parseInt(sc.next());
        String s = sc.next();
        StringBuilder sb = new StringBuilder();
        for (int i = 0; i < s.length(); i++) {
            char c = s.charAt(i);
            for (int j = 0; j < n; j++) {
                c++;
            }
            if (c > 90) {
                c -= 26;
            }
            sb.append(c);
        }
        sb.append("\n");
        System.out.println(sb.toString());
    }
}

Measured memory_bytes: 24532
#include<cstdio>
#include<cstring>
#include<vector>
#include<stack>
#include<iostream>
#include<algorithm>
#include<cmath>
#include<map>
#define maxn 200100

using namespace std;
vector<long long>q[maxn];
int  main()
{
	long long N,K;
	long long a[maxn];
	long long ma[maxn],L[maxn];
	scanf("%lld%lld",&N,&K);
	for(long long i=0;i<N;i++)
	{
		scanf("%lld",&a[i]);
		q[a[i]].push_back(i);
	}
	for(long long i=0;i<maxn;i++)
		if(!q[i].empty())
			L[i]=q[i].size();
	long long o=a[N-1],p=1,sign=N-1;
	while(1)
	{
		int S=lower_bound(q[o].begin(),q[o].end(),sign)-q[o].begin();
		if(S==0)
		{
			S=L[o]-1;
			p++;
		}
		else
			S--;
		if(q[o][S]==0)
			break;
		else
		{
			sign=(q[o][S]+N-1)%N;
			o=a[sign];
		}
	}
	//printf("%lld\n",p);
	K=K%p;
	stack<long long>U;
	for(long long j=0;j<maxn;j++)
		ma[j]=0;
	o=a[0]; p=1;sign=0;
	while(1&&K!=0)
	{
		//printf("1\n");
		int S=lower_bound(q[o].begin(),q[o].end(),sign)-q[o].begin();
		//printf("1\n");
		//printf("%d %lld\n",S,L[o]-1);
		if(S==L[o]-1)
		{
			//printf("%lld %lld\n",p,K);
			
			if(p==K)
				U.push(o);
			else
			{
				//printf("1\n");
				S=0;
				p++;
			}
			//printf("1\n");
		}
		else
			S++;
		
		//printf("1\n");
		sign=q[o][S]+1;
		if(p==K&&sign==N)
			break;
		else
		{
			sign%=N;
			o=a[sign];
		}
		//printf("%lld %lld\n",o,sign);
		//printf("%d\n",U.size());
	}
	long long f[maxn];
	long long l=U.size();
	for(long long i=l;i>0;i--)
	{
		f[i]=U.top();
		U.pop();
	}
	for(long long i=1;i<=l;i++)
		printf("%lld ",f[i]);
	printf("\n");
}
	
					
	

Measured memory_bytes: 18232
#include <iostream>
#include <algorithm>

using namespace std;

typedef long long ll;

inline ll lcm(ll n, ll m)
{
    return m * n / __gcd(n, m);
}

int main()
{
    ll a[3], m[3];

    while (true) {
        ll sum = 0;
        for (int i = 0; i < 3; i++) {
            cin >> a[i] >> m[i];
            sum += (a[i] + m[i]);
        }
        if (sum == 0)
            break;

        ll x[3] = {1, 1, 1}, cnt = 0;
        ll t[3] = {0};

        for (int i = 0; i < 3; i++) {
            while (true) {
                x[i] = (a[i] * x[i]) % m[i];

                t[i]++;
                if (x[i] == 1)
                    break;
            }
        }

        cout << lcm(lcm(t[0], t[1]), t[2]) << endl;
    }

    return 0;
}

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

int main(void){
    long long N;
    string S;
    cin >> N >> S;
    long long b = 0;
    long long w = 0;
    for(long long i = 0; i < N; i++){
        if(S[i] == '#'){
            b++;
        }else{
            w++;
        }
    }
    long long BL = 0;
    long long WR = w;
    long long ans = w;
    for(long long i = 0; i < N; i++){
        if(S[i] == '#'){
            BL++;
        }else{
            WR--;
        }
        ans = min(ans,BL + WR);
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 640
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <functional>
#include<numeric>
#include<cmath>
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define INF 2e9
#define ALL(v) v.begin(), v.end()
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> pll;
typedef vector<vector<int> > vvi;
typedef vector<vector<ll> > vll;
const ll inf = 1LL << 60;

int main(){
    cin.tie(nullptr);
	ios_base::sync_with_stdio(false);
	//cout << fixed << setprecision(15);
    int N,K;cin>>N>>K;
    int A[N];
    REP(i,N){
        cin>> A[i];
    }
    int maxi=min(K,150);
    REP(i,maxi){
        vector<int> imos(N,0);
        REP(i,N){
            if(i-A[i] < 0) imos[0]++;
            else imos[i - A[i]]++;

            if(i+A[i]+1>N-1) continue;
            else imos[i+A[i]+1]--;
        }
        A[0] = imos[0];
        REP(i,N-1){
            A[i+1] = A[i] + imos[i+1];
        }
    }

    REP(i,N){
        cout<<A[i] << endl;
    }
}

Measured memory_bytes: 5128
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
long n0=2;
long n1=1;
long n2=3;
int n=sc.nextInt();
if(n==0){
	System.out.println(2);
}else if(n==1){
	System.out.println(1);
}else{
for(int i=2;i<=n;i++){

	n2=n0+n1;
	n0=n1;
	n1=n2;

	}
System.out.println(n2);

	}}}

Measured memory_bytes: 22100
import itertools

def factorization(n):
    arr = []
    temp = n
    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr

n = int(input())
n_list = factorization(n)
cnt = 0
cnt_list = range(100)
cnt_list = list(itertools.accumulate(cnt_list))
for i in n_list:
    tmp = 0
    if i[0] != 1:
        for j in range(1, 100):
            if cnt_list[j] <= i[1]:
                tmp = j
            else:
                cnt += tmp
                break
print(cnt)

Measured memory_bytes: 9504
#include<iostream>
 #include<string>
 using namespace std;
 
 int main()
 {
 	string a,b,c;
 	while(cin>>a>>b>>c)
 	{
 		char x=a[0];
 		char y=b[1];
 		char z=c[2];
 		
 		cout<<x<<y<<z<<endl;
	 }
 	return 0;
 }

Measured memory_bytes: 256
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author Abhijeetkns
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        Scanner in = new Scanner(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        BAlgae solver = new BAlgae();
        solver.solve(1, in, out);
        out.close();
    }

    static class BAlgae {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            long r = in.nextLong();
            long d = in.nextLong();
            long x = in.nextLong();
            for (int i = 0; i < 10; i++) {
                long xnew = r * x - d;
                x = xnew;
                out.println(xnew);
            }
        }

    }
}



Measured memory_bytes: 23892
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
using namespace __gnu_pbds;   
#define ordered_set tree<ll, null_type,less<ll>, rb_tree_tag,tree_order_statistics_node_update> 
#define ld long double
#define ff first
#define ss second
#define pb push_back
#define mp make_pair
#define all(a) a.begin(),a.end()
#define sz(a) (ll)(a.size())
int main()
{
	ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
	int n,m;
	cin>>n>>m;
	int a[n+1];
	int s=0;
	for(int i=1;i<=n;i++)
	{
		cin>>a[i];
		s+=a[i];
	}
	int r=0;
	for(int i=1;i<=n;i++)
	{
		if(4*m*a[i]>=s)
			r++;
	}
	if(r>=m)
		cout<<"Yes\n";
	else
		cout<<"No\n";
	return 0;
}

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

typedef long long ll;
typedef long double ld;
typedef pair<int, int> ii;
typedef pair<int, ii> iii;
typedef pair<ii, int> ri3;
#define mp make_pair
#define pb push_back
#define fi first
#define sc second
#define SZ(x) (int)(x).size()
#define ALL(x) begin(x), end(x) 
#define REP(i, n) for (int i = 0; i < n; ++i) 
#define FOR(i, a, b) for (int i = a; i <= b; ++i)
#define RFOR(i, a, b) for (int i = a; i >= b; --i)

int main() {
    //freopen("in.txt", "r", stdin);
    ios::sync_with_stdio(false);
    cin.tie(0);

    int A, B; cin >> A >> B;
    cout << (ll)A*B/__gcd(A,B);
}



Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <algorithm>
#include <climits>
#include <vector>
#include <string>
#include <set>
#include <iomanip>
#include <map>
#define rep(i,n) for (int i=0;i<(n);++i)
#define REP(i,n) for (int i=0;i<=(n);++i)
#define all(x) (x).begin(), (x).end()
using namespace std;
typedef long long ll;
const int INF = 10000000;

int gcd(int a,int b){return b?gcd(b,a%b):a;}

int main() {
    string s, t; cin >> s >> t;
    int ans = 0;
    for(int i = 0; i < s.size(); ++i) {
        if(s[i] != t[i]) {
            ++ans;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 3916
n,k=map(int,input().split())
l=[]
for _ in range(n):
    l.append(int(input()))
l.sort()
a=0
for i in range(n-k+1):
    if i==0:
        a=l[i+k-1]-l[i]
    else:
        a=min(a,abs(l[i+k-1]-l[i]))
print(a)


Measured memory_bytes: 51288
import java.util.Scanner;

class Main {
    public static void main(String[] args) {

        Scanner sc = new Scanner(System.in);

        while (true) {

            int h = sc.nextInt();
            int w = sc.nextInt();

            if (h == 0 && w == 0) break;

            for (int i = 0; i < h; i++) {
                for (int j = 0; j < w; j++) {

                    if (i == 0 || i == h - 1 || j == 0 || j == w-1) {
                        System.out.print("#");
                    } else {
                        System.out.print(".");
                    }
                }
                System.out.println();
            }
            System.out.println();
        }
        sc.close();
    }
}


Measured memory_bytes: 37376
#include<bits/stdc++.h>
	using namespace std;
	typedef pair<int,int> pi;
	vector<pi>city;
	map<pi,string>hasher;
	vector<int>establish[100005];
	
	int main(){
		int n,m;
		cin>>n>>m;
		for(int i=0; i<m; i++){
			int a,b;
			cin>>a>>b;
			city.push_back(pi(a,b));
			establish[a].push_back(b);
		}
		for(int i=1; i<=n; i++) sort(establish[i].begin(),establish[i].end());
		for(int i=1; i<=n; i++){
			if(establish[i].size()){
				for(int j=0; j<establish[i].size(); j++){
					int first_id = i;
					int second_id = j+1;
					string s = "000000000000";
					int p = 5;
					while(first_id){
						s[p--] = (first_id%10+'0');
						first_id/=10;
					}
					p = 11;
					while(second_id){
						s[p--] = (second_id%10+'0');
						second_id/=10;
					}
					hasher.insert(make_pair(pi(i,establish[i][j]),s));
				}
			}
		}
		for(int i=0; i<city.size(); i++){
			cout<<hasher.find(pi(city[i].first,city[i].second))->second<<'\n';
		}
	}

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

main(){
    string weather[3]= {"Sunny", "Cloudy", "Rainy"};
    int i;
    string s;
    cin >> s;
    for (i=0; i < 3; i++) {
        if (s.compare(weather[i])==0) {
            if (i!=2) {
                cout << weather[i+1];
                break;
            } else {
                cout << weather[0];
                break;
            }
        }
    }
    return 0;
}

Measured memory_bytes: 256
import std.stdio, std.array, std.string, std.conv, std.algorithm;
import std.typecons, std.range, std.random, std.math, std.container;
import std.numeric, std.bigint, core.bitop, std.bitmanip;

void main() {
    auto N = readln.chomp.to!int;

    int ds(int x) {
        int ret = 0;
        while (x > 0) ret += x % 10, x /= 10;
        return ret;
    }

    int ans = 1 << 29;
    foreach (i; 1..N) {
        int j = N - i;
        ans = min(ans, ds(i) + ds(j));
    }

    ans.writeln;
}


Measured memory_bytes: 256
#include <iostream>

#define llong long long
#define rep(i,l,n) for(int (i)=(l);(i)<(n);(i++))

using namespace std;

int main(){
	string S,T;
	cin >> S >> T;
	int ans=0,i=0;
	while( S[i]!=0 ){
		if( S[i]!=T[i] ) ans++; i++;
	}
	cout << ans;
	return 0;
}


Measured memory_bytes: 3904
#include <bits/stdc++.h>
#define fore(i,a,b) for(int i = a; i < b; i++)
#define fst first
#define snd second
#define ll long long
#define all(x) x.begin(), x.end()
#define sz(x) (int)x.size()
#define pii pair<int,int>
#define piii pair<int, pii>
#define pll pair<ll,ll>
#define vi vector<int>
#define vll vector<ll>
#define pb push_back
#define mp make_pair
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)

using namespace std;

const int N_MAX = 1e6+15;

int main(){
    ll N;
    cin>>N;
    ll ans = 0LL;
    for(ll i=2LL; i*i<=N; i++){
        if(N%i==0LL){
            int cnt = 0;
            while(N%i==0LL){
                cnt++;
                N/=i;
            }
            int x=1;
            while(cnt-x>=0){
                ans++;
                cnt-=x;
                x++;
            }
        }
    }
    if(N!=1LL){
        ans++;
    }
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3636
//#include <bits/stdc++.h>
#include<iostream>
#include <iosfwd>
#include<limits.h>
#include <sstream>
#include <iomanip>
#include <iterator>
#include <algorithm>
#include <limits>
#include<stdio.h>
#include <queue>
#include <stack>
#include <math.h>
#include<string.h>
#include <unordered_map>
#include <map>
#include <unordered_set>
#include <set>
#include<vector>
#include <chrono>
#include <random>
using namespace std;
#define fr(i,j,n)   for(lli i=j;i<(n);++i)
#define bk(i,j,n)   for(lli i=j;i>=n&&j>=n;--i)
#define pb push_back
#define m_p make_pair
#define F first
#define S second
#define endl "\n"
#define MOD 1000000007
#define mem(p,v) memset(p,v,sizeof(p))
#define present(c,x)    ((c).find(x) != (c).end())
#define run ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define ordered_set tree<lli, null_type,less<lli>, rb_tree_tag,tree_order_statistics_node_update>
#define debug1(x) cout<<#x<<" "<<x<<endl;
#define debug2(x,y) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<endl;
#define debug3(x,y,z) cout<<#x<<" "<<x<<" "<<#y<<" "<<y<<" "<<#z<<" "<<z<<endl;
#define ub upper_bound
#define lb lower_bound
typedef long long int lli;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<lli> vl;
typedef pair<lli,lli> pl;
inline lli max(lli a,lli b){ return a>b?a:b;}
inline lli min(lli a,lli b){ return a<b?a:b;}
const long long inf = 9e18;
double pie = 2*acos(0.0);
void show(vector<lli> v){fr(i,0,v.size())cout<<v[i]<<" ";cout<<endl;}
void show(vector<int> v){fr(i,0,v.size())cout<<v[i]<<" ";cout<<endl;}
void show(int a[], int arraysize){for (int i = 0; i < arraysize; ++i)cout << a[i] << " ";cout<<endl;}
void show(lli a[], lli arraysize){for (lli i = 0; i < arraysize; ++i)cout << a[i] << " ";cout<<endl;}
void show(bool a[], lli arraysize){for (lli i = 0; i < arraysize; ++i)cout << a[i] << " ";cout<<endl;}
void show(set<int> s){for (auto it = s.begin(); it != s.end(); it++){cout << *it << " ";}cout<<endl;}
void show(map<lli,lli> mp){for (auto it = mp.begin(); it != mp.end(); it++){cout << it->first << " "<<it->second<<endl;}cout<<endl;}

lli modpow(lli x,lli n){lli res=1;while(n>0){if(n&1) res=((res%MOD)*(x%MOD))%MOD;x=((x%MOD)*(x%MOD))%MOD;n>>=1;}return res;}
lli power(lli x, lli n){lli res=1;while(n>0){if(n&1) res=res*x;x=x*x;n>>=1;}return res;}

/////// ------ Main code starts here ------ /////
void solve()
{
    lli n;
    cin>>n;
    lli a[n];
    fr(i,0,n)
    {
        cin>>a[i];
    }
    lli dp[n];
    dp[0]=0;
    fr(i,1,n)
    {
        if(i==1)
            dp[1]=abs(a[1]-a[0]);
        else
        {
            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]<<endl;
}
int main()
{
    run;cout<<fixed<<setprecision(12);
    int t;
    t=1;
    while(t){solve();t--;}
    return 0;
}


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

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

	bool exist = false;
	int a, b, c;
	for (int i = 0; i <= n; i++) {
		for (int j = 0; j <= n; j++) {
			int z = n - i - j;
			if ((0 <= z && z <= n) && (10000 * i + 5000 * j + 1000 * z == y)) {
				exist = true;
				a = i, b = j, c = z;
				break;
			}
		}
	}

	if (exist) cout << a << " " << b << " " << c << endl;
	else cout << "-1 -1 -1" << endl;

	return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ProCon
{
    class Program
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());
            string retStr = "No";

            for (int i = 1; i < 10; i++ )
            {
                for(int j = 1; j < 10; j++)
                {
                    if(N == i * j)
                    {
                        retStr = "Yes";
                        break;
                    }
                }
            }

            Console.WriteLine(retStr);
            Console.ReadKey();
        }

    }
}


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

int main(){
  stack<int> sk;
  string sg;

  int a,b;
  while(cin >> sg){
    switch(sg[0]){
      case '+':
        a = sk.top(); sk.pop(); b = sk.top(); sk.pop();
        sk.push(a + b);
        break;

      case '-':
        a = sk.top(); sk.pop(); b = sk.top(); sk.pop();
        sk.push(-a + b);
        break;

      case '*':
        a = sk.top(); sk.pop(); b = sk.top(); sk.pop();
        sk.push(a * b);
        break;

      default:
        sk.push(atoi(sg.c_str()));
        break;
    }
  }

  cout << sk.top() << endl;

  return 0;
}



Measured memory_bytes: 3224
/*** author: yuji9511 ***/
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> lpair;
const ll MOD = 1e9 + 7;
const ll INF = 1e18;
#define rep(i,m,n) for(ll i = (m); i < (n); i++)
#define rrep(i,m,n) for(ll i = (m); i >= (n); i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(ll i = 0; i < n; i++){ cout << (x[i]) << " \n"[i==n-1];};
int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    string S,T;
    cin >> S >> T;
    ll ans = 0;
    rep(i,0,3){
        if(S[i] == T[i]) ans++;
    }
    print(ans);
    
}

Measured memory_bytes: 256
#include <algorithm>
#include <bitset>
#include <complex>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#include <climits>
#include <cstring>

#define rep(i, m, n) for(int i=int(m);i<int(n);i++)
#define all(c) begin(c),end(c)

template<typename T1, typename T2>
inline void chmin(T1 &a, T2 b) { if (a > b) a = b; }

template<typename T1, typename T2>
inline void chmax(T1 &a, T2 b) { if (a < b) a = b; }

typedef long long int ll;
using ll = long long int;
using ull = long long unsigned int;
using Int = long long int;
using namespace std;
#define INF (1 << 30) - 1
#define INFl (ll)5e15
#define DEBUG 0
#define dump(x)  cerr << #x << " = " << (x) << endl
#define MOD 1000000007


//edit
class Solve {
public:
    void solve() {
        Int K, X;
        cin >> K >> X;
        if (K * 500 >= X) {
            cout << "Yes" << endl;
        } else {
            cout << "No" << endl;
        }
    }
};


int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(10);

    Solve().solve();


    return 0;
}


Measured memory_bytes: 888
#include <bits/stdc++.h>
 using namespace std;
 
int main(){
     int N,A,maxx,minn;
     cin>>N;
     for(int i=0;i<N;i++){
       cin >>A;
       maxx=max(maxx,A);
       minn=i==0?A:min(minn,A);
     }
     cout << maxx-minn << endl;
 }


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <iomanip>
#include <cmath>
#include <map>
#include <cmath>
#include <bitset>
#include <string>

using namespace std;

#define int long long

signed main() {
    int n;
    cin >> n;
    string s;
    cin >> s;

    string t;
    for(int i = 0; i < n; i++) {
        if(s[i] != s[i + 1]) t.push_back(s[i]);
    }

    cout << t.size() << endl;
    return 0;
}

Measured memory_bytes: 640
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<=b;i++)
#define per(i,a,b) for(int i=a;i>=b;i--)
#define rusha scanf("%d",&n);rep(i,1,n)scanf("%d",&a[i]);
#define rushb scanf("%d",&t);while(t--)
#define debug(x) cout<<"LBWNB    "<<x<<"---\n"
#define pb push_back
#define pii pair<int,int>
#define fi first
#define se second
#define mp make_pair
#define p() puts("")
#define mem(a,b) memset(a,b,sizeof a)
#define all(x) (x.begin(),x.end())
#define judgef printf("%s\n",f?"Yes":"No")
#define Judgef printf("%s\n",f?"YES":"NO")

using namespace std;
typedef long long ll;
const int mod=998244353;
const int inf=1e9+7;
const int maxn=2e3+10;
int a[maxn],b[maxn],dis[maxn];
int n,x,y;
int dfs(int k){
    if(k==x&&dis[y]>dis[x]+1){
        dis[y]=dis[x]+1;
        dfs(y);
    }
    if(k==y&&dis[x]>dis[y]+1){
        dis[x]=dis[y]+1;
        dfs(x);
    }
    if(dis[k+1]>dis[k]+1){
        dis[k+1]=dis[k]+1;
        dfs(k+1);
    }
    if(dis[k-1]>dis[k]+1){
        dis[k-1]=dis[k]+1;
        dfs(k-1);
    }
}
int main(){
    scanf("%d%d%d",&n,&x,&y);
    rep(i,1,n){
        rep(j,1,n) dis[j]=inf;
        dis[i]=0;
        dfs(i);
        rep(j,1,n) b[dis[j]]++;
    }
    rep(i,1,n-1) printf("%d\n",b[i]/2);
    return 0;
}

Measured memory_bytes: 384
#include <cstdio>
#include <algorithm>
#include <iostream>
#include <iomanip>
#include <cstring>
using namespace std;

long long n, r;
int main()
{
	cin >> n >> r;
	if (n >= 10) cout << r;
	else cout << r + 100 * (10 - n);
}

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

int main(){
  int a, b, c, x;
  cin >> a >> b >> c;
  for(int i = a; i < b+1; i++){
    if( c%i == 0 ){
      x++;
    }   
  }
  cout << x << endl;
  return 0;
}


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

int main()
{
    int k, t;
    cin >> k >> t;
    int a[102];
    for(int i = 0; i < t; i++) cin >> a[i];
    sort(a, a + t, greater<int>());
    cout << max(0, a[0] - (k - a[0]) - 1) << endl;
}

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

//ユークリッドの互除法
ll gcd(ll x,ll y){
    if (x%y==0)return y;
    else gcd(y,x%y);
}

//素因数分解
vector<pair<ll,int>> factorize(ll n){
    vector<pair<ll,int>> res;
    for(ll i = 2; i*i <=n ; ++i){
        if (n%i)continue;
        res.emplace_back(i,0);
        while (n%i==0){
            n/=i;
            res.back().second++;
        }
    }
    if (n!=1) res.emplace_back(n,1);
    return res;
}

int main() {
  ll a,b;
  cin >> a >> b;
  ll g=gcd(a,b);
  vector<pair<ll,int>> p;
  p=factorize(g);
  int ans=p.size()+1;
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <algorithm>
#include <numeric>
#include <functional>
#include <cmath>
#include <queue>
#include <stack>
#include <bitset>
#include <map>
#include <string>
#include <utility>

#define repd(i,a,b) for(ll i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
typedef long long ll;

using namespace std;

int inputValue();
void inputArray(int*,int);
void inputVector(vector<int>*,int);
template <typename T>
void output(T,int);
int gcd(int a,int b);

int main(){
	//source
	vector<int> num;
	int n;
	cin >> n;
	vector<int> prime={1,6,9};
	repd(i,1,3){
		int index=2;
		while(pow(prime[i],index)<=n){
			prime.push_back(pow(prime[i],index));
			index++;
		}
	}
	sort(prime.begin(),prime.end());

	bitset<100001> bits,bits_temp;
	bits.set(0);
	int count=0;
	while(!bits[n]){
		rep(i,prime.size()){
			bits_temp |= bits<<prime[i];
		}
		bits=bits_temp;
		count++;
	}
	cout << count << endl;
	return 0;
}

int inputValue(){
	int a;
	cin >> a;
	return a;
}

void inputArray(int *p,int a){
	rep(i,a){
		cin >> p[i];
	}
}

void inputVector(vector<int> *p,int a){
	rep(i,a){
		int input;
		cin >> input;
		p -> push_back(input);
	}
}

template<typename T>
void output(T a,int precision){
	if(precision > 0){
		cout << setprecision(precision) << a << "\n";
	}else{
		cout << a << "\n";
	}
}

int gcd(int a,int b){
	if(b>a){
		int temp=a;
		a=b;
		b=temp;
	}
	if(b==0){
		return a;
	}
	return (b,b%a);
}


Measured memory_bytes: 256