akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
using namespace std;
using i64 = long long;
using u64 = unsigned long long;
template <typename T>
using V = std::vector<T>;
#define REP(i, n) for (int i = 0; (i64)(i) < (i64)(n); ++i)

#ifdef ENABLE_DEBUG
template <typename T>
void debug(T value) {
  cerr << value;
}
template <typename T, typename... Ts>
void debug(T value, Ts... args) {
  cerr << value << ", ";
  debug(args...);
}
#define DEBUG(...)                              \
  do {                                          \
    cerr << " \033[33m (L" << __LINE__ << ") "; \
    cerr << #__VA_ARGS__ << ":\033[0m ";        \
    debug(__VA_ARGS__);                         \
    cerr << endl;                               \
  } while (0)
#else
#define debug(...)
#define DEBUG(...)
#endif

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  string S;
  cin >> S;
  int n = S.size();
  int ans = n;
  REP(i, n - 1) {
    if (S[i] == S[i + 1]) continue;
    int m = max(i + 1, n - 1 - i);
    ans = min(ans, m);
  }
  cout << ans << endl;
}


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

using namespace std;
     
#define F first
#define S second
#define lb lower_bound
#define ub upper_bound
#define pb push_back
#define pf push_front         																																																										
#define ppb pop_back
#define mp make_pair
#define bpp __builtin_popcount
#define al 0x3F3F3F3F
#define sz(x) x.size()
#define all(x) x.begin(), x.end()
#define in insert
#define ppf pop_front
#define endl '\n'
#define resize(v) v.resize(unique(all(v)) - v.begin());
//#define int long long

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

const int mod = (int)1e9 + 7;                                   
const int MAX_N = (int)2e5 + 123;
const int N = 1e6 + 123;                     
const int INF = al;           
const ll INFL = 3e18 + 1;
const double pi = acos(-1.0);
const double eps = 1e-9;
const int dx[] = {0, 0, 1, 0, -1};
const int dy[] = {0, 1, 0, -1, 0};

int l, r;

inline void boost () {
    ios_base :: sync_with_stdio(NULL);
    cin.tie(NULL), cout.tie(NULL);
}                                                                     
                                                                    
inline void Solve () {
   boost ();
   cin >> l >> r;
   if (l <= 0 && r >= 0) cout << "Zero", exit(0);
   if (l > 0 && r > 0) cout << "Positive", exit(0);
   if (l < 0 && r < 0) {
   	l = abs(l), r = abs(r);
   	int len = r - l + 1;
   	cout << (len & 1 ? "Negative" : "Positive"), exit(0);
   }

}  

int main () {
//	freopen("sparse.in", "r", stdin);	
//	freopen("sparse.out", "w", stdout);
   int tt = 1;                																																																									
//	cin >> tt;
	while (tt --) {
   	Solve ();
   }
   return 0;
}

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

#define rep(i, n) for(int i = 0; i < (int)(n); i++)
typedef long long ll;
using namespace std;

int main() {
    int k;
    cin >> k;
    // vector<int> a(40);
    int a[40] = {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};
    k--;
    cout << a[k] << endl;
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int N; string S;
int main() {
  cin >> N >> S;
  for(int i = 0; i < (int)S.size(); ++i) {
    int t = S.at(i)+N;
    if(t-'A' >= 26) t -= 26;
    cout << (char)t;
  }
}

Measured memory_bytes: 256
s = input()
a = [[-1] for i in range(26)]

for i in range(len(s)):
    a[ord(s[i])-ord('a')].append(i)

for i in range(26):
    a[i].append(len(s))

ans = float('inf')
for i in range(26):
    ma = 0
    for j in range(1,len(a[i])):
        dis = a[i][j]-a[i][j-1]-1
        ma = max(dis,ma)
    ans = min(ma,ans)

print(ans)


Measured memory_bytes: 3064
from collections import defaultdict
import sys
import math
from datetime import datetime

def sol(a, s):
    if a >= 3200:
        return s
    else:
        return 'red'



do_submit = True
#do_submit = False

def input_parse(input_str):
    lines = [x.strip() for x in input_str.split("\n") if x.strip()]
    parsed_lines = [list(map(str, line.split())) for line in lines]
    print(parsed_lines)
    a = int(parsed_lines[0][0])
    s = parsed_lines[1][0]
    # S = parsed_lines[1][0]
    # return n, k, S
    return a, s


if not do_submit:
    a, s = input_parse("""
    3200
    pink
    """)
    print(sol(a, s))

else:
    #n, k= list(map(int, input().split()))
    #S = input().split()
    # print(sol(n, k, S))
    a = int(input().strip())
    s = input().strip()
    # S = input().strip()
    print(sol(a, s))

Measured memory_bytes: 3944
//#pragma comment(linker, "/STACK:1024000000,1024000000")
//#pragma GCC optimize (2)
//#pragma G++ optimize (2)
#include<iostream>
#include<cstdio>
#include<cstring>
#include<algorithm>
using namespace std;
#define N 100010
int n,a[N],b[N],as[N],bs[N],al,bl,f[N],ans;
int find(int x){ return x==f[x] ? x : f[x]=find(f[x]); }
int main(){
	//freopen("duliu_3.in","r",stdin);
	//freopen("duliu.out","w",stdout);
	scanf("%d",&n);
	for(int i=1;i<=n;++i){ scanf("%d",&a[i]); as[i]=a[i]; a[n+1]^=a[i]; }
	for(int i=1;i<=n;++i){ scanf("%d",&b[i]); bs[i]=b[i]; b[n+1]^=b[i]; }
	as[n+1]=a[n+1]; bs[n+1]=b[n+1];
	sort(as+1,as+n+2); 
	sort(bs+1,bs+n+2); 
	for(int i=1;i<=n+1;++i)if(as[i]^bs[i]){puts("-1");return 0;}
	al=unique(as+1,as+n+2)-(as+1);
	bl=unique(bs+1,bs+n+2)-(bs+1);
	if(al^bl){ puts("-1"); return 0; }
	for(int i=1;i<=n+1;++i){
		a[i]=lower_bound(as+1,as+1+al,a[i])-as;
		b[i]=lower_bound(bs+1,bs+1+bl,b[i])-bs;
	}
	for(int i=1;i<=n;++i) if(a[i]^b[i]){ f[a[i]]=a[i]; f[b[i]]=b[i]; }
	f[a[n+1]]=a[n+1];f[b[n+1]]=b[n+1];
	for(int fa,fb,i=1;i<=n+1;++i) 
		if(a[i]^b[i]){
			if(i<=n) ++ans;
			fa=find(a[i]); 
			fb=find(b[i]);
			f[fa]=fb;
		}
	for(int fi,i=1;i<=al;++i){
		fi=find(i); 
		if(fi==i)	++ans;
	}
	ans-1>0 ? ans-=1 : ans=0;
	printf("%d",ans);
	return 0;
}

Measured memory_bytes: 3712
#include<iostream>
#include<algorithm>
#include<cstdlib>

using namespace std;

char p[2][17];
int mem[1<<16][16];
int N;
const int INF=1<<29;

int rec(int b,int p){
  if(mem[b][p]<INF)return mem[b][p];
  if(b==0)return 0;
  int m=INF;
  for(int i=0;i<N;i++){
    if(b>>i&1){
      for(int j=0;j<N;j++){
	if(b>>j&1&&::p[0][i]!=::p[0][j]){
	  m=min(m,rec(b^1<<i^1<<j,j)+abs(p-i)+abs(i-j));
	}
      }
    }
  }
  return mem[b][p]=m;
}

int main(){
  while(cin>>N,N){
    cin>>p[0]>>p[1];
    int b=0;
    for(int i=0;i<N;i++){
      b|=(p[0][i]!=p[1][i])<<i;
    }
    fill(mem[0],mem[1<<N],INF);
    int m=INF;
    for(int i=0;i<N;i++){
      m=min(m,rec(b,i));
    }
    cout<<m<<endl;
  }
}

Measured memory_bytes: 5260
#include <stdio.h>

#define len_string_max 4

int calculate_points (char data_string[len_string_max])
{
    // variables for `calculate_points`
    int points;

    // STEP.01
    // initialize the points
    points = 0;

    // STEP.02
    // calculate the points using given string
    for (size_t itr = 0; itr < len_string_max; itr++)
    {
        if (data_string[itr] == '+') points += 1;
        if (data_string[itr] == '-') points -= 1;
    }

    // STEP.END
    return points;
}

int main (void)
{
    // variables for `main`
    char given_string[len_string_max];
    int  rtvl_scanf;

    // STEP.01
    // read out the given string
    rtvl_scanf = scanf("%s", given_string);

    // STEP.02
    // calcualte & output the points
    printf("%d\n", calculate_points(given_string));

    // STEP.END
    return 0;
}

Measured memory_bytes: 128
#include <stdio.h>

int main(void)
{
	int a, b, c, d, e, f;
	float x, y;
	
	while(scanf("%d %d %d %d %d %d", &a, &b, &c, &d, &e, &f) != EOF){
		x = (float)(c*e-f*b)/(a*e-d*b);
		y = (float)(c*d-f*a)/(d*b-e*a);
		
		if(x == -0){
			x = 0;
		}
		if(y == -0){
			y = 0;
		}
		
		printf("%.3f %.3f\n", x, y);
	}
	return (0);
}

Measured memory_bytes: 1788
#include <utility>
#include <vector>
#include <iostream>
#include <algorithm>
#include <set>
#define REP(i,n) for(int i=0;i<n;i++)
typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
using namespace std;
int gcd(int a,int b){return b?gcd(b,a%b):a;}
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};

