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

#define fs first
#define sc second
#define pb emplace_back
#define mp make_pair
#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

const int32_t inf = 1001001001;
const int64_t infll = 1001001001001001001ll;
const int dx[] = {0, -1, 1, 0, -1, 1, -1, 1}, dy[] = {-1, 0, 0, 1, -1, -1, 1, 1};

template <typename T> using vector2d = vector<vector<T>>;

// clang-format off
template <typename T> void sort(vector<T> &v) { sort(all(v)); }
// ostream &operator<<(ostream &os, __int128_t value) { if (ostream::sentry(os)) { __uint128_t tmp = value < 0 ? -value : value; char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[tmp % 10]; tmp /= 10; } while (tmp != 0); if (value < 0) { --d; *d = '-'; } int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
// istream &operator>>(istream &is, __int128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } if (in[0] == '-') value *= -1; return is; }
// ostream &operator<<(ostream &os, __uint128_t value) { if (ostream::sentry(os)) { char buffer[64]; char *d = end(buffer); do { --d; *d = "0123456789"[value % 10]; value /= 10; } while (value != 0); int len = end(buffer) - d; if (os.rdbuf()->sputn(d, len) != len) { os.setstate(ios_base::badbit); }} return os; }
// istream &operator>>(istream &is, __uint128_t &value) { string in; is >> in; value = 0; for (const char &c : in) { if ('0' <= c && c <= '9') value = 10 * value + (c - '0'); } return is; }
template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { os << v[0]; for (int i = 1; i < v.size(); ++i) os << " " << v[i]; return os; }
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }
template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << p.fs << " " << p.sc; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.fs >> p.sc; return is; }

struct IoSetup { IoSetup(){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(10); cerr << fixed << setprecision(10); } } iosetup;

inline int64_t in() { int64_t x = 0; cin >> x; return x; }
template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

signed main(int argc, char *argv[]) {
  int n = in(), a = in(), b = in();
  cout << min(a * n, b) << endl;
}


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

#include<algorithm>

int main(){

	int a, b, c, d, p;
	
	cin >> a >> b >> c >> d >> p;

	if (p <= c) cout << min(p * a, b) << endl;
	else cout << min(p * a, b + (p - c) * d) << endl;
}

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

#define INF 100000000
#define MOD9(a) (a%1000000009)
#define MOD7(a) (a%1000000007)
#define ABS(a) (a<0?-(a):a)
#define MIN(a,b) (a>b?b:a)
#define MAX(a,b) (a>b?a:b)
#define REP(i,a) for(int i=0;i<a;i++) 

using namespace std;
int main(){
  int N;
  cin >> N;
  int t[N];
  REP(i, N){
    cin >> t[i];
  }

  int M;
  cin >> M;
  int p[M][2];
  REP(i, M){
    cin >> p[i][0];

    p[i][0]--;
    cin >> p[i][1];
  }

  REP(i, M){
    int time = 0;
    REP(j, N){
      if(j == p[i][0]){
        time += p[i][1];
      }else{
        time += t[j]; 
      }
    }
    cout << time << endl;
  }
}



Measured memory_bytes: 256
#include<stdio.h>
#include<stdlib.h>

int compare_int(const void *a, const void *b)
{
	return *(int*)b - *(int*)a;
}

int main() {
	int	N;
	int a = -1, b = -1;
	long long ans = 0;
	scanf("%d", &N);
	int *A = (int *)malloc(sizeof(int)*N);
	for (int i = 0; i < N; i++)
	{
		scanf("%d", &A[i]);
	}
	qsort(A, N, sizeof(int), compare_int);
	//for (int i = 0; i < N; i++)
	//{
	//	printf("%d ", A[i]);
	//}
	for (int i = 1; i < N; i++)
	{
		if (a == -1 && A[i] == A[i - 1])
		{
			a = A[i];
			if (i < N - 1)
			{
				i++;
			}else
			{
				break;
			}
			continue;
		}
		if (a != -1 && b == -1 && A[i] == A[i - 1])
		{
			b = A[i];
			break;
		}
	}
	if (a != -1 && b != -1)
	{
		ans = (long long)a * (long long)b;
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 892
#include <iostream>
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#include <cmath>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <ctime>
#include <cassert>
#include <complex>
#include <string>
#include <cstring>
#include <chrono>
#include <random>
#include <queue>
#include <bitset>
#include <stack>
#include <functional>

#ifdef LOCAL
    #define eprintf(...) fprintf(stderr, __VA_ARGS__)
#else
    #define eprintf(...) 42
#endif

#define rep_(i, a_, b_, a, b, ...) for (int i = (a), i##_len = (b); i < i##_len; ++i)
#define rep(i, ...) rep_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define reprev_(i, a_, b_, a, b, ...) for (int i = (b-1), i##_min = (a); i >= i##_min; --i)
#define reprev(i, ...) reprev_(i, __VA_ARGS__, __VA_ARGS__, 0, __VA_ARGS__)
#define all(x) (x).begin(), (x).end()
template <class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return 1; } return 0; }
template <class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return 1; } return 0; }
// template <class T> T gcd(T a, T b) { return b ? gcd(b, a % b) : a; }
using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair <int,int> P;
typedef long double ld;

int popcount_str (string s) {
    int ans = 0;
    rep (i, s.size()) ans += (s[i] == '1');
    return ans;
}
int popcount (ll x) {
    int ans = 0;
    while (x > 0) {
        ans += x % 2;
        x /= 2;
    }
    return ans;
}

int main (void)
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n; string x; cin >> n >> x;
    vector<int> memo(n + 1);
    vector<int> one(n);
    int k = popcount_str(x), modm = 0, modp = 0;
    ll deb = 0;
    rep (i, n) {
        deb = (deb * 2 + (x[i] == '1'));
        if (k != 1) modm = (modm * 2 + (x[i] == '1')) % (k - 1);
        modp = (modp * 2 + (x[i] == '1')) % (k + 1);
    }
    eprintf("%lld %d %d %d\n", deb, k, modp, modm);
    int flipm = 1, flipp = 1;
    reprev(i, n) {
        if (x[i] == '1' && k == 1) one[i] = -1;
        else if (x[i] == '1') {
            one[i] = (modm - flipm + (k - 1)) % (k - 1);
        } else {
            one[i] = (modp + flipp + (k + 1)) % (k + 1);
        }
        eprintf("%d ", one[i]);
        if (k != 1) flipm = (flipm * 2) % (k - 1);
        flipp = (flipp * 2) % (k + 1);
    }
    vector<int> ans(n);
    rep (i, n) {
        if (one[i] == 0) ans[i] = 1;
        else if (one[i] == -1) ans[i] = 0;
        else if (memo[one[i]]) ans[i] = memo[one[i]];
        else {
            int tmp = 1, y = one[i];
            while (y) {
                y %= popcount(y);
                tmp++;
            }
            ans[i] = memo[one[i]] = tmp;
        }
    }
    rep (i, n) cout << ans[i] << "\n";
}