int main() {
	cin.tie(0);
   	ios::sync_with_stdio(false);
    int x1,y1,x2,y2;
    cin >> x1 >> y1 >> x2 >> y2;
    int x3, y3, x4, y4;
    if(y1>y2){
        x3 = x2 + y1 - y2;
        y3 = y2 - x1 + x2;
        x4 = x3 + x1 - x2;
        y4 = y3 + y1 - y2;
    }else{
        x3 = x2 + y1 - y2;
        y3 = y2 + x2 - x1;
        x4 = x3 + x1 - x2;
        y4 = y3 + y1 - y2;
    }
    cout << x3 <<" " << y3 <<" " << x4 <<" " << y4 << endl;
    return 0;
}

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

struct UnionFind{
    vector<long long> par;
    vector<long long> size;

    UnionFind(long long n) : par(n){
        //initialization
        for(long long i = 0; i < n; i++){
            par[i] = i;
        }
        size.resize(n, 1);
    }

    long long root(long long x){
        if(par[x] == x){
            return x;
        }
        return par[x] = root(par[x]);
    }

    void unite(long long x, long long y){
        long long rx = root(x);
        long long ry = root(y);
        if(rx == ry){
            return;
        }

        par[rx] = ry;
        size[ry] += size[rx]; 
    }

    bool same(long long x, long long y){
        long long rx = root(x);
        long long ry = root(y);
        return rx == ry;
    }

    long long treeSize(long long x){
        //group size
        return size[root(x)];
    }
};

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

    UnionFind tree(n);
    
    for(long long i = 0; i < m; i++){
        long long a, b;
        cin >> a >> b;
        tree.unite(a-1, b-1);
    }

    long long maxv = 0;
    for(long long i = 0; i < n; i++){
        maxv = max(maxv, tree.treeSize(i));
    }
    cout << maxv << endl;
    return 0;
}

Measured memory_bytes: 12608
#include <algorithm>
#include <iostream>
#include <math.h>
#include <stdio.h>
#include <string>
#include <sstream>
#include <vector>
#define INT_MIN -200000
using namespace std;

int nextHeighest(int *heightArray,int n,int index){		//index 以降で最も高い標高を返す(indexは含まない)
	int maxHeight = INT_MIN;
	for(int i = index + 1; i < n; i++){
		if( heightArray[i] > maxHeight) maxHeight = heightArray[i];
	}
	return maxHeight;
}

double pondArea(int *heightArray,int n,int start,int goal){		//start,goal の標高を基準にして、池の面積を求める
	double waterSurface = heightArray[start];
	double area = 0;
	for(int i = start ; i < goal; i++){
		area += waterSurface - ((double)(heightArray[i]) + (double)(heightArray[i+1]))/2;
	}
	return area;
}

int nextHeightIndex(int *heightArray,int n,int index,int height){	//次の標高がheightになる場所のindexを返す
	for(int i = index + 1; i < n; i++){
		if(heightArray[i] == height) return i;
	}
	return -1;
}

int nextStartIndex(int *heightArray,int n,int index){
	if(index == n) return n;  //右端の場合
	int currentHeight = heightArray[index];
	if(currentHeight > heightArray[index + 1] && nextHeightIndex(heightArray,n,index,currentHeight) != -1){
		return index;
	}else{
		return nextStartIndex(heightArray,n,index + 1);
	}
}