Measured memory_bytes: 6048
#include <iostream>
#include <queue>
#include <stack>
#include <vector>
#include <stdio.h>
#include <algorithm>
#include <string.h>
#include <string>
#include <cmath>
#include <complex>
#include <map>
using namespace std;

#define rep(i,n) for(int i=0;i<int(n);++i)
#define ALL(v) (v).begin(),(v).end()
#define PB push_back
#define EPS 1e-8

static const double PI=6*asin(0.5);
typedef complex<double> P;
typedef long long ll;


double MIN,MAX;

int main(){
	double t;
	cin>>t;
	MAX=MIN=t;
	while(cin>>t){
		MAX=max(MAX,t);
		MIN=min(MIN,t);
	}
	cout<<MAX-MIN<<endl;
	return 0;
}

Measured memory_bytes: 1280
using System;
using System.Collections.Generic;
using System.Linq;
class Program
{
    static void Main(string[] args)
    {
            // 入力
            string[] sInp = Console.ReadLine().Trim().Split(' ');
            List<int> lstTsk = new List<int>();
            for (int i = 0; i < sInp.Length; i++)
            { lstTsk.Add(int.Parse(sInp[i])); }

            // 解析
            int iOut = 0;
            lstTsk.Sort();
            for (int i = 1; i < lstTsk.Count; i++)
            { iOut += lstTsk[i] - lstTsk[i - 1]; }

            //出力
            Console.WriteLine("{0}", iOut.ToString());

#if DEBUG
        Console.WriteLine("続行するには何かキーを押してください．．．");
        Console.ReadKey();
#endif

    }

}


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

int main()
{
   int n;
   long long r[50000]={0};
   for(int i=1;i<=50000;i++)
    r[i]+=r[i-1]+i;
   while(scanf("%d",&n)==1)
   {  for(int i=1;i<=50000;i++)
       if(r[i]>=n){
         printf("%d\n",i);
         break;
       }
   }
   return 0;
}


Measured memory_bytes: 640
import java.util.Scanner;

public class Main {

    public static void main(String[] args) throws Exception {

//    	File file = new File("test.txt");
//    	Scanner sc = new Scanner(file);
    	Scanner sc = new Scanner(System.in);
    	int a = sc.nextInt();
    	int b = sc.nextInt();
    	int c = sc.nextInt();
    	sc.close();
    	if(a == b && b == c){
    		System.out.println("No");
    		return;
    	}else if(a  != b && b != c && a != c){
    		System.out.println("No");
    		return;
    	}
    	System.out.println("Yes");
    }
}

Measured memory_bytes: 22736
def time():
    A = list(map(int,input().split()))
    shussha = A[:3]
    taisha = A[3:]
    sec = ((taisha[2] + 60) - shussha[2] ) % 60
    kurisagari_min = int(taisha[2] - shussha[2] < 0)
    min = ((taisha[1] - kurisagari_min + 60) - shussha[1])  % 60
    kurisagari_hour = int(taisha[1] - kurisagari_min - shussha[1] < 0)
    hour =  taisha[0] - kurisagari_hour - shussha[0]
    return (str(hour)+" "+str(min)+" "+str(sec))
A = time()
B = time()
C = time()
print(A)
print(B)
print(C)

Measured memory_bytes: 7748
from collections import Counter

# 素因数分解
def prime_factorize(n):
    a = []
    while n % 2 == 0:
        a.append(2)
        n //= 2
    f = 3
    while f * f <= n:
        if n % f == 0:
            a.append(f)
            n //= f
        else:
            f += 2
    if n != 1:
        a.append(n)
    return a

n = int(input())
a = [0] * (n + 1)
for i in range(1, n + 1):
  c = prime_factorize(i)
  for i in c:
    a[i] += 1

a3, a5, a15, a25, a75 = 0, 0, 0, 0, 0
for i in a:
  if i >= 74:
    a75 += 1 
  if i >= 24:
    a25 += 1 
  if i >= 14:
    a15 += 1 
  if i >= 4:
    a5 += 1 
  if i >= 2:
    a3 += 1 

# 重複してか終えた分を減らす。a5は同じものを丸々ダブって数えるので２で割る。
ans = a75 + a25 * (a3 - 1) + a15 * (a5 - 1) + a5 * (a5 -1) * (a3 - 2) // 2 
print(ans)

Measured memory_bytes: 3316
#include <iostream>
#include <vector>
#include <set>

using namespace std;

struct node {
  int id, depth, children = 0;
  node* parent;
};

multiset<int> path[110];
int cur = 0, n;

void dfs_ninja(node x) {
  int info;
  cin >> info;
  if(info > 0) {
    while((x.id == 1 && x.children < info) || (x.id != 1 && x.children < info-1)) {
      cur++;
      node child;
      child.id = cur; child.depth = x.depth + 1;
      child.parent = &x;
      x.children++;
      path[x.id].insert(child.id);
      path[child.id].insert(x.id);
      dfs_ninja(child);
    }
    return;
  }
  else if(info < 0) {
    node* ancestor = x.parent;
    for(int i = 0; i < -info; i++) ancestor = ancestor->parent;
    path[x.parent->id].erase(x.id);
    path[x.id].erase(x.parent->id);
    path[x.parent->id].insert(ancestor->id);
    path[ancestor->id].insert(x.parent->id);
    ancestor->children++;
    cur--;
    return;
  }
  else return;
}

int main() {
  cin >> n;
  for(int roop = 0; roop < n; roop++) {
    node root;
    cur++;
    root.id = cur; root.depth = 0;
    root.parent = nullptr;
    dfs_ninja(root);
    int fin;
    cin >> fin;
    for(int i = 0; i < cur; i++) {
      cout << i+1;
      for(auto itr = path[i+1].begin(); itr != path[i+1].end(); itr++) {
	cout << " " << *itr;
      }
      cout << endl;
      path[i+1].clear();
    }
    cur = 0;
  }
  return 0;
}

Measured memory_bytes: 3188
#include <string>
#include <queue>
#include <stack>
#include <vector>
#include <sstream>
#include <algorithm>
#include <deque>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <list>
#include <cstdio>
#include <iostream>
#include <cmath>
#include <climits>
#include <bitset>
#include <functional>
#include <numeric>
#include <ctime>
#include <cassert>
#include <cstring>
#include <fstream>

using namespace std;

void hurui(vector<int> &primes) {
    vector<bool> table(55556, true);
    for (int i = 2; i <= 55555; i++) {
        if (!table[i])
            continue;
        primes.push_back(i);
        for (int j = 2; i*j <= 55555; j++)
            table[i*j] = false;
    }
}
int main() {
    int n;
    cin >> n;
    vector<int> primes;
    hurui(primes);

    vector<int> ans;
    for (auto t : primes) {
        if (t % 5 == 1)
            ans.push_back(t);

        if (ans.size() == n)
            break;
    }

    for (int i = 0; i < n; i++) {
        cout << (i == 0 ? "" : " ") << ans[i];
    }
    cout << endl;

    return 0;
}

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

using namespace std;
typedef long long  ll;

int main() {
	ll m, f, r;
	cin >> m >> f >> r;
	while (m != -1 || f != -1 || r != -1) {
		if (m == -1 || f == -1) {
			cout << "F" << endl;
		}
		else if (m + f >= 80) {
			cout << "A" << endl;
		}
		else if (m + f >= 65) {
			cout << "B" << endl;
		}
		else if (m + f >= 50) {
			cout << "C" << endl;
		}
		else if (m + f >= 30) {
			if (r >= 50) {
				cout << "C" << endl;
			}
			else cout << "D" << endl;
		}
		else {
			cout << "F" << endl;
		}
		cin >> m >> f >> r;
	}
	return 0;
}


Measured memory_bytes: 3096
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <map>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <numeric>




typedef long long ll;
#define PI 3.14159265359
#define rep(i, n) for (ll i = 0; i < (ll)(n); i++)
#define mp make_pair
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define decp(n) cout<<fixed<<setprecision((int)n)
#define _GLIBCXX_DEBAC
#include <functional>
/*map<Keyの型, Valueの型> 変数名;
queue<型> 変数名;
priority_queue<型> 変数名;
priority_queue<型, vector<型>, greater<型>> 変数名;*/
//copy(v1.begin(), v1.end(), back_inserter(v2));
using namespace std;

ll gcd(ll a, ll b) {
	ll c;
	if (a < b) {
		c = a; a = b; b = c;
	}
	while (b != 0) {
		c = a % b; a = b; b = c;
	}
	return a;
}

ll lcm(ll a, ll b) {
	ll c;
	c = a * b / gcd(a, b);
	return c;
}

int sort_greater(int m, int n) {
	vector<int> a(m);
	for (int i = 0; i < m; i++) {
		cin >> a[i];
	}
	sort(a.begin(), a.end(), greater<int>());
	for (int i = 0; i < n; i++) {
		cout << a[i];
	}
	return 0;
}

int bubblesort(int a[], int n) {
	int sw = 0;
	bool flag = 1;
	for (int i = 0; flag; i++) {
		flag = 0;
		for (int j = n - 1; j >= i + 1; j--) {
			if (a[j] < a[j - 1]) {
				swap(a[j], a[j - 1]);
				flag = 1;
				sw += 1;
			}
		}
	}
	return sw;
}

int a_z()
{
	for (int i = 0; i <= ('Z' - 'A'); i++) {
		cout << (char)('A' + i);
	}
	return 0;
}

int selecttionsort(int a[], int n) {
	int t, sw = 0, minj;
	for (int i = 0; i < n - 1; i++) {
		minj = i;
		for (int j = 0; j < n - 1; j++) {
			if (a[j] < a[minj]) {
				minj = j;
			}
		}
		t = a[i]; a[i] = a[minj]; a[minj] = t;
		if (i != minj) sw += 1;

	}
	return sw;
}

bool is_prime(int x) {
	if (x <= 1) return false;
	for (int i = 2; i * i <= x; i++) {
		if (x % i == 0) return false;
	}
	return true;
}

const ll mod = 1000000007;


map<string, int> memo;

using P=pair<int, int>;




/*void dfs(int v, int p = -1) {
	for (int u : to[v]) {
		if (u == p) continue;
		ans[u] += ans[v];
		dfs(u, v);
	}
}*/
ll findIndex(int value, vector<ll> a)
{

	for (ll i = 0; i < (ll)a.size(); i++) {
		if (a[i] == value) {
			return i;
		}
	}
	return -1;
}
ll nCr(ll n, ll r) {
	ll a = 1;
	for (ll i = n; i > n - r; --i) {
		a = a * i;
	}
	for (ll i = 1; i < r + 1; ++i) {
		a = a / i;
	}
	return a;
}

void comb(vector<vector <long long int> >& v) {
	for (ll i = 0; i < v.size(); i++) {
		v[i][0] = 1;
		v[i][i] = 1;
	}
	for (ll k = 1; k < v.size(); k++) {
		for (ll j = 1; j < k; j++) {
			v[k][j] = (v[k - 1][j - 1] + v[k - 1][j]);
		}
	}
}



int main() {
	int k; cin >> k;
	if (k % 2 == 0)cout << (k / 2) * (k / 2);
	else cout << (k / 2) * (k / 2 + 1);
	return 0;
}













Measured memory_bytes: 256
#include <iostream>
#include<cmath>

using namespace std;

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

	int maxNum = 0;
	for (int i = 1; i <= N; i++) {
		double num = log2(i);
		//cout << i << ":" << num << endl;
		if (ceil(num) == floor(num)) {
			//numが整数の時
			maxNum = i;
		}
	}

	cout << maxNum << endl;
}

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

using namespace std;

typedef long ll;