int main()
{
	string str;
	getline(cin,str);
	int n = str.size();
	int *heightArray = new int[n+1];
	heightArray[0] = 0;
	for(int i = 1; i <= n; i++){
		if(str[i-1] == '\\'){
			heightArray[i] = heightArray[i-1] - 1;
		}else if(str[i-1] == '/'){
			heightArray[i] = heightArray[i-1] + 1;
		}else if(str[i-1] == '_'){
			heightArray[i] = heightArray[i-1];
		}
	}
	vector<double> pondAreaVector;
	double totalPondArea = 0;
	int i = nextStartIndex(heightArray,n+1,0);
	while(i <= n ){
		int currentHeight = heightArray[i];
		int nextGoalIndex = nextHeightIndex(heightArray,n+1,i,currentHeight);
		double localPondArea = pondArea(heightArray,n+1,i,nextGoalIndex);
		totalPondArea += localPondArea;
		pondAreaVector.push_back(localPondArea);
		i = nextStartIndex(heightArray,n+1,nextGoalIndex);
	}
	cout<<(int)totalPondArea<<endl;
	cout<<pondAreaVector.size();
	for(int i = 0; i < pondAreaVector.size(); i++){
		cout <<" "<<(int)pondAreaVector[i];
	}
	cout << endl;

	return 0;
}





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

using namespace std;

#define SZ(v) ((int)(v).size())
#define ALL(v) (v).begin(),(v).end()
#define one first
#define two second
typedef long long ll;
typedef pair<int, int> pi;
const int INF = 0x3f2f1f0f;
const ll LINF = 1ll * INF * INF;

const int MOD = 1e9 + 7;
const int MAX_N = 3e5 + 10;


int Inv[MAX_N];
ll mypow(ll a, ll b) {
	ll res = 1, p = a;
	while(b) {
		if(b%2) res = res * p % MOD;
		p = p * p % MOD;
		b >>= 1;
	}
	return res;
}

int H, W, A, B;
int main() {
	cin >> H >> W >> A >> B;
	for(int i=1; i<MAX_N; i++) Inv[i] = mypow(i, MOD-2);
	ll ans = 1;
	ll nowl = 1, nowr = 1;
	for(int i=1; i<=W-1; i++) {
		ans = ans * (H-1+i) % MOD;
		ans = ans * Inv[i] % MOD;
		nowr = nowr * (A-1+i) % MOD;
		nowr = nowr * Inv[i] % MOD;
	}
	ll minus = nowl * nowr % MOD;
	for(int k=1; k<B; k++) {
		nowl = nowl * (H-A-1+k) % MOD;
		nowl = nowl * Inv[k] % MOD;
		nowr = nowr * Inv[(A-1)+(W-1-(k-1))] % MOD;
		nowr = nowr * (W-1-(k-1)) % MOD;
		minus += nowl * nowr % MOD;
		minus %= MOD;
	}
	ans -= minus;
	ans += MOD;
	ans %= MOD;
	printf("%lld\n", ans);
	return 0;
}


Measured memory_bytes: 1408
//高知能系Vtuberの高井茅乃です。
//Twitter: https://twitter.com/takaichino
//YouTube: https://www.youtube.com/channel/UCTOxnI3eOI_o1HRgzq-LEZw

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

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

int main() {
	int ans = 0;
	int tmp;
	string a, b;
	cin >> a >> b;
	if (a == b.substr(0, b.size()-1)) cout << "Yes" << endl;
	else cout << "No" << endl;
	
	//cout << ans << endl;
}

Measured memory_bytes: 3632
#include<stdio.h>
int main(){
  int h,m,s;
  scanf("%d",&s);
  h = s / 3600;
  s = s % 3600;
  m = s /60;
  s = s % 60;
  printf("%d:%d:%d\n",h,m,s); 
  return 0;
}

Measured memory_bytes: 592
#define _USE_MATH_DEFINES
#define _CRT_SECURE_NO_WARNINGS

#include <iostream>
#include <string>
#include <sstream>
#include <iomanip>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <algorithm>
#include <stack>
#include <queue>
#include <vector>
#include <list>
#include <set>
#include <map>
#include <bitset>
#include <utility>
#include <numeric>
#include <iterator>

using namespace std;

using ll = long long;
using ull = unsigned long long;

const ll inf = 1ll << 60;
const ll mod = (ll)1e9 + 7;

#define all(v) v.begin(), v.end()
#define rall(v) v.rbegin(), v.rend()

#define print(s) cout << s;
#define println(s) cout << s << endl;
#define printd(s, f) cout << fixed << setprecision(f) << s << endl;


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

	ll x = 1;
	ll cnt = 0;
	for (ll i = 0; i < n; i++)
	{
		ll a;
		cin >> a;

		if (a == x)
		{
			x++;
		}
		else
		{
			cnt++;
		}
	}

	println((x > 1 ? cnt : -1));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define mset(a, b) memset(a, b, sizeof(a))
#define mcpy(a, b) memcpy(a, b, sizeof(a))
using namespace std;
typedef long long LL;
const int N = 155;

template <typename T> inline void read(T &AKSHOI) {
	T x = 0, flag = 1;
	char ch = getchar();
	while (!isdigit(ch)) {
		if (ch == '-') flag = -1;
		ch = getchar();
	}
	while (isdigit(ch)) {
		x = x * 10 + ch - '0';
		ch = getchar();
	}
	AKSHOI = flag * x;
}

template <typename T> inline void cmin(T &x, T y) {
	if (x > y) x = y;
}

template <typename T> inline void cmax(T &x, T y) {
	if (x < y) x = y;
}

namespace ModCalculator {
	int MOD;
	inline void Inc(int &x, int y) {
		x += y; if (x >= MOD) x -= MOD;
	}
	inline void Dec(int &x, int y) {
		x -= y; if (x < 0) x += MOD;
	}
	inline int Add(int x, int y) {
		Inc(x, y); return x;
	}
	inline int Sub(int x, int y) {
		Dec(x, y); return x;
	}
	inline int Mul(int x, int y) {
		return 1LL * x * y % MOD;
	}
	inline int Ksm(int x, int k) {
		int ret = 1;
		for (; k; k >>= 1) {
			if (k & 1) ret = Mul(ret, x);
			x = Mul(x, x);
		}
		return ret;
	}
	inline int Inv(int x) {
		return Ksm(x, MOD - 2);
	}
}
using namespace ModCalculator;

int n, k;

int f[N][N];

void solve1() {
    k >>= 1;
    f[0][0] = 1;
    for (int i = 1; i <= n; ++i) {
        for (int j = 0; j <= k; ++j) {
            Inc(f[i][0], f[i - 1][j]);
            Inc(f[i][j + 1], f[i - 1][j]);
        }
    }
    int ans1 = 0, ans2 = 0;
    for (int j = 0; j <= k; ++j) {
        Inc(ans1, f[n / 2][j]);
        Inc(ans2, f[(n + 1) / 2][j]);
    }
    printf("%d\n", Mul(ans1, ans2));
}

int dp[2][N][N];

void solve2() {
    dp[0][0][0] = 1;
    int pre = 0, cur = 1;
    for (int i = 1; i * 2 <= n + k; ++i) {
        mset(dp[cur], 0);
        for (int j = 0; j <= k + 1; ++j) {
            for (int t = 0; t <= n; ++t) {
                int x = dp[pre][j][t];
                if (!x) continue;
                Inc(dp[cur][0][0], x);
                if (i * 2 <= n) {
                    Inc(dp[cur][0][t + 1], x);
                }
                if (i * 2 >= k + 1) {
                    Inc(dp[cur][j + (j > 0)][0], x);
                }
                if (i * 2 <= n && i * 2 >= k + 1) {
                    Inc(dp[cur][max(j + 1, t + 2)][t + 1], x);
                }
            }
        }
        swap(pre, cur);
    }
    int ans = 0;
    for (int j = 0; j <= k + 1; ++j) {
        for (int t = 0; t <= n; ++t) {
            Inc(ans, dp[pre][j][t]);
        }
    }
    printf("%d\n", ans);
}

int main(){
    read(n); read(k); read(MOD);
    if (k & 1) solve2();
    else solve1();
    return 0;
}


Measured memory_bytes: 3920
import java.util.Scanner;

public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int[] A = new int[N];
    for (int i = 0; i < N; i++) {
      A[i] = sc.nextInt();
    }
    sc.close();
    bubbleSort(A, N);
  }

  static void bubbleSort(int[] A, int N) {
    int count = 0;
    for (int i = 0; i < N - 1; i++) {
      for (int j = N - 1; j >= i + 1; j--) {
        if (A[j - 1] > A[j]) {
          swap(A, j - 1 , j);
          count++;
        }
      }
    }
    printArray(A);
    System.out.println(count);
  }

  static void swap(int[] A, int i, int j) {
    int tmp = A[i];
    A[i] = A[j];
    A[j] = tmp;
  }

  static void printArray(int[] A) {
    int n = A.length;
    for (int i = 0; i < n - 1; i++) {
      System.out.printf("%d ", A[i]);
    }
    System.out.print(A[n - 1] + "\n");
  }
}


Measured memory_bytes: 26384
#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
using namespace std;
#define REP(i,s,n) for(int i=s; i<(n); ++i)
#define ALL(n) begin(n),end(n)
using ll = long long;
const ll INF = numeric_limits<long long>::max();


int gcd(int a, int b, int c){  // cond: a<=b<=c
    for (int i = a; i > 0; --i){
        if (a % i == 0 && b % i == 0 && c % i == 0)  //ここでaの判定入れるの忘れてた…（そもそもc++17なら組み込みのgcd使えたぽい）
            return i;
    }
    return 1;
}

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

    int sum = 0;
    REP(i, 1, K+1){  // どうやら全探索出も通せたっぽいし…
        REP(j, i, K+1){
            REP(k, j, K+1){
                if (i == j){
                    if (j == k){
                        sum += i;
                    } else{
                        sum += gcd(i, j, k) * 3;
                    }
                } else if (j == k){
                    sum += gcd(i, j, k) * 3;
                } else{
                    sum += gcd(i, j, k) * 6;
                }
            }
        }
    }
    cout << sum << endl;

    return 0;
}


Measured memory_bytes: 3540
import java.util.NoSuchElementException;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        try {
            while (sc.hasNext()) {
                String[] a_op_b = sc.nextLine().split(" ");
                if (a_op_b.length != 3) {
                    throw new InvalidTestCaseException();
                }
                String op = a_op_b[1];
                int a = Integer.parseInt(a_op_b[0]);
                int b = Integer.parseInt(a_op_b[2]);
                if (op.equals("+")) {
                    System.out.println(a + b);
                } else if (op.equals("-")) {
                    System.out.println(a - b);
                } else if (op.equals("*")) {
                    System.out.println(a * b);
                } else if (op.equals("/")) {
                    System.out.println(a / b);
                } else if (op.equals("?")) {
                    break;
                }
            }
        } catch (InvalidTestCaseException
                | NoSuchElementException
                | NumberFormatException e) {
            System.out.println(e);
        }
    }

    private static class InvalidTestCaseException extends RuntimeException {
        InvalidTestCaseException() {
            super("Condition is invalid.");
        }
    }
}



Measured memory_bytes: 26220
// AtCoder.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//

// AtCoder.cpp : このファイルには 'main' 関数が含まれています。プログラム実行の開始と終了がそこで行われます。
//


#define _USE_MATH_DEFINES
#include<math.h>

//#include<cmath>

#include<deque>
#include<queue>
#include<vector>
#include<algorithm>
#include<iostream>
#include<set>
#include<cmath>
#include<tuple>
#include<string>
#include<chrono>
#include<functional>
#include<iterator>
#include<random>
#include<unordered_set>
#include<array>
#include<map>
#include<iomanip>
#include<assert.h>
#include<bitset>
#include<stack>
#include<memory>



//#include "Ants.h"
using namespace std;
typedef long long ll;
#define rad_to_deg(rad) (((rad)/2/M_PI)*360)
#define EPS (1e-7)
#define INF (1e9)
#define PI (acos(-1))
#define rep(i,n) for(int i=0;i<n;i++)
#define show(s) cout<<s<<endl
#define chmin(x,y) x=min(x,y)
#define chmax(x,y) x=max(x,y)
#define LINF (1000000000000000000ll)

typedef pair < int, int> P;
ll gcd(ll a, ll b) {//最大公約数を求める///最大公倍数a*b/gcd(a,b)
	if (b == 0) return a;
	return gcd(b, a % b);
}

ll lcd(ll a, ll b) {//最小公倍数を求める　b=0のときaを返す
	if (b == 0) return a;
	return (a / gcd(a, b)) * b;
}
vector<int> calc(ll num) {
	int dig;
	vector<int>p;
	while (num) {
		dig = num % 10;
		p.push_back(dig);
		num /= 10;
	}
	return p;
}
ll N, A, B;
int main()
{
	cin >> N;
	cin >> A >> B;
	if(abs(B-A)%2==0)
	cout << abs(B - A) / 2 << endl;
	else {
		ll big = min(N - B, N - A)+(abs(N-B-N+A)-1)/2+1;
		ll ano = min(B - 1, A - 1)+(abs(N-B-N+A)-1)/2+1;
		cout << min(ano, big) << endl;
	}
	


}