int main(int, char**)
{
	ll n, ans = 0;
	ll a = 0, b = 0, c = 0;
	cin >> n;

	for (ll i = 0; i < n; ++i) {
		string st;
		bool isA = false;
		bool isB = false;
		cin >> st;
		if (st[0] == 'B')
			isB = true;
		if (st[st.length()-1] == 'A')
			isA = true;

		if (isA && isB) ++c;
		else {
			if (isA) ++a;
			if (isB) ++b;
		}

		string::size_type p = 0;
		do {
			p = st.find("AB", p);
			if (p != string::npos) {
				++ans;
				p += 2;
			}
		} while (p < st.length());
		// cerr << i << "=" << ans << endl;
	}
	// cerr << a << ", " << b << ", " << c << endl;

	if (c > 1)
		ans += (c - 1);
	ans += min(a, b);
	if (((a > 0)||(b > 0)) && c > 0) ans++;

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



Measured memory_bytes: 256
from collections import defaultdict, deque, Counter
from heapq import heappush, heappop, heapify
import math
import bisect
import random
from itertools import permutations, accumulate, combinations
import sys
import string
from bisect import bisect_left, bisect_right
from math import factorial, ceil, floor


INF = float('inf')
def LI(): return list(map(int, sys.stdin.readline().split()))
def I(): return int(sys.stdin.readline())
def LIM(): return list(map(lambda x:int(x) - 1, sys.stdin.readline().split()))
def LS(): return sys.stdin.readline().split()
def S(): return sys.stdin.readline().strip()
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def LIRM(n): return [LIM() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]
def SRL(n): return [list(S()) for i in range(n)]
mod = 1000000007


n, q = LI()




for i, j in LIR(q):
    if n == 1:
        print(min(i, j))
    else:
        while i != j:
            if i < j:
                i, j = j, i
            i = (i - 2) // n + 1
        print(i)


Measured memory_bytes: 66268
#include <bits/stdc++.h>
#define MAX (ll)(5e5 + 7)
#define INF (ll)(1e18 + 7)
#define MOD (ll)(1e9 + 7)

using namespace std;
using ll = long long;
using cd = complex<double>;

void f_io () {
	ios_base :: sync_with_stdio (false);
	cin.tie (nullptr);
}

int main () {
	int n, fl = 0, cc = 0;
	cin >> n;
	for (int i = 0; i < n; i++) {
		int a, b;
		cin >> a >> b;
		if (a == b) {
			cc++;
		}
		else {
			cc = 0;
		}
		if (cc >= 3) {
			fl = 1;
		}
	}
	cout << (fl ? "Yes\n" : "No\n");
}


Measured memory_bytes: 3588
#include <stdio.h>

int main(void) {
	int n,i;
	double m,a2,s[1000],sum;
	while(scanf("%d",&n)!=EOF && n!=0){
		for(i=0,sum=0;i<n;i++){
			scanf("%lf",&s[i]);
			sum += s[i];
		}
		m=sum/n;
		for(i=0,a2=0;i<n;i++){
			a2 += pow(s[i]-m,2);
		}
		printf("%.8lf\n",sqrt(a2/n));
	}
	return 0;
}

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

int main() {
  int n;
  cin>>n;
  vector<int>a(n);
  for(int i=0;i<n;i++){
    int k;
    cin>>k;
    a.at(i)=k;
  }
  int ans=1;
  if(n==1)cout<<1<<endl;
  else {
    for(int i=1;i<n;i++){
      if(a.at(i)<a.at(i-1))ans++;
      else a.at(i)=a.at(i-1);
    }
    cout<<ans<<endl;
  }
  
    
}


Measured memory_bytes: 1024
using System;

public class Program
{
    private string S;

    public void Solve()
    {
        var sc = new Scanner();
        S = sc.Next();

        int cnt = 0;
        string b = "";
        string a = "";
        for (int i = 0; i < S.Length; i++)
        {
            b += S[i];
            if (a != b)
            {
                cnt++;
                a = b;
                b = "";
            }
        }
        Console.WriteLine(cnt);
    }

    public static void Main(string[] args)
    {
        new Program().Solve();
    }
}

class Scanner
{
    public Scanner()
    {
        _pos = 0;
        _line = new string[0];
    }

    const char Separator = ' ';
    private int _pos;
    private string[] _line;

    #region スペース区切りで取得

    public string Next()
    {
        if (_pos >= _line.Length)
        {
            _line = Console.ReadLine().Split(Separator);
            _pos = 0;
        }

        return _line[_pos++];
    }

    public int NextInt()
    {
        return int.Parse(Next());
    }

    public long NextLong()
    {
        return long.Parse(Next());
    }

    public double NextDouble()
    {
        return double.Parse(Next());
    }

    #endregion

    #region 型変換

    private int[] ToIntArray(string[] array)
    {
        var result = new int[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = int.Parse(array[i]);
        }

        return result;
    }

    private long[] ToLongArray(string[] array)
    {
        var result = new long[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = long.Parse(array[i]);
        }

        return result;
    }

    private double[] ToDoubleArray(string[] array)
    {
        var result = new double[array.Length];
        for (int i = 0; i < array.Length; i++)
        {
            result[i] = double.Parse(array[i]);
        }

        return result;
    }

    #endregion

    #region 配列取得

    public string[] Array()
    {
        if (_pos >= _line.Length)
            _line = Console.ReadLine().Split(Separator);

        _pos = _line.Length;
        return _line;
    }

    public int[] IntArray()
    {
        return ToIntArray(Array());
    }

    public long[] LongArray()
    {
        return ToLongArray(Array());
    }

    public double[] DoubleArray()
    {
        return ToDoubleArray(Array());
    }

    #endregion
}

Measured memory_bytes: 16600
#include<bits/stdc++.h>
#include <math.h>
using namespace std;
#define rep(i,n) for(ll i=0;i<n;i++)
#define repl(i,l,r) for(ll i=(l);i<(r);i++)
#define per(i,n) for(ll i=n-1;i>=0;i--)
#define lper(i,r,l) for(ll i=r-1;i>=l;i--)
#define fi first
#define se second
#define mp make_pair
#define all(x) (x).begin(),(x).end()
#define CST(x) cout<<fixed<<setprecision(x)
using ll=long long;
using vl=vector<ll>;
using vvl=vector<vector<ll>>;
using pl=pair<ll,ll>;
const ll MOD=1000000007;
const ll MOD9=998244353;
const int inf=1e9;
const ll INF=4e18;
const ll dy[4]={1,0,-1,0};
const ll dx[4]={0,-1,0,1};
int main() {
string S;
  cin >>S;
  
  ll x=S.size();
  ll c=0;
  rep(i,x-1) {
    if(S.at(i)!=S.at(i+1)) {
      c++;
    }
  }
  
  
  
  cout<<c<<endl;
}

 

Measured memory_bytes: 512
package main

import (
	"bufio"
	"fmt"
	"os"
	"strconv"
)

var s = bufio.NewScanner(os.Stdin)
var w = bufio.NewWriter(os.Stdout)

func main() {
	s.Split(bufio.ScanWords)

	s.Scan()
	n, _ := strconv.Atoi(s.Text())

	T := make(map[string]int)
	for i := 0; s.Scan() && i < n; i++ {
		cmd := s.Text()
		if cmd[0] == 'f' {
			s.Scan()
			if _, ok := T[s.Text()]; ok {
				fmt.Fprintln(w, "yes")
				continue
			}
			fmt.Fprintln(w, "no")
			continue
		}
		s.Scan()
		T[s.Text()] = 0
	}

	w.Flush()
}



Measured memory_bytes: 33076
#include <iostream>
#include <vector>
#include <string>
#include <utility>
#include <queue>
#include <algorithm>
#include <map>
#include <set>
#include <cmath>
#include <ctime>
#include <cstdlib>
#include <climits>
using namespace std;

#define MOD1097 1000000007

#define ll long long
#define pint pair<int, int>
#define pll pair<ll, ll>
#define pb push_back
#define mpair make_pair
#define pm(first, second) pb(mpair(first, second))
#define SPACE " "
#define fpf first.first
#define fps first.second
#define spf second.first
#define sps second.second

#define all(X) (X).begin(), (X).end()
#define reall(X) (X).rbegin(), (X).rend()
#define divcel(a, b) (((a) + ((b) - 1)) / (b))

int main(){

    int N;
    cin >> N;
    cout << N * N * N << endl;

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <cmath>
#include <string>
#include <algorithm>
#include <set>
#include <vector>
#include <map>
#include <list>
#include <stack>
#include <cstdio>
#include <cstring>
#include <cstdlib>
#include <queue>
#define REP(i, n) for(i=0; i<n; i++)
#define REPR(i, n) for(i=n; i>=0; i--)
#define FOR(i, m, n) for(i=m; i<n; i++)
#define max(a, b) ((a)>(b) ? (a):(b))
#define min(a, b) ((a)<(b) ? (a):(b))
#define prin(ans) cout << ans << endl
#define INF 1000000000
#define MOD 1000000007LL
#define MAX 105
#define NIL -1
#define WHITE 0
#define GRAY 1
#define BLACK 2
using namespace std;
typedef long long ll;
typedef pair<ll, ll> PA;
typedef priority_queue<ll> PQ;
typedef pair<double, double> doup;
typedef vector<ll> vec;
typedef vector<vec> mat;
typedef map<ll, ll> Map;

ll N, M;
Map mp;
ll fact[100101];
ll rfact[100101];


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

void pdiv(ll n) {
    for(ll i=2; i<=n; i++) {
        while(n%i==0) {
            mp[i]++;
            n/=i;
        }
    }
}


int main(void) {
    cin >> N >> M;
    pdiv(M);
    ll ans=1;
    ll i;
    
    fact[0]=rfact[0]=1;
    for(i=1; i<=100029; i++) {
        fact[i]=i*fact[i-1]%MOD;
        rfact[i]=modPow(fact[i], MOD-2);
    }
    
    
    for(auto it=mp.begin(); it!=mp.end(); it++) {
        ans*=fact[N+it->second-1]*rfact[N-1]%MOD*rfact[it->second]%MOD;
        ans%=MOD;
    }
    
    prin(ans);
}

Measured memory_bytes: 1792
import java.util.*;
public class Main {
  
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    List<List<Integer>> from = new ArrayList<>();
    for (int i = 0; i < N; i++) {
      from.add(new ArrayList<>());
    }
    
    for (int i = 0; i < N-1; i++) {
      int a = sc.nextInt();
      int b = sc.nextInt();
      from.get(a-1).add(b-1);
      from.get(b-1).add(a-1);
    }
    int[] c = new int[N];
    for (int i = 0; i < N; i++) {
      c[i] = sc.nextInt();
    }
    Arrays.sort(c);
    
    int idx = N-1;
    int[] d = new int[N];
    boolean[] visit = new boolean[N];
    long M = 0;
    PriorityQueue<Pair> q = new PriorityQueue<>((a,b)->b.b-a.b);
    d[0] = c[idx--];
    q.offer(new Pair(0, d[0]));
    visit[0] = true;
    while (!q.isEmpty()) {
      Pair now = q.poll();
      for (int next : from.get(now.a)) {
        if (!visit[next]) {
          d[next] = c[idx--];
          M += Math.min(d[now.a], d[next]);
          q.offer(new Pair(next, d[next]));
          visit[next] = true;
        }
      }
    }
      
    StringBuilder ans = new StringBuilder();
    ans.append(M+"\n");
    for (int i = 0; i < N; i++) {
      ans.append(d[i]);
      if (i < N-1) {
        ans.append(' ');
      } else {
        ans.append('\n');
      }
    }
    System.out.print(ans.toString());
  }
  
  private static class Pair {
    private final int a;
    private final int b;
    private Pair(int a, int b) {
      this.a = a;
      this.b = b;
    }
  }
}

Measured memory_bytes: 48140
#include <bits/stdc++.h>
#define rep(i, a, n) for (int i = a; i < n; i++)
#define repr(i, a, n) for (int i = n - 1; i >= a; i--)
using namespace std;
using ll = long long;
using P = pair<int, int>;
template <typename T> void chmin(T &a, T b) { a = min(a, b); }
template <typename T> void chmax(T &a, T b) { a = max(a, b); }

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

  int n;
  cin >> n;

  vector<int> ans(10001,0);
  rep(x,1,101){
    rep(y,1,101){
      rep(z,1,101){
        ll v = x*x+y*y+z*z+x*y+y*z+z*x;
        if(v>=0&&v<=10001){
          ans[v]++;
        }
      }
    }
  }

  rep(i,1,n+1)
    cout<<ans[i]<<endl;;  
}