Measured memory_bytes: 256
#include<algorithm>
#include <iostream>
#include<cstdio>
#include<cmath>
#include<iomanip>
#include<string>
#include<cstdlib>
#include<ctime>
#include<vector>
#include<map>
using namespace std;

int main(){
//srandom((unsigned long)time(NULL));

int r,d,x;
cin>>r>>d>>x;

int ans=x;

for(int i=0;i<10;i++){
    ans=ans*r-d;
    cout<<ans<<endl;
}
    

return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(int argc, char const *argv[])
{
	int n;
	cin >> n;
	int m[32] = {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 << m[n-1] << endl;
	return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int A[1000001],size;

void maxHeapify(int i){
  int l = i*2;
  int r = i*2+1;
  int lar,tmp;
  
  if(l<=size && A[l]>A[i])lar=l;
  else lar=i;
  if(r<=size && A[r]>A[lar])lar=r;

  if(i!=lar){
    tmp = A[i];
    A[i] = A[lar];
    A[lar] = tmp;
  maxHeapify(lar);
  }
}

int main(){

  int i,tmp;
  char com[10];
  size=0;
  
  
  while(1){
    scanf("%s",com);
    if(com[0]=='i'){
      size++;
      scanf("%d",&A[size]);
      i=size;
      while(i>1 && A[i/2]<A[i]){
	tmp = A[i];
	A[i] = A[i/2];
	A[i/2] = tmp;
	i = i/2;
      }
      
    }else if(com[0]=='e' && com[1]=='x'){
      printf("%d\n",A[1]);
      A[1]=A[size];
      size--;
      maxHeapify(1);
    }else if(com[0]=='e' && com[1]=='n')break;
    //  for(i=1;i<=size;i++)printf(" %d",A[i]);
    // printf("\n");
  }
  
  return 0;
}



Measured memory_bytes: 5632
H, W = map(int, input().split())
a = [list(map(int,input().split())) for _ in range(H)]

output = []

for i in range(H-1):
    for j in range(W-1):
        if a[i][j]%2==1:
            a[i][j+1] += 1
            output.append([i+1,j+1,i+1,j+2])
    if a[i][W-1]%2==1:
        a[i+1][W-1]+=1
        output.append([i+1,W,i+2,W])
for j in range(W-1):
        if a[H-1][j]%2==1:
            a[H-1][j+1] += 1
            output.append([H,j+1,H,j+2])
            
print(len(output))
for x in output:
    print(*x)

Measured memory_bytes: 30260
#include <iostream>
#include <map>

using namespace std;

int main() {

    int N, M;
    cin >> N >> M;

    multimap<int, char> map;

    for (int i = 0; i < M; i++) {
        int s;
        char c;
        cin >> s >> c;
        map.insert(make_pair(s - 1, c));
    }

    int ans = -1;

    for (int i = 0; i < 1000; i++) {
        string s = to_string(i);
        if (s.length() != N) {
            continue;
        }
        bool all = true;
        for (auto kv : map) {
            all &= s[kv.first] == kv.second;
        }
        if (all) {
            ans = i;
            break;
        }
    }

    cout << ans << endl;
}

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

class Program{
    static void Main(string[] args){
        int N = int.Parse(Console.ReadLine());
        for(int i=0; i<N; i++){
            int[] tri = Console.ReadLine().Trim().Split(' ').Select(x => int.Parse(x)).ToArray();
            Array.Sort(tri);
            if(Math.Pow(tri[2],2)==Math.Pow(tri[0],2)+Math.Pow(tri[1],2)){
                Console.WriteLine("YES");
            } else Console.WriteLine("NO");
        }
    }
}


Measured memory_bytes: 18332
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <string>
#include <queue>

using namespace std;

int main() {
    int H,W;
    cin >> H >> W;
    int A[H][W];
    queue<pair<int,int>> q = queue<pair<int,int>>();
    for(int yi = 0; yi < H; yi++){
        for(int xi = 0; xi < W; xi++){
            char c;
            cin >> c;
            if(c == '#'){
                A[yi][xi] = 0;
                q.push(pair<int,int>(yi,xi));
            }else{
                A[yi][xi] = -1;
            }
        }
    }
    while(q.size() != 0){
        pair<int,int> tmp = q.front();
        q.pop();
        if(tmp.second - 1 >= 0 && A[tmp.first][tmp.second - 1] == -1){
            A[tmp.first][tmp.second - 1] = A[tmp.first][tmp.second] + 1;
            q.push(pair<int,int>(tmp.first,tmp.second - 1));
        }
        if(tmp.second + 1 < W && A[tmp.first][tmp.second + 1] == -1){
            A[tmp.first][tmp.second + 1] = A[tmp.first][tmp.second] + 1;
            q.push(pair<int,int>(tmp.first,tmp.second + 1));
        }
        if(tmp.first - 1 >= 0 && A[tmp.first - 1][tmp.second] == -1){
            A[tmp.first - 1][tmp.second] = A[tmp.first][tmp.second] + 1;
            q.push(pair<int,int>(tmp.first - 1,tmp.second));
        }
        if(tmp.first + 1 < H && A[tmp.first + 1][tmp.second] == -1){
            A[tmp.first + 1][tmp.second] = A[tmp.first][tmp.second] + 1;
            q.push(pair<int,int>(tmp.first + 1,tmp.second));
        }
    }
    int M = 0;
    for(int yi = 0; yi < H; yi++){
        for(int xi = 0; xi < W; xi++){
            M = max(M,A[yi][xi]);
        }
    }
    cout << M << endl;

}

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

#define rep(i,n) for(int i=0;i<(n);++i)
#define rrep(i,n) for(int i=(n);i>=0;--i)

int N, M;
string S;
vector<bool> dp;
vector<int> ans;
bool dfs(int n) {
  if (n == 0)
    return true;
  if (!dp[n])
    return false;

  rrep(i, M) {
    if (n-i < 0)
      continue;
    if (i == 0)
      continue;
    if (S[n-i] == '0') {
      ans.push_back(i);
      bool s = dfs(n-i);
      if (s == false) {
        ans.pop_back();
        continue;
      } else {
        return true;
      }
    }
  }
  return dp[n] = false;
}

int main() {
  cin >> N >> M;
  cin >> S;
  dp.resize(N+1, true);
  if (!dfs(N))
    cout << "-1";
  else {
    reverse(ans.begin(), ans.end());
    for (const auto& e : ans)
      cout << e << " ";
  }
  cout << "\n";

  return 0;
}


Measured memory_bytes: 7416
#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include<iostream>
#include<algorithm>//next_permutation

using namespace std;
int main() {
	int N;
	cin >> N;
	 string S;
	 vector<string>a(0);
	map<string, int>date;
	vector<string>SSS(0);
	for (int i = 0;i < N;i++) {
		cin >> S;
		if (!date.count(S)) {
			date[S] == 1;
			a.push_back(S);
		}
		else {
			int A = date.at(S);
			date[S] = A + 1;
		}
	}
	int max = 0, C;
	for (int i = 0;i < a.size();i++) {
		C = date.at(a.at(i));
		if (C >= max) {
			max = C;
			SSS.push_back(a.at(i));
		}
		else {
			date.erase(a.at(i));
		}
	}
	vector<string>Answer(0);
	for (int i = 0;i < SSS.size();i++) {
		if (date.count(SSS.at(i))) {
			if (date.at(SSS.at(i)) == max) {
				Answer.push_back(SSS.at(i));
			}
			else {
				date.erase(SSS.at(i));
			}
		}
	}
	sort(Answer.begin(), Answer.end());
	Answer.push_back("AAAAAAA");
	for (int i = 0;i < Answer.size() - 1;i++) {
		if (Answer.at(i) != Answer.at(i + 1)) {
			cout << Answer.at(i) << endl;
		}
	}
}

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

#define rep(i, n) for(int i = 0; i < n; i++)
using namespace std;

typedef long long ll;

const int INF = 1 << 30;
const ll LLINF = 1LL << 62;

int mod = 1000000007;

int main(void){
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int A, B; cin >> A >> B;
    for(double val = 1.0; val <= 2000; val += 1.0){
        int per8 = val*0.08;
        int per10 = val*0.1;
        if(per8 == A && per10 == B){
            int ans = val;
            cout << val << endl;
            return 0;
        }
    }
    cout << -1 << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("O2")
#include <iostream>
#include <vector>
#include <functional>
#include <numeric>
#include <algorithm>
using namespace std;
int main() {
	ios::sync_with_stdio(0);
	cin.tie(0);

	long long a , b , c , k ;
	cin >> a >> b >> c >> k ;

	if (a + b >= k) cout << min(a, k) + b * 0  << "\n";
	else cout << a + b * 0 - (k - a - b) << "\n";





	return 0 ;
}


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

#define ll long long int
#define ld long double
#define pb push_back
#define eb emplace_back
#define xx first
#define yy second
#define INF 0x3f3f3f3f
#define all(x) x.begin(),x.end()
#define show(x) cerr<<#x<<" : "<<x<<'\n';
#define yogeshk972() cerr<<"\nTime Taken : "<<(float)(clock()-time_p)/CLOCKS_PER_SEC<<"\n";
clock_t time_p=clock();

using namespace std;
const int N= 3e5+10, mod= 1e9+7;

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

  // #ifndef ONLINE_JUDGE
  // freopen("in.txt","r",stdin);
  // freopen("out.txt","w",stdout);
  // #endif

  int n,h,w;
  cin>>h>>w>>n;
  if(h<w)swap(h,w);
  cout<<ceil(1.0*n/h);

  return 0;
}


Measured memory_bytes: 256
N,M=map(int,input().split())

Start=[]
Goal=[]

for i in range(M):
    a,b=map(int,input().split())
    if a==1:
        Start.append(b)
    elif b==1:
        Start.append(a)
    if a==N:
        Goal.append(b)
    elif b==N:
        Goal.append(a)
    
S=set(Start)
G=set(Goal)
if len(S&G)>0:
    print("POSSIBLE")
elif len(S&G)==0:
    print("IMPOSSIBLE")

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

const int mod = 1000000007;
struct mint {
    ll x;
    mint(ll x=0):x( (x%mod + mod) % mod ) {}
    mint operator-() const { return mint(-x); }
    mint& operator+=(const mint a) {
        if ( (x += a.x) >= mod ) x -= mod;
        return *this;
    }
    mint& operator-=(const mint a) {
        if ( ( x += mod - a.x) >= mod ) x -= mod;
        return *this;
    }
    mint& operator*=(const mint a) {
        ( x *= a.x) %= mod;
        return *this;
    }
    mint operator+(const mint a) const { return mint(*this) += a; }
    mint operator-(const mint a) const { return mint(*this) -= a; }
    mint operator*(const mint a) const { return mint(*this) *= a; }
    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    mint inv() const { return pow(mod - 2); }
    mint& operator/=(const mint a) { return *this *= a.inv(); }
    mint operator/(const mint a) { return mint(*this) /= a; }
};
istream& operator>>(istream& is, mint& a) { return is >> a.x; }
ostream& operator<<(ostream& os, const mint& a) { return os << a.x; }

struct combination
{
    vector<mint> fact, ifact;
    combination(int n) : fact(n+1), ifact(n+1) {
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i-1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i-1] = ifact[i]*i;
    }
    mint operator() (int n, int k) {
        if ( k < 0 || k > n ) return 0;
        return fact[n] * ifact[k] * ifact[n-k];
    }
} comb(2000005);

mint f(int r, int c) {
  return comb(r + c +2, r + 1);
}

int main() {
  int r1, c1, r2, c2;
  cin >> r1 >> c1 >> r2 >> c2;
  --r1, --c1;
  mint ans = f(r2, c2);
  ans -= f(r1, c2);
  ans -= f(r2, c1);
  ans += f(r1, c1);
  cout << ans << endl;
  return 0;
}

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

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

#define INF (1e9)
#define PI  (acos(-1))

int a, b;

int main()
{


	while (cin >> a >> b) {
		if (a > b) {
			cout << a - 1 << endl;
		}
		else {
			cout << a << endl;
		}
	}

    return 0;
}



Measured memory_bytes: 256
n=int(input())
t,a = map(int, input().split())
h=list(map(int, input().split()))
temp = [abs(a-(t-h[i]*0.006)) for i in range(n)]
min_temp = pow(10,5)
ans = 0
for i in range(n):
    if temp[i]<min_temp:
        min_temp = temp[i]
        ans = i
print(ans+1)

Measured memory_bytes: 3064
x,y,a,b,c = map(int,input().split())
p = list(map(int,input().split()))
q = list(map(int,input().split()))
r = list(map(int,input().split()))
p.sort(reverse=True)
pn = p[:x]
q.sort(reverse=True)
qn = q[:y]
r.sort(reverse=True)
lis = pn+qn+r
lis.sort(reverse=True)
print(sum(lis[:(x+y)]))


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

#define fi first
#define se second
#define be begin
#define en end
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define ALL(a) (a).be() , (a).en()
#define REP(i,n) for(int (i)=0;(i)<(n);(i)++)        //repeat n times
#define REP2(i,s,n) for(int (i)=(s);(i)<(n);(i)++)   //repeat from s to n 
#define REPD(i,n) for(int (i)=(n);(i)>=0;(i)--)      //repeat from n to 0
#define REPD2(i,s,e) for(int (i)=(s);(i)>=(e);(i)--) //repeat from s to e
#define RANGE(i,v) for(auto &(i):v)                  //repeat range
#define ASIZE(a) (sizeof(a) / sizeof(a[0]))          //array size

using LL = long long;

template<typename T> using V = vector< T >;
using Vi = V<int>;
using Vll = V<LL>;
using Vs = V<string>;

template<typename T>
T vec_sum(V<T> v, T init_val=0){return accumulate(ALL(v),T(init_val));}

template<typename A>
void UNIQUE(vector< A > &a,int mode=0){
    if(mode==0){ sort(ALL(a),greater< A >());}else{ sort(ALL(a));}
    a.erase(unique(ALL(a)),a.en());
}

int main(){
    LL K;
    cin>>K;
    queue<LL> Q;
    REP(i,9){
        Q.push(i+1);
    }

    REP(i,K){
        LL x = Q.front();
        Q.pop();
        if(i+1==K) cout<<x<<endl;
        // cout<<i<<" "<<x<<endl;
        if(x%10!=0) Q.push(10*x + (x%10) -1);
        Q.push(10*x + (x%10));
        if(x%10!=9) Q.push(10*x + (x%10) +1);
    }
    return 0;
}

Measured memory_bytes: 1792
#include <iostream>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <string>
#include <iomanip>
#include <algorithm>
#include <cmath>
#include <utility>
#include <numeric>
 
using namespace std;

int main() {
  	int A, B;
  	cin >> A >> B;
  	
  	int ans = 0;
  	int tap = 1;
  	while (tap < B) {
      	tap += A - 1;
      	++ans;
    }
  	cout << ans << endl;
}


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

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int N, V;
    cin >> N;
    int A[N];
    for (int i = 0; i < N; i++){
        A[i] = 0;
    }
    for (int i = 1; i < N; i++){
        cin >> V;
        A[V-1]++;
    }
    for (int i = 0; i < N; i++){
        cout<< A[i] << '\n';
    }
}

Measured memory_bytes: 4440
#include<bits/stdc++.h>
using namespace std;
const int mod=998244353;
typedef long long ll;
const int N=3005;
int n,s;
ll dp[N];
int main()
{
    ll inv2=mod-mod/2;
    dp[0]=1;
    scanf("%d%d",&n,&s);
    ll ans=0;
    for(int i=1;i<=n;i++)
    {
        int x;scanf("%d",&x);
        for(int j=s;j>=x;j--)
            dp[j]=(dp[j]+dp[j-x]*inv2)%mod;
    }
    for(int i=1;i<=n;i++) dp[s]=dp[s]*2%mod;
    printf("%lld\n",dp[s]);
}

Measured memory_bytes: 3820
#include <stdio.h>

long int a,b,k;

int main(){

scanf("%ld %ld %ld", &a, &b, &k);

if(a >= k){
    printf("%ld %ld", a - k, b);
} else if(b - k + a > 0){
    printf("%ld %ld", 0, b - k + a);
} else{
    printf("%ld %ld", 0, 0);
}
    return 0;
}

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

#define DEBUG(C) cerr << #C << " = " << C << endl

using namespace std;

const int MAX = 333;
int w[MAX];
int dp[MAX][MAX];

bool solve() {
  int n;
  scanf("%d", &n);
  if (n == 0) {
    return false;
  }
  memset(w, 0, sizeof(w));
  for (int i = 0; i < n; i++) {
    scanf("%d", w + i);
  }
  memset(dp, 0, sizeof(dp));
  
  for (int len = 2; len <= n; len++) {
    for (int l = 0; l <= n - len; l++) {
      const int r = l + len;
      for (int m = l; m <= r; m++) {
        dp[l][r] = max(dp[l][r], dp[l][m] + dp[m][r]);
      }
      if (abs(w[l] - w[r - 1]) <= 1 && dp[l + 1][r - 1] == (r - 1) - (l + 1)) {
        dp[l][r] = r - l;
      }
    }
  }
  
  printf("%d\n", dp[0][n]);
  return true;
}

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

Measured memory_bytes: 3612
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>	
#include<map>
#include<set>
#include<utility>
#include<cmath>
#include<cstring>
#include<queue>
#include<stack>
#include<cstdio>
#include<sstream>
#include<iomanip>
#define loop(i,a,b) for(int i=a;i<b;i++) 
#define rep(i,a) loop(i,0,a)
#define pb push_back
#define mp make_pair
#define all(in) in.begin(),in.end()
#define shosu(x) fixed<<setprecision(x)
using namespace std;
//kaewasuretyuui
typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<vi> vvi;
typedef vector<pii> vp;
typedef vector<vp> vvp;
typedef vector<string> vs;
typedef vector<double> vd;
typedef vector<vd> vvd;
typedef pair<int,pii> pip;
typedef vector<pip>vip;
const double PI=acos(-1);
const double EPS=1e-7;
const int inf=1e8;
int main(){
	int a,b;
	char c;
	cin>>a>>c>>b;
	if(c=='-')cout<<a-b<<endl;
	else cout<<a+b<<endl;
}





Measured memory_bytes: 256
#pragma once
#include <sstream>
#include <string>
#include <vector>
#include <map>
#include <algorithm>
#include <iostream>
#include <utility>
#include <set>
#include <cctype>
#include <queue>
#include <stack>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <deque>
#include <numeric>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
const int INF = 100000001;
ll t[100010][50];
const ll mod = 1000000007;

ll rec(ll n, ll rem) {

	if (n == 1 || rem == 0) return 1;
	ll res = 0;
	for (int i = 1; i <= n && (rem - i) >= 0; i++)
	{
		res += (t[n][i] * rec(i, rem - i)) % mod;
	}
	return res;
}

void Factorization() {
	ll n, m;
	cin >> n >> m;

	t[0][0] = 1;
	for (int i = 1; i <= n; i++)
	{
		t[i][0] = t[i - 1][0];
		for (int j = 1; j < 35; j++)
		{
			t[i][j] = (t[i - 1][j] + t[i - 1][j - 1]);
			t[i][j] %= mod;
		}
	}

	ll res = 1;

	ll val = 2;
	while (val <= m)
	{
		int c = 0;
		while (m % val == 0)
		{
			m /= val;
			c++;
		}
		val += (val == 2) ? 1 : 2;
		if (c == 0) continue;
		ll mul = rec(n, c) % mod;
		res *= mul;
		res %= mod;
	}

	cout << res << endl;
}

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



Measured memory_bytes: 39296
#include<stdio.h>
 #include<math.h>
int main(){
  int i,j=0,k,sum=0,n[10000],flag=0,N,hantei;
  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&n[i]);
    if(n[i]%2==0 && n[i]!=2)continue;
    if(n[i]==2){ sum++; continue;}
    hantei=sqrt(n[i]);
   for(j=3;j<=hantei;j++){
    flag=0;
    if(n[i]%j==0){flag=1;break;}
  }
   if(flag==0)sum++;
  }
  printf("%d\n",sum);
  return 0;
}