Measured memory_bytes: 3652
#include <bits/stdc++.h>
#define rep(i,a,b) for(int i = (a); i <= (b); i++)
#define rng(a) a.begin(), a.end()
#define ina(n,a) cin >> n; for(int i = 1; i <= n; i++) cin >> a[i]
#define sz(x) (int)(x).size()
#define se second
#define fi first
#define prev            coyhhhhhhyoc    
#define next          sdNNNmNNNNNNNmds  
#define y0           hNNNNy_yNNNNNN_sNh
#define y1          mNNNNNdtdNNNNNNtsNNm
#define yn          mNNNNNNNNy___smNNNms
#define tm            oooooosyysooooot 
#define read               tyhyt        
#define rank              ytmNmo         
#define index              yyy
#define pb push_back
#define pcnt __builtin_popcountll
#define rrep(i,a,b) for(int i = (b); i >= (a); i--)
#define rall(x,a) for(auto x : a)
#define MOD 1000000007
#define endl "\n"
typedef long long ll;
using namespace std;

const int N = 222222;
int d[N], sd[N];
int n, k;

signed main() {
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cin >> n >> k;
    rep(i, 1, n) {
        cin >> d[i];
        sd[i] = sd[i - 1] + d[i];
    }
    int maxi = 0;
    rep(l, 1, n - k + 1) {
        int r = l + k - 1;
        int cur = r - l + 1 + sd[r] - sd[l - 1];
        maxi = max(maxi, cur);
    }
    double ans = maxi * .5;
    cout << fixed << setprecision(13) << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
#pragma GCC optimize("Ofast")
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using ull = unsigned long long;
#define PI 3.141592
#define LL_INF 9000000000000000000
#define LL_MINF -9000000000000000000
#define INT_INF 2000000000
#define INT_MINF -2000000000
#define all(a) (a).begin(), (a).end()
#define fi first
#define se second

int main(){
    int N, K;
    cin >> N >> K;
    vector<int> P(N);
    for(int i = 0; i < N; i++) cin >> P[i];
    sort(all(P));
    int sum = 0;
    for(int i = 0; i < K; i++) sum += P[i];
    cout << sum << endl; 
}


Measured memory_bytes: 3592
#include <string>
#include <stdio.h>
#include <algorithm>
#include <iostream>
#include <vector>
#include <cmath>
#define rep(i,n) for(int i = 0; i < (n); i++)
using namespace std;

int main()
{
    int n, m, a, b;
    cin >> n >> m;
    vector<long long> hight(n);
    vector<bool> isGood(n);
    rep(i,n) isGood[i] = true;
    rep(i, n) cin >> hight[i];
    rep(i,m){
        cin >> a >> b;
        a--;b--;
        if(hight[a] == hight[b]){
            isGood[a] = false;
            isGood[b] = false;
        }else if(hight[a] > hight[b])
        isGood[b] = false;
        else
        isGood[a] = false;
    }
    int ans = 0;
    rep(i,n) if(isGood[i] == true) ans++;
    cout << ans << endl;
}

Measured memory_bytes: 4052
n = int(input())
a = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
b = ''
def Base_10_to_n(X, n):
    X_dumy = X
    out = ''
    while X_dumy>0:
        out = a[X_dumy%n-1]+out
        if a[X_dumy%n-1] == 'z':
          X_dumy -= 26
        X_dumy = X_dumy//n
    return out
 
z = Base_10_to_n(n, 26)
print(z)

Measured memory_bytes: 9196
s = input()
a = int(s[:2])
b = int(s[2:])

if 0 < a <= 12 and (b == 0 or b > 12): print("MMYY")
elif (a == 0 or a > 12) and 0 < b <= 12: print("YYMM")
elif 0 < a <= 12 and 0 < b <= 12: print("AMBIGUOUS")
else: print("NA")

Measured memory_bytes: 3060
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>
#include <unordered_map>
#include <cstdlib>
#include <queue>
#include <stack>

using namespace std;

int main(){
	int N;
	string A,B,C;
	cin>>N>>A>>B>>C;
	int ans = 0;
	for(int i=0;i<N;i++){
		if(A[i]==B[i]&&A[i]==C[i])continue;
		if(A[i]!=B[i]&&B[i]!=C[i]&&C[i]!=A[i]){
			ans+=2;
			continue;
		}
		ans++;
	}
	cout<<ans<<endl;
	
	
	return 0;
}


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

using namespace std;

const int N = 200005;

struct Node {
  int val[3];
  Node() {
    val[0] = val[1] = val[2] = INT_MAX;
  }
};

int a[N], m[N];

struct S {
  int l, r, val;
  bool operator < (const S &b) const {
    return val > b.val;
  }
};

int n;
Node seg[N << 2];

void add(int id, int l, int r, int loc, int data) {
  if (l == r) {
    seg[id].val[loc & 1] = data;
    seg[id].val[2] = data;
    return ;
  }
  int mid = (l + r) >> 1;
  if (loc <= mid) {
    add(id << 1, l, mid, loc, data);
  }
  else {
    add(id << 1 | 1, mid + 1, r, loc, data);
  }
  seg[id].val[0] = min(seg[id << 1].val[0], seg[id << 1 | 1].val[0]);
  seg[id].val[1] = min(seg[id << 1].val[1], seg[id << 1 | 1].val[1]);
  seg[id].val[2] = min(seg[id << 1].val[2], seg[id << 1 | 1].val[2]);
}

int query(int id, int l, int r, int ll, int rr, int flag) {
  if (l == ll && r == rr) {
    return seg[id].val[flag];
  }
  int mid = (l + r) >> 1;
  if (mid >= rr) {
    return query(id << 1, l, mid, ll, rr, flag);
  }
  if (mid < ll) {
    return query(id << 1 | 1, mid + 1, r, ll, rr, flag);
  }
  return min(query(id << 1, l, mid, ll, mid, flag), query(id << 1 | 1, mid + 1, r, mid + 1, rr, flag));
}

int main() {
  scanf("%d", &n);
  for (int i = 1; i <= n; ++i) {
    scanf("%d", &a[i]);
    m[a[i]] = i;
    add(1, 1, n, i, a[i]);
  }
  a[n + 1] = INT_MAX;
  priority_queue<S> q;
  q.push({1, n, query(1, 1, n, 1, n, 1)});
  vector<int> res;
  while (!q.empty()) {
    S s = q.top();
    q.pop();
    res.push_back(s.val);
    int now = m[s.val];
    int go = query(1, 1, n, now + 1, s.r, (now & 1) ^ 1);
    res.push_back(go);
    go = m[go];
    if (now > s.l) {
      q.push({s.l, now - 1, query(1, 1, n, s.l, now - 1, s.l & 1)});
    }
    if (now + 1 < go) {
      q.push({now + 1, go - 1, query(1, 1, n, now + 1, go - 1, (now + 1) & 1)});
    }
    if (go < s.r) {
      q.push({go + 1, s.r, query(1, 1, n, go + 1, s.r, (go + 1) & 1)});
    }
  }
  for (int i = 0; i < n ; ++i) {
    printf("%d%c", res[i], i < n - 1 ? ' ' : '\n');
  }
  return 0;
}


Measured memory_bytes: 13876
p = int(input())
y = list(map(int, input().split()))
t = 0
for h in range(p):
    o = h
    for n in range(h, p):
        if y[n] < y[o]: o = n
    if h != o:
        y[h], y[o] = y[o], y[h]
        t += 1
print(*y)
print(t)


Measured memory_bytes: 5608
#include <iostream>

using namespace std;
int main(){
int a, b;
cin >> a;
cin >> b;
if (a == 1 && b == 2) {
 cout << 3;
} else if (a == 2 && b == 3){
  cout << 1;
}

else if (a == 2 && b == 1) {
 cout << 3;
} else if (a == 3 && b == 2){
  cout << 1;
}
else if (a == 3 && b == 1) {
 cout <<  2; }
else if (a == 1 && b == 3) {
 cout << 2;
}
return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <stdlib.h>

#define rep(i, n) for (int i = 0; i < n; i = i + 1)
#define array(N, t) (t*)calloc(N, sizeof(t))
#define ll long long
#define INF ((1LL << 62) - (1LL << 31))
#define max(p, q)((p) > (q) ? (p) : (q))
#define min(p, q)((p) < (q) ? (p) : (q))

int main() {
  int D, T, S;
  scanf("%d%d%d", &D, &T, &S);

  if (D > (T * S)) {
    printf("No\n");
  } else {
    printf("Yes\n");
  }

  return 0;
}


Measured memory_bytes: 1644
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> V;
int N;
int ans=0;
int main(){
    vector<vector<V>> kaku(10,vector<V>(10)); 
    cin>>N;
    for(int i=1;i<=N;i++){
        int m=i%10;
        int k;
        for(int j=1;j<=6;j++){
            if(pow(10,j)>i){
                k=i/pow(10,j-1);
                break;
            }
        }
        kaku.at(k).at(m).push_back(i);
    }
    for(int i=0;i<10;i++){
        for(int j=0;j<10;j++){
            ans+=kaku.at(i).at(j).size()*kaku.at(j).at(i).size()*2;
            
        }
    }
    cout<<ans/2<<endl;
}


Measured memory_bytes: 1664
N = int(input())
s = ['' for i in range(N)]
t = [0 for i in range(N)]

for i in range(N):
    ss, tt = input().split()
    s[i] = ss
    t[i] = int(tt)
X = input()
flag = False
ans = 0
for i in range(N):
    if flag:
        ans += t[i]
    else:
        if X == s[i]:
            flag = True
print(ans)


Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
int main()
{
	long long n,w;
	cin>>n>>w;
	long long weight[n],value[n];
	long long i,j;
	for(i=0;i<n;i++)
	cin>>weight[i]>>value[i];
	long long dp[w+1][2];
	memset(dp,0,sizeof(dp));
	for(i=1;i<=n;i++)
	{
		for(j=1;j<=w;j++) {
		dp[j][i%2]=max(j-weight[i-1]>=0?dp[j-weight[i-1]][(i-1)%2]+value[i-1]:INT_MIN,dp[j][(i-1)%2]);
	    }
	}
	cout<<dp[w][n%2];
}

Measured memory_bytes: 5128
#!/usr/bin/env python3

import heapq

def main():
    n, m = map(int, input().split())
    a = list(map(int, input().split()))
    a = [-x for x in a]  # Negate to use min-heap as max-heap
    heapq.heapify(a)
    for i in range(m):
        x = heapq.heappop(a) * (-1)
        x //= 2
        heapq.heappush(a, -x)
    print(sum(a) * (-1))

if __name__ == "__main__":
    main()


Measured memory_bytes: 14180
#include <cassert>
#include <utility>

template <class Abelian, template <class T> class Container>
class potentialized_union_find {
	class node_type;

public:
	using value_structure = Abelian;
	using value_type = typename value_structure::value_type;
	using container_type = Container<node_type>;
	using size_type = typename container_type::size_type;

protected:
	value_structure vfo;
	container_type c;

private:
	class node_type {
	public:
		typename potentialized_union_find::size_type par, siz;
		typename potentialized_union_find::value_type val;
	};
	value_type potential(size_type x) {
		value_type ret = vfo.identity();
		while (x != c[x].par) {
			c[x].val = vfo(c[x].val, c[c[x].par].val);
			ret = vfo(ret, c[x].val);
			x = c[x].par = c[c[x].par].par;
		}
		return ::std::move(ret);
	}

public:
	potentialized_union_find() : vfo(), c() {}
	explicit potentialized_union_find(
		const size_type size, const value_structure &x = value_structure())
		: vfo(x), c(size, { 0, 1, vfo.identity() }) {
		for (size_type i = 0; i < size; ++i) {
			c[i].par = i;
		}
	}

	size_type size() const { return c.size(); }
	bool empty() const { return c.empty(); }

	size_type find(size_type x) {
		assert(x < size());
		while (x != c[x].par) {
			c[x].val = vfo(c[x].val, c[c[x].par].val);
			x = c[x].par = c[c[x].par].par;
		}
		return x;
	}
	value_type diff(const size_type x, const size_type y) {
		assert(x < size());
		assert(y < size());
		assert(same(x, y));
		return vfo(potential(y), vfo.inverse(potential(x)));
	}
	bool same(const size_type x, const size_type y) {
		assert(x < size());
		assert(y < size());
		return find(x) == find(y);
	}
	size_type size(const size_type x) {
		assert(x < size());
		return c[find(x)].siz;
	}

	::std::pair<size_type, size_type> unite(size_type x, size_type y,
		value_type d) {
		assert(x < size());
		assert(y < size());
		d = vfo(vfo(d, potential(x)), vfo.inverse(potential(y)));
		x = find(x);
		y = find(y);
		if (x != y) {
			if (c[x].siz < c[y].siz) {
				::std::swap(x, y);
				d = vfo.inverse(d);
			}
			c[x].siz += c[y].siz;
			c[y].par = x;
			c[y].val = ::std::move(d);
		}
		return ::std::pair<size_type, size_type>(x, y);
	}
};

template <class T> class plus_abelian {
public:
	using value_type = T;
	value_type operator()(const value_type &x, const value_type &y) const {
		return x + y;
	}
	value_type identity() const { return value_type(0); }
	value_type inverse(const value_type &x) { return -x; }
	value_type reverse(const value_type &x) const { return x; }
};

#include<iostream>
#include<vector>
template<class T>
using vec = ::std::vector<T>;

int main() {
	int n, q;
	std::cin >> n >> q;
	potentialized_union_find<plus_abelian<int>, vec> T(n);
	while (q--) {
		int t, x, y, z;
		std::cin >> t >> x >> y;
		if (t) {
			if (T.same(x, y))
				::std::cout << T.diff(x, y) << ::std::endl;
			else
				::std::cout << "?" << ::std::endl;
		}
		else {
			::std::cin >> z;
			T.unite(x, y, z);
		}
	}
	return 0;
}



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

int main() {
  long long N,D,x,y,count=0;
  cin >>N>>D;
  for(int i=0;i<N;i++){
    cin>>x>>y;
    if(D>=sqrt(x*x+y*y)){
      count++;
    }
  }
  cout<<count;
}


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

using namespace std;

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

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

#endif

void Main() {
    ll K; cin >> K;
    vector<ll> a = {1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
    cout << a.at(K - 1) << endl;
}

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


Measured memory_bytes: 3588
/**
 *    author: gxfireball       
**/
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
using namespace std;

void solve(){
   string str;
   cin >> str;
   if(str == "AAA" || str == "BBB") cout << "No";
   else cout << "Yes";
}

int main(){
    fastio;
    int t;
    t = 1;
    //cin>>t;
    while(t--){
    	solve();
    }
    return 0;
}



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

namespace ABC129
{
    class D
    {
        static void Main(string[] args)
        {
            const int m = 1000000007;
            int[] b = Console.ReadLine().Split(' ').Select(o => int.Parse(o)).ToArray();
            int H = b[0], W = b[1];

            char[,] c = new char[H, W];
            int[,] x = new int[H, W];
            int[,] y = new int[H, W];

            for (int i = 0; i < H; i++)
            {
                string S = Console.ReadLine();
                char[] cs = S.ToCharArray();
                for (int j = 0; j < W; j++)
                {
                    c[i, j] = cs[j];
                }
            }

            for (int i = 0; i < H; i++)
            {
                int counter = 0;
                int start = 0;
                for (int j = 0; j <= W; j++)
                {
                    if (j==W || c[i, j] == '#') 
                    {
                        for (int k = start; k < j; k++)
                        {
                            x[i, k] = counter;
                        }
                        counter = 0;
                        start = j+1;
                    }
                    else
                    {
                        counter++;
                    }
                }
            }

            for (int j = 0; j < W; j++)
            {
                int counter = 0;
                int start = 0;
                for (int i = 0; i <= H;i++)
                {
                    if (i == H || c[i, j] == '#')
                    {
                        for (int k = start; k < i; k++)
                        {
                            y[k, j] = counter;
                        }
                        counter = 0;
                        start = i + 1;
                    }
                    else
                    {
                        counter++;
                    }
                }

            }

            int s = 0;
            for (int i = 0; i < H; i++)
            {
                for (int j = 0; j < W; j++)
                {
                    if (x[i, j] + y[i, j] > s) s = x[i, j] + y[i, j];
                }
            }
            Console.WriteLine(s-1);
        }
    }
}


Measured memory_bytes: 54208
#include<iostream>
#include<stdio.h>
#include<cstring>
#include<cmath>
#include<algorithm>
#include<vector>
#include<map>
#include<set>
#include<queue>
#define ll long long
using namespace std;
int pos(int n)
{
    if(n<0)
        return 0;
    else
        return n;
}
bool pali(ll n)
{
    char a[10000]= {0};
    int num=0,tn=n;
    for(int i=0; i<tn; i++)
    {
        a[i]=n%10;
        n/=10;
        num=i;
        if(n<=0)
            break;

    }
    for(int i=0; i<num/2; i++)
    {
        if(a[i]!=a[num-i])
        {
            return false;
        }
    }
    return true;
}
int main()
{
    ll n,m;
    cin>>n;
    map<string,int> rs,bs;
    string s,a[1000];
    for(int i=0;i<n;i++){
        cin>>s;
        a[i]=s;
        bs[s]++;
    }
    cin>>m;
      for(int i=0;i<m;i++){
        cin>>s;
       rs[s]++;
    }
    ll Max=0;
    for(int i=0;i<n;i++){
        ll tp=bs[a[i]]-rs[a[i]];
        if(Max<tp)
       Max=tp;
    }
    cout<<Max;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
	int a = 0, n, d[100], num[101] ;
	for (int i = 0; i < 101; i++)
	{
		num[i] = 0;
	}
	scanf("%d",&n);
	for (int i = 0; i < n; i++)
	{
		scanf("%d",&d[i]);
	}
	for (int i = 0; i < n; i++)
	{
		num[d[i]] = 1;
	}
	for (int i = 1; i <= 100; i++)
	{
		if (num[i] != 0) a++;
	}
	printf("%d", a);
}

Measured memory_bytes: 128
A, B, C = map(int, input().split())
a = [0]
b = [0]
c = [0]
i = 0
flag = 0

a[0] = A
b[0] = B
c[0] = C

if A == B and B == C and A % 2 == 0:
	print(-1)
else:
	while flag == 0:
		if a[i] % 2 == 0 and b[i] % 2 == 0 and c[i] % 2 == 0:
			x = (b[i] + c[i]) / 2
			y = (a[i] + c[i]) / 2
			z = (b[i] + a[i]) / 2
			a.append(x)
			b.append(y)
			c.append(z)
			i += 1
		else:
			flag = 1
	print(i)

Measured memory_bytes: 3064
import java.util.Scanner;

public class Main {
    public static void main(String args[]) {
        try (Scanner in = new Scanner(System.in)) {
            String S = in.next();
            char[] cs = S.toCharArray();
            int count01 = 0;
            int count10 = 0;
            for (int i = 0; i < cs.length; i++) {
                char c = cs[i];
                if (i % 2 == 0) {
                    if (c == '0') {
                        count10++;
                    } else {
                        count01++;
                    }
                } else {
                    if (c == '0') {
                        count01++;
                    } else {
                        count10++;
                    }
                }
            }
            System.out.println(Math.min(count01, count10));
        }
    }
}


Measured memory_bytes: 27220
#include <iostream>
#include <math.h>
#include <string>
#include <algorithm>
#include <ctype.h>
#include <vector>
#include <numeric>
using namespace std;

#define ll long long int
#define rep(i, a, n) for (int i = a; i < n; i++)
#define INF 1e9
#define LINF 1e17
#define MOD (int)(1e9 + 7)
#define pi 3.141592653589
#define pii pair<int, int>
#define vi vector<int>
#define vll vector<ll>
#define ALL(a) (a).begin(), (a).end()
#define sort_v(a) sort(a.begin(), a.end())
#define fi first
#define se second

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

ll gcd(ll a, ll b)
{
    while (1)
    {
        if (a < b)
            swap(a, b);
        if (b == 0)
            break;
        a %= b;
    }
    return a;
}

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

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

    cout << "Christmas";
    rep(i, 0, 25 - d) cout << " Eve";
    cout << endl;
}


Measured memory_bytes: 256