Measured memory_bytes: 2064
#include<bits/stdc++.h>
using namespace std;
int x[10];
int y[10];
double distance(int i,int j){
  int dx=x[i]-x[j];
  int dy=y[i]-y[j];
  return sqrt(dx*dx+dy*dy);
}
int main(){
  int N;
  cin>>N;
  for(int i=0;i<N;i++){
    cin>>x[i]>>y[i];
  }
  vector<int> soeji(N);
  for(int i=0;i<N;i++)soeji[i]=i;
  double sum=0;
  int cnt=0;
  do{
    for(int i=0;i<N-1;i++){
      sum+=distance(soeji[i],soeji[i+1]);
    }
    cnt++;
  }while(next_permutation(soeji.begin(),soeji.end()));

  double ans=sum/cnt;
  cout<<fixed<<setprecision(10)<<ans<<endl;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define REP(i,a,b) for (int i = a; i < (b); ++i)
#define all(x) (x).begin(),(x).end()
#define YY puts("Yes")
#define NN puts("No")
const int INF = 1000000007;
typedef long long ll;
using namespace std;
using Graph = vector<vector<int>>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
ll lcm(ll a, ll b) { return (a * b) / gcd(a,b); }
ll fac(ll a) { return a > 1 ? fac(a - 1) * a : 1; }
int solve(){
  string s;
  cin >> s;
  if(s.substr(0,4) == "YAKI")YY;
  else NN;
  return 0;
}
int main(){
  // ios::sync_with_stdio(false);cin.tie(nullptr);
  // cout << fixed;cout << setprecision(16) << endl; 
  solve();
  return 0;
}

Measured memory_bytes: 384
/*
String[]の初期化、整数の型がlongになっているか
関数（splitとかcontainsとか）内では"+"とかは正規表現となされるので"\\+"とする
配列のコピーはarr1=arr.clone()
HashSet<>[]はおのおの初期化した？？？？？
負の数の割り算は絶対値が小さいほうに切り捨てられるex.-1/2=0ので、ある値>kみたいな式だとバグらせやすいので注意
ある値>=kとして、切り上げた値をとるべき
toLowerCase()はアルファベット以外に対して行ってもエラーにはならない
ArrayDequeではpopとpushはStackと同じ操作になる
//import static java.lang.System.*; はしばらく使わなそう(使うとしてもexit(0)のためだけ)←return;でよさそう
最後にout.flush()またはout.close()をするのを忘れずに！
*/
//入力終了→Ctrl+D
import java.util.*;
import java.io.*;
import java.awt.*;
import java.awt.geom.Point2D;
import static java.lang.Math.*;
public class Main {
    public static void main(String[] $) {
        String s=sc.next();
        int n=s.length();
        ArrayDeque<Integer> st=new ArrayDeque<>();
        ArrayDeque<Point> ans=new ArrayDeque<>();
        for (int i = 0; i < n; i++) {
            char c = s.charAt(i);
            int t=0;
            if (c == '\\') {
                st.push(i);
            } else if (c == '/') {
                if(!st.isEmpty()){
                    int temp=st.pop();
                    if(ans.isEmpty()){
                        ans.push(new Point(temp,i-temp));
                    }else{
                        int w=i-temp;
                        while (ans.size()>0&&temp<ans.peek().x){
                            w+=ans.pop().y;
                        }
                        ans.push(new Point(temp,w));
                    }
                }
            }

        }


        out.println(sum(ans));
        out.print(ans.size());
        while (!ans.isEmpty()){
            out.print(" ");
            out.print(ans.pollLast().y);
        }
        out.println();
        out.close();
    }
    static int sum(ArrayDeque<Point> q){
        int res=0;
        for (Point i:q)res+=i.y;
        return res;
    }

    static PrintWriter out = new PrintWriter(System.out);

    static class sc {
        static Scanner s = new Scanner(System.in);

        static String next() {
            return s.next();
        }

        static int nextInt() {
            return Integer.parseInt(s.next());
        }

        static long nextLong() {
            return Long.parseLong(s.next());
        }

        static double nextDouble() {
            return Double.parseDouble(s.next());
        }
    }
}


Measured memory_bytes: 28464
#include<iostream>
#include<string>
#include<algorithm>
#include<math.h>
using namespace std;
int main(){
	int N;
	cin>>N;
	int num[101]={0};
	int t;
	for(int i=0;i<N;i++){
		cin>>t;
		num[t]++;
	}
	int sum=0;
	for(int i=0;i<101;i++){
		if(num[i]!=0){
			sum++;
		}
	}
	cout<<sum<<endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define MAX 100000

int A[MAX],N;

int partition(int p,int r){
  int x,i,j,t;
  x = A[r];
  i = p-1;
  for(j = p;j<r;j++){
    if (A[j] <= x){
      i = i+1;
      t=A[i];
      A[i]=A[j];
      A[j]=t;
}
  }
  t=A[i+1];
  A[i+1]=A[r];
  A[r]=t;
  return i+1;
}

int main(){
  int i,b;

  scanf("%d",&N);
  for(i=0;i<N;i++){
    scanf("%d",&A[i]);
  }

  b=partition(0,N-1);

  for(i=0;i<N;i++){
    if(i)printf(" ");
    if(i==b)printf("[%d]",A[i]);
    else printf("%d",A[i]);
  }
  printf("\n");

  return 0;
}


Measured memory_bytes: 2184