akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<vector>
#include<algorithm>
#include<cctype>
#include<utility>
#include<string>
#include<cmath>
#include<cstdio>
#include<map>
#include<set>
#include<queue>

#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;
typedef long long int ll;

int main(){

    ll n;
    cin >> n;
    if(n == 3 || n == 5 || n == 7){
        cout << "YES" << endl;
    }else{
        cout << "NO" << endl;
    }



    return 0;
}

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

/*
a = # of balls with the string s
b = # of balls with the string t
*/
string s, t, u;
int a, b;

int main() {
	cin >> s >> t;
	cin >> a >> b;
	cin >> u;
	if(u == s) a--;
	if(u == t) b--;
	cout << a << " " << b;
	return 0;
}


Measured memory_bytes: 3584
s = gets.to_i

n = 0
step = 1
digit = 1
stack = []
start = 0

loop {
	over = false
	(start..9).each{|k|
		fizz = (n + step) / 3 - n / 3
		buzz = (n + step) / 5 - n / 5
		fizz_buzz = (n + step) / 15 - n / 15
		
		addition = digit * (step - fizz - buzz + fizz_buzz) + 4 * (fizz + buzz) 
		
		if s <= addition
			stack << k
			over = true
			start = 0
			break
		else
			s -= addition
			n += step
			start = 1
		end
	}
	
	if over
		step /= 10
		break if step == 0
	else
		step *= 10
		digit += 1
	end
}

x = stack.join.to_i + 1
str = ""
loop {
	str += 
		x % 15 == 0 ? "FizzBuzz" :
		x % 3 == 0 ? "Fizz" :
		x % 5 == 0 ? "Buzz" :
		x.to_s
	break if str.size - s >=  20
	x += 1
}

puts str[s-1..s+18]

Measured memory_bytes: 6116
#include <bitset>
#include <iostream>

using namespace std;

int main() {
  for (;;) {
    int N, M;
    cin >> N >> M;
    if (!N && !M) return 0;
    bitset<500> friend_list[500], guests;
    for (int i = 0; i < M; i++) {
      int a, b;
      cin >> a >> b;
      a--; b--;
      friend_list[a][b] = 1;
      friend_list[b][a] = 1;
    }
    guests = friend_list[0];
    for (int i = 0; i < N; i++)
      if (friend_list[0][i])
        guests |= friend_list[i];
    guests[0] = 0;
    cout << guests.count() << endl;
  }
}

Measured memory_bytes: 0
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define endl "\n"
#define MOD 1000000007
#define ar array
#define fast_io ios_base::sync_with_stdio(false); cin.tie(NULL);

int32_t main() {
	fast_io;

	// int t; cin >> t;
	// while (t--) {
		
	// }
	int n; cin >> n;
	vector<int> a(n);
	for (int i = 0; i < n; i++) {
		cin >> a[i];
	}
	vector<vector<pair<int, int>>> player_score(n, vector<pair<int, int>> (n, {0, 0}));
	for (int i = 0; i < n; i++) {
		player_score[i][i].first = a[i];
		player_score[i][i].second = 0;
	}
	for (int len = 2; len <= n; len++) {
		for (int i = 0; i < n - len + 1; i++) {
			int j = i + len - 1;
			player_score[i][j].first = a[j] + player_score[i][j - 1].second;
			player_score[i][j].second = player_score[i][j - 1].first;
			if (a[i] + player_score[i + 1][j].second > player_score[i][j].first) {
				player_score[i][j].first = a[i] + player_score[i + 1][j].second;
				player_score[i][j].second = player_score[i + 1][j].first;
			}
		}
	}
	cout << player_score[0][n - 1].first - player_score[0][n - 1].second << endl;

	return 0;
}

Measured memory_bytes: 144180
#include<bits/stdc++.h>
#define N 505
using namespace std;
int n,m,K;
int in[N];
int B[N];
int sum=0;
bool ck(int x){
	int cnt=0,ad=0;
	for(int i=1;i<=n;i++){
		B[i]=in[i]%x;
		cnt+=B[i];
		ad+=in[i]/x;
	}
	int nd=sum/x-ad;
	sort(B+1,B+n+1);
	for(int i=n;i>n-nd;i--){
		cnt+=x-2*(B[i]);
	}
	if(cnt/2>K)return 0;
	else return 1;
}
void solve(){
	scanf("%d %d",&n,&K);
	for(int i=1;i<=n;i++){
		scanf("%d",&in[i]);
		sum+=in[i];
	}
	int t;
	int ans=0;
	for(t=1;t*t<=sum;t++){
		if(sum%t==0){
			if(ck(t))ans=max(ans,t);
			if(t==(sum/t))continue;
			if(ck(sum/t))ans=max(ans,sum/t);
		}
	}
	printf("%d\n",ans);
}
int main() {
	solve();
	return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <climits>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
using namespace std;
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++ )
#define repf(i,m,n) for(int (i)=m;(i)<n;(i)++)
#define all(v) (v).begin(), (v).end()
#define ll long long
#define vec(name,num) vector<ll> name((num),0);
#define op(i) cout<<(i)<<endl;
#define ip(i) cin>>(i);
#define opN cout<<"No"<<endl;
#define opY cout<<"Yes"<<endl;
#define opP cout<<"Possible"<<endl;
#define opI cout<<"Impossible"<<endl;
#define mat(name,fnum,snum); vector<vector<ll>> name((fnum),vector<ll>((snum),0));
#define matC(name,fnum,snum); vector<vector<char>> name((fnum),vector<char>((snum),0));
#define debugP int debug_point; cin>>debug_point;
#define FI first
#define SE second
const ll MOD= 1e9 + 7;
template <typename T>
void putv(vector<T>& V){
	// cout << "The elements in the vector are: " << endl;
	for(auto x: V)
		cout << x << " ";
	cout << endl;
}
ll pow_mod(ll fi,ll se,ll mod){
  if(se==0){
    return 1;
  }
  if(se%2){
    return pow_mod(fi,se-1,mod)*fi%mod;
  }
  ll t=pow_mod(fi,se/2,mod);
  return t*t%mod;
}
template <class T>
vector<T> getv(ll n){
	vector<T> Vector_temp;
	rep(i,n){
		T input;
		cin >> input;
		Vector_temp.emplace_back(input);
	}
	return Vector_temp;
}
ll gcd(ll c,ll b){
    while(1){
        if(c%b!=0){
        ll tmp=b;
        b=c%b;
        c=tmp;
        }else{
            return b;
        }
    }
}

vector<pair<int,int>> Dir={{-1,0},{1,0},{0,1},{0,-1}};
/* <3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3<3*/


int main(){
  ll n,k;
  cin>>n>>k;
  vec(v,n);
  rep(i,n){
    cin>>v[i];
  }
  ll back=0;
  ll dump=0;
  if(k>n){
    dump=k-n;
    k=n;
  }
  ll ans=0;
  for(int use=k;use>=0;use--){  

    for(back=0;back<=use;back++){
      ll sum=0;
      vec(tmp,0);
      rep(i,use-back){
        sum+=v[i];
        tmp.push_back(v[i]);
      }
      rep(i,back){
        sum+=v[n-1-i];
        tmp.push_back(v[n-1-i]);
      }
      sort(all(tmp));
      /*
      rep(i,(ll)tmp.size()){
        cout<<tmp[i]<<endl;
      }
      cout<<endl;*/
      rep(i,dump+k-use){
        if(i>=(ll)tmp.size())break;
        if(tmp[i]<0){
          sum-=tmp[i];
        }
      }
      ans=max(ans,sum);
    }
  }
  op(ans);
  return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <queue>
#include <map>
#include <limits.h>
using namespace std;

struct Vertex;

struct Edge {
    int w;
    Vertex *s, *t;
};

struct Vertex {
    int n;
    vector<Edge*> neighbor;
    
    int d = INT_MAX;
    Vertex *pre = NULL;
    int visited = 0;
};


struct comparator {
    bool operator()(Vertex* p1, Vertex* p2) {
        return p1->d > p2->d;
    }
};

void djs(vector<Vertex*>v, int s) {
    
    vector<Vertex*>pq(v);
    pq[s]->d = 0;
    make_heap(pq.begin(),pq.end(),comparator());
    
    while(pq.size() > 0) {
        
        Vertex* sv = pq.front();
        sv->visited = 1;
        
        pop_heap(pq.begin(),pq.end(),comparator());
        pq.pop_back();
        
        for(auto e: sv->neighbor) {
            Vertex* tv = e->t;
            if (tv->visited) continue;
            if (sv->d + e->w < tv->d) {
                tv->d = sv->d + e->w;
                tv->pre = sv;
            }
        }
        
        make_heap(pq.begin(),pq.end(),comparator());
    }
    
}

int main() {
    
    int n, m;
    cin >> n >> m;
    
    vector<Vertex*>v;
    map<pair<int,int>, bool>mark;
    
    for (int i = 1; i <= n; i++) {
        Vertex *v1 = new Vertex();
        v1->n = i;
        v.push_back(v1);
    }
    
    for (int i = 0; i < m; i++) {
        int s,t,w;
        cin >> s >> t >> w;
        
        Vertex* sv = v[s-1];
        Vertex* tv = v[t-1];
        
        Edge* e = new Edge();
        e->s = sv;
        e->t = tv;
        e->w = w;
        sv->neighbor.push_back(e);
        
        Edge* e1 = new Edge();
        e1->s = tv;
        e1->t = sv;
        e1->w = w;
        tv->neighbor.push_back(e1);
        
        mark[make_pair(s,t)] = false;
        mark[make_pair(t,s)] = false;
        
    }
    
    for (int i = 0; i < n; i++) {
        
        for (auto v1: v) {
            v1->d = INT_MAX;
            v1->pre = NULL;
            v1->visited = 0;
        }
        
        djs(v,i);
        
        for (auto v1:v) {
            Vertex *travel = v1;
            while(travel->pre != NULL) {
                int t = travel->n;
                int s = travel->pre->n;
                mark[make_pair(s,t)] = true;
                mark[make_pair(t,s)] = true;
                travel = travel->pre;
            }
        }
    }
    
    int out = 0;
    for (auto m : mark) {
        if (m.second == false) out++;
    }
    cout << out/2 << endl;
    
    // djs(v,1);
    // for (auto v1:v) {
    //     cout << v1->n << ": " << v1->d << endl;
    //     Vertex *travel = v1;
    //     while(travel->pre != NULL) {
    //         int t = travel->n;
    //         int s = travel->pre->n;
    //         mark[make_pair(s,t)] = true;
    //         mark[make_pair(t,s)] = true;
    //         travel = travel->pre;
    //     }
    // }
    
    // for (auto m: mark) {
    //     cout << "(" << m.first.first << "," << m.first.second << ")" << ": " << m.second << endl;
    // }


	return 0;
}

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

ll N, M, V, P;
vector<ll>A;

bool C1(ll x){
    if (A[P-1] > A[x] + M) return false;
    ll ex = (V - P) * M;
    if (ex <= 0) return true;
    for (int i = P - 1; i < N; ++i) {
        if(i == x) continue;
        ex -= min(M, A[x] + M - A[i]);
    }
    if (ex <= 0) return true;
    else return false;
}

// 開区間と判定関数を引数にして条件を満たす境界値を返す
ll BiSearch(ll ok, ll ng, function<bool(ll)> C){
    while (abs(ok - ng) > 1) {
        ll mid = (ok + ng) / 2;
        if (C(mid)) ok = mid;
        else ng = mid;
    }
    return ok;
}

int main() {
    cin >> N >> M >> V >> P;
    A.resize(N);
    for (int i = 0; i < N; ++i) cin >> A[i];
    sort(A.begin(), A.end(), greater<int>());
    cout << BiSearch(P-1, N, C1) + 1 << "\n";
    return 0;
}

Measured memory_bytes: 1024
#include "bits/stdc++.h"
using namespace std;

int N, W;
long long w[105], v[105];
long long dp[105][100005];

// dp[i][j] = max val from 0 to i with weight j

long long rec(int d, int wght)
{
    if (wght < 0)
        return LLONG_MIN;

    // if d == 0, then it compulsarily takes v[0]
    if (d == -1)
    {
        if (wght >= 0)
            return 0;
        else
            return LLONG_MIN;
    }

    if (dp[d][wght] != -1)
        return dp[d][wght];

    long long val1 = rec(d - 1, wght - w[d]) + v[d];
    long long val2 = rec(d - 1, wght);
    dp[d][wght] = max(val1, val2);
    return dp[d][wght];
}

int main()
{
    cin >> N >> W;
    for (int i = 0; i < N; i++)
        cin >> w[i] >> v[i];

    for (int i = 0; i < N; i++)
        for (int j = 0; j <= W; j++)
            dp[i][j] = -1;

    long long ans = rec(N - 1, W);
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 80128
#include<bits/stdc++.h>
#define int long long int
using namespace std;

#undef int
int main() {
#ifndef ONLINE_JUDGE
	freopen("input.txt", "r", stdin);
	freopen("output.txt", "w", stdout);
#endif
#define int long long int
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
	int t = 1;
	//cin >> t;
	while (t--) {
		int a, b, c, k;
		cin >> a >> b >> c >> k;
		if (a + b >= k)
			cout << min(a, k) << endl;
		else
			cout << - (k - a - b) + a << endl;
	}
	return 0;
}

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

#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0)
#define endl "\n"
#define eb emplace_back
#define pb push_back
#define mk make_pair
#define mt make_tuple

#define Umap unordered_map
#define graph vector<vector<int>>

#define NO cout<<"NO"<<endl
#define YES cout<<"YES"<<endl

#define INF 1e9+5
#define N 40001


bool sortbysec(const tuple<int, int, int>& a,  
               const tuple<int, int, int>& b) 
{ 
    return (get<1>(a) < get<1>(b)); 
}

const int MAXN = 0;
int spf[MAXN];
void sieve(){
	spf[1] = 1;
	for(int i=2;i<MAXN;i++) spf[i] = i;

	for(int i=4;i<MAXN;i+=2) spf[i] = 2;

	for(int i=3; i*i<MAXN;i++){
		if(spf[i]==i){
			for(int j=i*i;j<MAXN;j+=i){
				if(spf[j]==j) spf[j] = i;
			}
		}
	}
}
bool custom(const pair<int, int>& a,  
               const pair<int, int>& b) 
{ 
    if(a.first==b.first) return a.second < b.second;
	return a.first > b.first; 
}

// A.reize(unique(A.begin(),A.end())- A.begin());
#define int long long
vector<int>primes;
const int m = (int)1e4+1;
bool prime[m];


void solve(){
	int n; cin>>n;
	if(n<=1) {cout<<0<<endl; return ;}
	int ans = 0;

	int req = 1;
	int cnt=0; 
	while(n && n%2==0){
		cnt++;
		if(cnt==req){
			ans++;
			req++;
			cnt=0;
		}
		n/=2;
	}

	for(int i=3;i*i<=n;i+=2){
		int req = 1;
		int cnt=0; 
		while(n && n%i==0){
			cnt++;
			if(cnt==req){
				ans++;
				req++;
				cnt=0;
			}
			n/=i;
		}	
	}
	if(n > 2) ans++;
	cout<<ans<<endl;
	
}

signed main() {
IOS;
	int t=1; 
	// cin>>t;
	for(int i=1;i<=t;i++){
		// cout<<"Case #"<<i<<": ";
		solve();
	}
	return 0;
}




vector<int> getFactorization(int x){

	vector<int> primeFactors;
	while(x>1){
		primeFactors.pb(spf[x]);
		x /= spf[x];
	}
	return primeFactors;
}


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

using namespace std;
typedef long long ll;

vector<int> ans;
vector<int> checked;
map<int, int> cnt;
int cat = 0;

void dfs(int index, const vector<vector<int>> &adj) {
    if (checked[index] != -1) return;
    checked[index] = cat;
    cnt[cat] += 1;
    for (int i = 0; i < adj[index].size(); i++) {
        dfs(adj[index][i], adj);
    }
}

int main(int argc, const char * argv[]) {
    int N, M, K;
    cin >> N >> M >> K;
    
    checked = vector<int>(N, -1);
    ans = vector<int>(N, 0);
//    vector<vector<int>> adj(N, vector<int>(N, 0));
    vector<vector<int>> adj(N, vector<int>());
    for (int i = 0; i < M; i++) {
        int a, b;
        cin >> a >> b;
//        adj[a-1][b-1] = 1;
//        adj[b-1][a-1] = 1;
        adj[a-1].push_back(b-1);
        adj[b-1].push_back(a-1);
        ans[a-1] -= 1;
        ans[b-1] -= 1;
    }
    
    for (int i = 0; i < N; i++) {
        if (checked[i] == -1) {
            dfs(i, adj);
            cat += 1;
        }
    }
    
    for (int i = 0; i < N; i++) {
        ans[i] += cnt[checked[i]] - 1;
    }
    
    for (int i = 0; i < K; i++) {
        int c, d;
        cin >> c >> d;
        if (checked[c-1] == checked[d-1]) {
            ans[c-1] -= 1;
            ans[d-1] -= 1;
        }
    }
    
    for (int i = 0; i < N; i++) {
        cout << ans[i];
        if (i < N - 1) cout << " ";
    }
    
    cout << endl;
    
    return 0;
}



Measured memory_bytes: 9600
n = int(input())
a = [ int(x) for x in input().split() ]

ans = abs(a[0] )

for i in range(1, len(a)):
    ans += abs(a[i] - a[i-1])

ans += abs(a[-1] - 0)

for i, v in enumerate(a):
    if i == 0:
        if 0 <= v <= a[i+1] or a[i+1] <= v <= 0:
            print(ans)
        elif 0 <= a[i+1] <= v or v <= a[i+1] <= 0:
            print(ans-abs(a[i+1]-v)*2)
        elif v <= 0 <= a[i+1] or a[i+1] <= 0 <= v:
            print(ans-abs(v)*2)

    elif i == n-1:
        if a[i-1] <= v <= 0 or 0 <= v <= a[i-1]:
            print(ans)
        elif a[i-1] <= 0 <= v or v <= 0 <= a[i-1]:
            print(ans-abs(v)*2)
        elif v <= a[i-1] <= 0 or 0 <= a[i-1] <= v:
            print(ans-abs(a[i-1]-v)*2)

    else:
        if a[i-1] <= v <= a[i+1] or a[i+1] <= v <= a[i-1]:
            print(ans)
        elif a[i-1] <= a[i+1] <= v or v <= a[i+1] <= a[i-1]:
            print(ans-abs(a[i+1]-v)*2)
        elif v <= a[i-1] <= a[i+1] or a[i+1] <= a[i-1] <= v:
            print(ans-abs(a[i-1]-v)*2)




Measured memory_bytes: 13800
s=gets.chomp
t=gets.chomp
s2=s.split('').sort.uniq
f=true
t.split('').sort.uniq.each{|c| (f=false;break) if not s2.include?(c)}
unless f
  puts -1
  exit
end
x=0
i=0 # 0.upto(t.size-1)
tn=1
while true
  li=0
  x=s.index(t[i], li)
  while x
    if i==t.size-1
      puts (tn-1)*s.size+x+1
      exit
    else
      i+=1
    end
    li=x+1
    
    x=s.index(t[i],li)
  end
  tn+=1
end

Measured memory_bytes: 17604
# python 3.4.3
import sys
input = sys.stdin.readline

# -------------------------------------------------------------
# library
# -------------------------------------------------------------
def gcd(a,b):
    return a if b == 0 else gcd(b,a%b)


# -------------------------------------------------------------
# main
# -------------------------------------------------------------
N = int(input())
A = list(map(int,input().split()))

# L[i] : A[0] 〜 A[i-1] までのgcd
# R[i] : A[N-1-i+1] 〜 A[N-1] までのgcd 
L = [0]*N
R = [0]*N

for i in range(1,N):
    L[i]     = gcd(L[i-1], A[i-1])
    R[N-1-i] = gcd(R[N-i], A[N-i])

ans = 0
for i in range(N):
    ans = max(ans, gcd(L[i],R[i]))

print(ans)

Measured memory_bytes: 14352
k = [i for i in range(1, 10 ** 5 + 1)]
v = [0] * (10 ** 5)
dic = {key: val for key, val in zip(k, v)}
n = int(input())
a = list(map(int, input().split()))
for i in range(n):
  dic[a[i]] += 1
q = int(input())
ans = [sum(a)]
for i in range(q):
  b, c = map(int, input().split())
  ans.append(ans[-1] + (c - b) * dic[b])
  dic[c] += dic[b]
  dic[b] = 0
for i in range(1, q + 1):
  print(ans[i])

Measured memory_bytes: 30664
#include <iostream>
#include<string>
#include<cmath>
#include<algorithm>
#include<cctype>
#include<queue>
#include<deque>
#include<regex>
#include<stack>
#include<stdio.h>
#include<vector>
#include<set>
#include<map>
#include<iomanip>
#define rep(i,n) for(int i=0;i<n;i++)

typedef int long long ll;
using namespace std;
typedef pair<int,int> P;
int dx[4]={1,0,-1,0};
int dy[4]={0,1,0,-1};
const ll MOD=1e9+7;
static const int MAX = 100;
static const int INF = (1<<23);
template<class T> T gcd(T a, T b){return b? gcd(b,a%b) : a;}
template<class T> T lcm(T a,T b){return a / gcd(a,b)*b;}

int main(){
    string s;
    cin>>s;
    if(s[s.size()-1]=='s'){
        cout<<s<<"es"<<endl;
    }else{
        cout<<s<<'s'<<endl;
    }







return 0;
}


Measured memory_bytes: 3628
t = [16,8,17,7,8,21,13,5,1,25,12,14,12,6,4,24,6,9,18,3,22,19,3,24,7,7,2,23,11,6,14,17,4,21,24,23,6,14,6,15,26,22,19,18,20,11,10,16,18,5,16,7,7,24,18,16,14,18,22,25,19,20,13,23,3,25,19,25,25,3,17,16,5,22,9,11,5,6,6,13,26,14,9,13,11,11,1,19,22,23,19,18,5,14,26,11,25,3,24,6,24,20,12,19,7,25,16,19,6,1,4,16,15,15,5,6,24,26,2,3,15,5,10,21,22,16,22,1,2,15,25,7,16,15,5,25,12,6,16,2,14,16,12,10,22,18,22,9,16,25,1,13,25,5,8,23,17,14,17,18,17,16,13,24,21,10,10,12,15,15,22,1,15,23,21,24,23,8,13,19,14,3,2,24,3,15,11,19,6,26,11,22,1,20,24,4,11,14,12,25,10,25,8,6,9,24,10,19,23,14,11,11,21,6,14,21,24,24,26,18,26,2,13,14,13,7,17,15,15,11,5,20,12,25,8,14,11,15,1,21,7,26,17,18,3,4,4,9,21,20,5,9,15,10,23,1,25,25,26,16,22,19,3,13,16,19,1,10,12,6,22,7,21,2,6,1,1,15,22,12,26,25,12,14,20,18,11,4,3,16,23,19,18,20,5,19,10,23,8,4,9,26,3,15,2,26,3,14,6,23,12,17,9,10,20,22,4,23,22,24,8,18,3,2,12,4,22,7,25,12,23,7,2,21,19,2,13,2,15,18,24,20,12,8,3,19,13,16,24,15,8,7,13,7,14,11,5,21,6,4,24,15,20,15,7]
for i in range(365):
  print(t[i])

Measured memory_bytes: 9204
#include<bits/stdc++.h>
using namespace std;
int n,m;
char s[510][510];
 int main()
{
	scanf("%d%d",&n,&m);
	for (int i=1;i<=n;i++) scanf("%s",s[i]+1);
	for (int i=1;i<=n;i++)
	{
		for (int j=1;j<=m;j++)
			printf((j==1||(j!=m&&i%2==1)||s[i][j]=='#')?"#":".");
		printf("\n");
	}
	printf("\n");
	for (int i=1;i<=n;i++)
	{
		for (int j=1;j<=m;j++)
			printf((j==m||(j!=1&&i%2==0)||s[i][j]=='#')?"#":".");
		printf("\n");
	}
}

Measured memory_bytes: 1024
#include<stdio.h>
int main(){
  int a, b, c;
  char op;
  scanf("%d %c %d", &a, &op, &b);
  while( 1 ){
    if ( op == '+' ){
      c = a + b;
      printf("%d\n",c);
} 
    else if ( op == '-' ){
      c = a - b;
      printf("%d\n",c);
} 
    else if ( op == '*' ){
      c = a * b;
      printf("%d\n",c);
} 
    else if ( op == '/' ){
      c = a / b;
      printf("%d\n",c);
}    
else {
break;
}
scanf("%d %c %d", &a, &op, &b);
}
return 0;
}


Measured memory_bytes: 2120
#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<unordered_map>
#include<array>
#include<map>
#include<iomanip>
using namespace std;
typedef long long int llint;
typedef long double lldo;
#define mp make_pair
#define mt make_tuple
#define pub push_back
#define puf push_front
#define pob pop_back
#define pof pop_front
#define fir first
#define sec second
#define res resize
#define ins insert
#define era erase
#define dme cout<<-1<<endl;return 0
//ios::sync_with_stdio(false);
//<< setprecision(5)
const int mod=1000000007;
const long double big=1e18+10;
const long double pai=3.141592653589793238462643383279502884197;
const long double ena=2.71828182845904523536;
const long double eps=1e-7;
template <class T,class U>void mineq(T& a,U b){if(a>b){a=b;}}
template <class T,class U>void maxeq(T& a,U b){if(a<b){a=b;}}
llint gcd(llint a,llint b){if(a%b==0){return b;}else return gcd(b,a%b);}
llint lcm(llint a,llint b){return a/gcd(a,b)*b;}
int main(void){
	ios::sync_with_stdio(false);
	int n,m,i,j,ans=0;cin>>n;
	multiset<int>a;
	for(i=0;i<n;i++){int q;cin>>q;a.ins(q);}
	cin>>m;
	for(i=0;i<m;i++){
		int q;cin>>q;
		auto it=a.find(q);
		if(it==a.end()){cout<<"NO"<<endl;return 0;}
		a.era(it);
	}
	cout<<"YES"<<endl;
	return 0;
}

Measured memory_bytes: 10112
#include <bits/stdc++.h>
using namespace std;
#define ll long long int
#define pb push_back
#define mp make_pair
#define deb(x) cout<< #x << " " << x << "\n";
#define MAX 9223372036854775807
#define MIN -9223372036854775807
#define PI 3.141592653589
#define setbits(n) __builtin_popcountll(n)
const ll mod=1e9+7;

const int N=17;
ll dp[(1<<N)],n;
vector<vector<ll>> a(N,vector<ll>(N));
vector<ll> add((1<<N));

ll go(ll mask){
    if(mask==0) return 0;
    if(dp[mask]!=-1)
        return dp[mask];
    ll k=setbits(mask);
    vector<ll> set;
    for(ll i=0;i<n;i++)
        if(((1<<i)&mask)!=0)
            set.pb(i);
    assert(set.size()==k);
    ll ans=0;
    //cerr<<k<<" ";
    for(ll i=1;i<(1<<k);i++){
        ll new_mask=mask, id_mask=0;
        vector<ll> id;
        for(ll j=0;j<k;j++){
            if(((1<<j)&i)!=0)
                new_mask^=(1<<set[j]), id_mask^=(1<<set[j]);
        }
        //cerr<<new_mask<<" ";
        ans=max(ans,add[id_mask]+go(new_mask));
    }
    return dp[mask]=ans;
}



int main() {
    
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll T=clock();
    
    cin>>n;
    for(ll i=0;i<n;i++)
        for(ll j=0;j<n;j++)
            cin>>a[i][j];
    memset(dp,-1,sizeof(dp));
    for(ll i=0;i<(1<<n);i++){
        vector<ll> id;
        for(ll j=0;j<n;j++){
            if(((1<<j)&i)!=0)
                id.pb(j);
        }
        ll sum=0;
        for(int j=0;j<id.size();j++)
            for(int k=j+1;k<id.size();k++)
                sum+=a[id[j]][id[k]];
        add[i]=sum;
    }
    cout<<go((1<<n)-1);

    cerr<<"\n\nTIME: "<<(double)(clock()-T)/CLOCKS_PER_SEC<<" sec\n";
    T = clock();
    return 0;
}

Measured memory_bytes: 5372
int main(void)
{
  int n, i, j, m=0;
  int h[100];
  int c = 0;
  scanf("%d", &n);
  h[0] = 0;
  for (i = 1; i <= n; i++) {
    scanf("%d", &h[i]);
    if (m < h[i])
      m = h[i];
  }
  for (i = 0; i < m; i++) {
    for (j = 1; j <= n; j++) {
      if (h[j-1] == 0 && h[j] >= 1)
        c++;
      if (h[j-1] >= 1)
        h[j-1]--;
    }
    if (h[n] >= 1)
      h[n]--;
  }
  printf("%d\n", c);
}


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

#define int long long 

signed main()
{
    map<multiset<int>,int> mp;
    int n;
    cin >> n;
    for(int i = 0;i < n; ++i)
    {
        string s;
        cin >> s;
        multiset<int> cur;
        for(int j = 0; j < s.length(); ++j)
        {
            cur.insert(s[j]);
        }
        mp[cur]++;
    }

    int ans = 0;

    for(auto x : mp)
    {
        int z = x.second;
        ans += ((z)*(z-1))/2;
    }

    cout << ans;
}

Measured memory_bytes: 57760
using static System.Console;
using static System.Convert;

class Program
{
    static void Main(string[] args)
    {
        var input = ReadLine().Split(' ');
        var num = ToInt32(input[0]);
        var min = ToInt32(input[1]);
        var max = ToInt32(input[2]);
        var result = 0;
        for(var i = 1; i <= num; i++)
        {
            var sum = 0;
            var str = i.ToString();
            for(var j = 0; j < str.Length; j++)
            {
                sum += ToInt32(str.Substring(j, 1));
            }
            if (sum >= min && sum <= max) result += i;
        }
        WriteLine(result);
    }
}



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

int main() {
  string S,T;
  int N;
  cin>>S>>T;
  N=S.size();
  int i=0;
  for(int j=0; j<N; j++)
    if(S.at(j) != T.at(j))
      i++;
  cout<<i<<endl;
}



Measured memory_bytes: 3844
using static System.Math;
using static System.Console;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System;

namespace AtCoder
{
    class Program
    {
        private static long mod = 1000000007;
        static void Main(string[] args)
        {
            var n = int.Parse(ReadLine());
            //var line = ReadLine().Split(' ').Select(value => long.Parse(value)).ToArray();

            if(n >= 30)
            {
                WriteLine("Yes");
            }
            else
            {
                WriteLine("No");
            }
        }
    }
}


Measured memory_bytes: 27448
#include <iostream>
#include <cstring>
#include <vector>
#include <algorithm>
#include <numeric>
#include <mutex>
#include <cmath>
#define lli long long int
#define ll long long
#define rep(i, n) for(int i = 0; i < (int)(n); i++)
using namespace std;

int main(){
  int N, M;
  cin >> N >> M;
  int L[M], R[M];
  int l = 0;
  int r = 100000;
  rep(i, M){
    cin >> L[i] >> R[i];
    if(l < L[i]) l = L[i];
    if(r > R[i]) r = R[i];
  }
  if(r - l >= 0){
    if(l > N) cout << 0;
    else if(N > r) cout << r - l + 1;
    else cout << N - l + 1;
  }
  else{
    cout << 0;
  }  
  return 0;
}


Measured memory_bytes: 1024
colatz=[1,2,4]
colatz.append(int(input()))
if colatz[3]==1 or colatz[3]==2 or colatz[3]==4:
    print(4)
else:
    b=3
    while colatz[b]!=4:
        if colatz[b]%2==0:
            colatz.append(colatz[b]/2)
        else: colatz.append(3*colatz[b]+1)
        b=b+1
    print(b+1)

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

int main() {
    int L, R, d; cin >> L >> R >> d;
    int ans = 0;
    for (int i = L; i <= R; ++i) {
        if (i % d == 0) ++ ans;
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 3628
/* ex 9_1
   Tarara */

#include <stdio.h>
#include <stdlib.h>
//スタックに格納するデータの最大数
#define SIZE 1000

//スタックの定義
typedef struct stack
{
    int size;
    int count;
    char data[SIZE];
    char *top;
} stack;

//スタックの初期化
void initialize_stack(stack *stk)
{
    stk->count = 0;
    stk->size = SIZE;
    stk->top = &(stk->data[SIZE]);
}

//データの追加
void push(stack *stk, char elem)
{
    if (stk->count >= stk->size)
    {
        fprintf(stderr, "Error: stack overflow. (x=%c)\n", elem);
        exit(1);
    }
    else
    {
        stk->top--;
        *(stk->top) = elem;
        stk->count++;
    }
}

//データの取り出し
char pop(stack *stk)
{
    char latest;
    if (stk->count <= 0)
    {
        fprintf(stdout, "Error: stack underflow.\n");
        exit(1);
    }
    else
    {
        latest = *(stk->top);
        stk->top++;
        stk->count--;
        return latest;
    }
}

int main(void)
{
    char input[SIZE];
    char *ptr;
    stack stk;
    int i;

    initialize_stack(&stk);

    // 入力
    scanf("%s", input);

    for (ptr = input; *ptr; ptr++)
    {
        // BackSpace
        if (*ptr == 'B')
        {
            if (stk.count > 0)
            {
                pop(&stk);
            }
        }
        // 文字を入力
        else
        {
            push(&stk, *ptr);
        }
    }

    // 出力
    // 出力順はstackの取り出し順と真逆にする
    for (i = 0; i < stk.count; i++)
    {
        printf("%c", stk.data[SIZE - 1 - i]);
    }
    printf("\n");
    return 0;
}

Measured memory_bytes: 1640
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#define jizz ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define pb push_back
#define F first
#define S second
#define MP make_pair
#define ET cout << "\n"
#define ALL(v) v.begin(),v.end()
#define MEM(i,j) memset(i,j,sizeof i)
#define DB(a,s,e) {for(int i=s;i<e;i++) cout << a[i] << " ";ET;}
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

const int MAXC=100000;
pii cnt1[100001],cnt2[100001];

int main()
{jizz
	int n,x;
	cin >> n;
	for(int i=0;i<n;++i)
		if(cin >> x,i&1) ++cnt1[x].F;
		else ++cnt2[x].F;
	for(int i=1;i<=MAXC;++i)
		cnt1[i].S=cnt2[i].S=i;
	sort(cnt1+1,cnt1+MAXC+1),sort(cnt2+1,cnt2+MAXC+1);
	if(cnt1[MAXC].S!=cnt2[MAXC].S)
		cout << n-cnt1[MAXC].F-cnt2[MAXC].F << "\n";
	else
		cout << n-max(cnt1[MAXC].F+cnt2[MAXC-1].F,cnt1[MAXC-1].F+cnt2[MAXC].F) << "\n";
}

Measured memory_bytes: 1792
import sys
N = int(input())
s = str(input())
t = str(input())


length = len(s) + len(t)
if (N >= (length)):
  print(N)
  sys.exit()


min_a = t if (len(s) > len(t)) else s
max_b = s if (len(s) > len(t)) else t

cnt = 0
j = 0

for i in range(len(min_a)):
  touch = False
  k = 0
  for j in range(i, len(min_a)):
    #print(j, min_a[j], max_b[k])
    if (min_a[j] == max_b[k]):
      k += 1
      cnt += 1
    else:
      touch = True
      cnt = 0
      break
  if(touch == False):
      break

print(max(length - cnt, N))


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

//#define int long long
#define all(v) (v).begin(), (v).end()
#define rall(v) (v).rbegin(), (v).rend()
#define rep(i,n) for(int i=0;i<n;++i)
#define rep1(i,n) for(int i=1;i<n;++i)
#define exrep(i, a, b) for(ll i = a; i < b; i++)
#define out(x) cout << x << endl
#define EPS (1e-7)
#define gearup ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
typedef long double ld;
typedef long long int ll;
typedef unsigned long long int ull;
typedef vector<int> vi;
typedef vector<char> vc;
typedef vector<bool> vb;
typedef vector<double> vd;
typedef vector<string> vs;
typedef vector<pair<int,int> > vpii;
typedef vector<vector<int> > vvi;
typedef vector<vector<char> > vvc;
typedef vector<vector<bool> > vvb;
typedef vector<vector<double> > vvd;
typedef vector<vector<string> > vvs;
typedef vector<ll> vl;
typedef vector<vector<ll> > vvl;
typedef vector<vector<vector<ll> > > vvvl;
ll MOD = 1000000007;
const long long L_INF = 1LL << 60;
const int INF = 2147483647; // 2^31-1
const double PI = acos(-1);
//cout<<fixed<<setprecision(10);

template<class T> inline bool chmin(T& a, T b) {if (a > b) {a = b;return true;}return false;}
template<class T> inline bool chmax(T& a, T b) {if (a < b) {a = b;return true;}return false;}
template<class T> void debug(T v){rep(i,v.size()) cout<<v[i]<<" ";cout<<endl;}
const ll dx[8] = {1, 1, 0, -1, -1, -1, 0, 1};
const ll dy[8] = {0, 1, 1, 1, 0, -1, -1, -1};

signed main()
{   
    gearup;
    ll n,k; cin >> n >> k;
    vl a(n),f(n);
    rep(i,n)cin>>a[i];
    rep(i,n)cin>>f[i];
    sort(rall(a));
    sort(all(f));
    ll ma = 1e12 + 1,mi = -1;
    while(ma - mi > 1){
        ll mid = (ma + mi) /2;
        //midの値以下にできるか
        ll ttl = 0;
        rep(i,n){
            ll cnt = mid/f[i]; //切り捨て
            if(cnt < a[i])ttl += a[i] - cnt;
        }
        if(ttl <= k)ma = mid;
        else mi = mid;
    }
    out(ma);
}


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

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

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Arrays;
import java.util.Scanner;

public class Main {
    public static void main(String[] args) throws Exception {
        Main main = new Main();
        main.solve();
    }
    public void solve() throws Exception {
        Scanner scan = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
        int n = scan.nextInt();
        int k = scan.nextInt();
        int[] h = new int[n+k];
        for (int i = 0; i < n; i++) {
            h[i] = scan.nextInt();
        }
        long[] dp = new long[n+k];
        Arrays.fill(dp, Long.MAX_VALUE);
        dp[0] = 0;
        for (int i = 0; i < n; i++) {
            for (int j = 1; j <= k; j++) {
                dp[i+j] = Math.min(dp[i+j],dp[i] + Math.abs(h[i+j]-h[i]));
            }
        }
        System.out.println(dp[n-1]);
    }
}


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

int main(){
    int H,W;
    int a,b;
    
    while(1){
    cin >> H >> W;
    if(H==0 && W==0)break;
    
    for(a=1;a<=H;a++){
        
        for(b=1;b<=W;b++){
            cout << '#';
        }
        
        cout << endl;
    }
    cout << endl;
    }
    return 0;
}


Measured memory_bytes: 3088
#include<iostream>
#include<array>
#include<vector>
#include<string>
#include<cstring>
#include<set>
#include<unordered_set>
#include<map>
#include<unordered_map>
#include<queue>
#include<stack>
#include<deque>
#include<algorithm>
#include<cmath>
#include<climits>

using namespace std;
#define ll long long
#define ff first
#define ss second
#define e endl



void solve() {
	ll n, m; cin >> n >> m;
	vector<ll> v[200001];
	for(ll i = 0;i < m;i++){
		ll x, y;
		cin >> x >> y;
		v[x].push_back(y);
		v[y].push_back(x);
	}
	bool vis[200001];
	memset(vis, false, sizeof(vis));
	ll count = 0;
	for(ll i = 1;i <= n;i++){
		if(!vis[i]){//cout << i <<"ji"<< endl;
			ll c = 1;
			queue<ll> q;
			q.push(i);
			vis[i] = true;
			while(!q.empty()){
				ll x = q.front();
				q.pop();
				for(ll j = 0;j < v[x].size();j++){
					if(!vis[v[x][j]]){//cout << v[x][j] << e;
						c++;
						q.push(v[x][j]);
						vis[v[x][j]] = true;
					}
				}
			}
			count = max(count, c);
		}

	}
	cout << count << e;
}

int main()
{
	//ll t; cin >> t; while (t--)
	solve();
	
}

Measured memory_bytes: 17352
import java.util.Arrays;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		char[] s = sc.next().toCharArray();
		int ans = Integer.MAX_VALUE;
		for(char c = 'a' ; c <= 'z' ; c++) {
			boolean find = false;
			for(int i = 0 ; i < s.length ; i++) {
				if(c == s[i]) find = true;
			}
			if(!find) continue;
			int cnt = 0;
			char[] t = Arrays.copyOf(s, s.length);
			while(true) {
				boolean ok = true;
				for(int j = 0 ; j < t.length ; j++) {
					if(c != t[j]) ok = false;
				}
				if(ok) break;
				char[] u = new char[t.length - 1];
				for(int j = 0 ; j < t.length - 1 ; j++) {
					if(c == t[j] || c == t[j + 1]) {
						u[j] = c;
					} else {
						u[j] = t[j];
					}
				}
				t = u;
				cnt++;
			}
			ans = Math.min(ans, cnt);
		}
		System.out.println(ans);
	}
}


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

template<typename T> T merge_count(vector<T>& a) {
  if(a.size() <= 1) return 0;
  T cnt = 0;
  vector<T> b(a.begin(), a.begin() + a.size() / 2);
  vector<T> c(a.begin() + a.size() / 2, a.end());
  cnt += merge_count(b) + merge_count(c);
  T ai = 0, bi = 0, ci = 0;
  while(ai < a.size()) {
    if(bi < b.size() && (ci == c.size() || b[bi] < c[ci])) {
      a[ai++] = b[bi++];
    } else {
      cnt += a.size() / 2 - bi;
      a[ai++] = c[ci++];
    }
  }
  return cnt;
}

int main() {
  long long N;
  cin >> N;
  vector<long long> A(N);
  for(auto& i: A) cin >> i;

  auto M = N*(N+1)/2;

  auto ok = [&](auto X) {
    vector<long long> S = {0};
    for(auto i: A) S.emplace_back(S.back() + (i<X ? 1: -1));
    return (M+1)/2 <= merge_count(S);
  };

  long long l = 1, h = 1e9+1;
  while(1 < h-l) {
    auto m = (l + h) / 2;
    if(ok(m)) l = m;
    else      h = m;
  }
  cout << l << endl;
}


Measured memory_bytes: 5348
#include <bits/stdc++.h>
using namespace std;
int main() {
  int fib[100];
  fib[0] = 1;
  fib[1] = 1;
  for(int i = 2;i < 50;i++)fib[i] = fib[i-1] + fib[i-2];
  int n;
  cin >> n;
  cout << fib[n] << endl;
}



Measured memory_bytes: 3076
#define _GLIBCXX_DEBUG
#include "bits/stdc++.h"
//#include <intrin.h>  //AtCoder (gcc) 上ではこれがあると動かない。__popcnt用のincludeファイル。
using namespace std;
using Graph = vector<vector<int>>;

typedef long long ll;
typedef long double ld;


#define int long long
#define rep(i, n) for(long long i = 0; i < (n); i++)
#define sqrt(d) pow((long double) (d), 0.50)

const int INF = 2e9;
const ll large_P = 1e9 + 7;



//繰り返し2乗法
//N^aの、Mで割った余りを求める。
ll my_pow(ll N, ll a, ll M) {
	ll tempo;
	if (a == 0) {
		return 1;
	}
	else {
		if (a % 2 == 0) {
			tempo = my_pow(N, a / 2, M);
			return (tempo * tempo) % M;
		}
		else {
			tempo = my_pow(N, a - 1, M);
			return (tempo * N) % M;
		}
	}
}



//N_C_a を M で割った余り
ll my_combination(ll N, ll a, ll M) {
	ll answer = 1;

	rep(i, a) {
		answer *= (N - i);
		answer %= M;
	}

	rep(i, a) {
		answer *= my_pow(i + 1, M - 2, M);
		answer %= M;
	}

	return answer;
}



ll my_gcd(ll& a, ll& b) {
	if (b == 0) return a;
	ll temp = a % b;
	return my_gcd(b, temp);
}



// long long型 n を、base 進法での、i 桁目の数が入った vector にする。
void ll_to_vector(ll base, ll n, vector<ll>& v) {
	ll tempo = n;

	ll n_digit = floor(log10(n) / log10(base)) + 1;
	v.assign(n_digit, 0);

	//ll n_digit = v.size();

	for (ll i = 0; i < n_digit; i++) {
		v.at(i) = tempo / pow(base, n_digit - 1 - i);
		tempo -= v.at(i) * pow(base, n_digit - 1 - i);
	}
}



int char_to_int(char c) {
	switch (c) {
	case '0': return 0; case '1': return 1; case '2': return 2; case '3': return 3; case '4': return 4;
	case '5': return 5; case '6': return 6; case '7': return 7; case '8': return 8; case '9': return 9;
	default: return 0;
	}
}


//エラトステネスの篩で、prime で ないところに false を入れる。
//true で初期化された vector を代入する必要がある。
void prime_judge(vector<bool>& prime_or_not) {

	prime_or_not.at(0) = false;
	prime_or_not.at(1) = false;

	ll n = prime_or_not.size() - 1;
	ll region = sqrt(n) + 1;

	for (ll i = 2; i <= n / 2; i++) {
		prime_or_not.at(2 * i) = false;
	}


	for (ll i2 = 1; i2 < n / 2; i2++) {
		ll i = 2 * i2 + 1;  //ここからは奇数のみ探索
		if (i < region && prime_or_not.at(i)) {
			ll j = i * i;
			while (j < n + 1) {
				prime_or_not.at(j) = false;
				j += 2 * i;
			}
		}
	}
};



map<int, int> divide_to_prime(int target) {
	map<int, int> res;

	//sqrt(target) まで調べる。
	int upper_lim = ceil(sqrt(target));
	vector<bool> prime_or_not(upper_lim + 1, true);

	if (upper_lim < 20) prime_or_not.assign(25, true);
	prime_judge(prime_or_not);

	int tempo = target;
	rep(i, upper_lim + 1) {
		if (prime_or_not.at(i)) {
			while (tempo % i == 0) {
				tempo /= i;
				res[i]++;
			}
		}
	}
	
	if (tempo != 1) res[tempo]++; //targetは素数である。



	return res;
}





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

	map<int, int> memo = divide_to_prime(M);

	//約数の数 D に 対して、配り方が、(N - 1 + D)_C_D 通りある。
	int res = 1;
	for (auto&& iter = memo.begin(); iter != memo.end(); iter++) {
		res *= my_combination(N - 1 + iter->second, iter->second, large_P);
		res %= large_P;
	}

	cout << res << endl;


	//for (auto&& iter = memo.begin(); iter != memo.end(); iter++) {
		//cout << iter->first << " " << iter->second << endl;
	//}

}

Measured memory_bytes: 512
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <string.h>
#include <queue>
#include <algorithm>
using namespace std;
typedef unsigned int uint;
typedef long long ll;
typedef pair<int, int> P;
const int c_INF = 111111111;
const int c_mINF = -111111111;
const int c_YET = -1;
const int c_Dx[8] = { 0,0,1,-1, 1,1,-1,-1 };// 前４つで４近傍
const int c_Dy[8] = { 1,-1,0,0 ,1,-1,1,-1};// 全部で８近傍
const int c_div = 1000000007; //10^9 + 7
const double PI = 3.14159265358979323846;


int main() {

	int N;
	scanf("%d", &N);

	int ans = 1;

	for (int i = 0; i < 10; i++) {
		if (ans * 2 > N) {
			printf("%d", ans);
			break;
		}
		else {
			ans *= 2;
		}

	}






}







Measured memory_bytes: 128
import numpy as np
import sys
input2 = sys.stdin.read

# A: Anti-clockwise, B: Clockwise, V: Values
n, c = map(int, input().split())
AV = np.array(list(map(int, input2().rsplit())), dtype=np.int64)
A, V = AV[::2], AV[1::2]
B = (c - A)[::-1]

XA = np.cumsum(V) - A
XB = np.cumsum(V[::-1]) - B
RXA, RXB = XA - A, XB - B    # Cumulative Values returning to Start

MA = np.zeros(n + 1, dtype=np.int64)
MB = np.zeros(n + 1, dtype=np.int64)
MRA = np.zeros(n + 1, dtype=np.int64)
MRB = np.zeros(n + 1, dtype=np.int64)


def max_mem(lis, mlis):
    for i in range(n):
        mlis[i + 1] = max(mlis[i], lis[i])


max_mem(XA, MA)
max_mem(XB, MB)
max_mem(RXA, MRA)
max_mem(RXB, MRB)

if n == 1:
    print(MA[1])
    exit()

#print(MA, MB, MRA, MRB)

res1, res2 = 0, 0
for i in range(n + 1):
    res1 = max(res1, MA[i] + MRB[n - i])
    res2 = max(res2, MB[i] + MRA[n - i])
    #print(res1, res2)

print(max(res1, res2))


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

typedef pair<int, int> P;
const int MAX_H = 50, MAX_W = 50, INF = (1 << 30);
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};
int dist[MAX_H][MAX_W], h, w, num_white;
bool isWhite[MAX_H][MAX_W];
char ch;

int main() {
    cin >> h >> w;
    for (int i = 0; i < h; i++) {
        for (int j = 0; j < w; j++) {
            cin >> ch;
            if (ch == '.') {
                num_white++;
                isWhite[i][j] = true;
            } else {
                isWhite[i][j] = false;
            }
            dist[i][j] = INF;
        }
    }
    // breadth-first search
    queue<P> que;
    que.push(P(0, 0));
    dist[0][0] = 0;
    while (que.size()) {
        P p = que.front(); que.pop();
        for (int i = 0; i < 4; i++) {
            int nx = p.first + dx[i];
            int ny = p.second + dy[i];
            if (0 <= nx && nx < w && 0 <= ny && ny < h && isWhite[ny][nx] && dist[ny][nx] == INF) {
                que.push(P(nx, ny));
                dist[ny][nx] = dist[p.second][p.first] + 1;
            }
        }
    }

    int ans = num_white - dist[h-1][w-1] - 1;
    if (ans < 0) ans = -1;
    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 256
#include<iostream>

using namespace std;

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

	if(N == 1) {
		cout << "Hello World" << endl;
	}
	else if(N == 2) {
		int a, b;
		cin >> a >> b;

		cout << (a + b) << endl;
	}

	return 0;
}

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

namespace TYC
{
	typedef long long ll;

	const int N = 1003;
	const int dx[] = {-1, 1, 0, 0}, dy[] = {0, 0, -1, 1};
	const char CH[] = {'R', 'L', 'U', 'D'};

	int n, dc;
	ll X[N], Y[N], D[N], S[N];
	char R[N];

	inline bool check(const ll x, const ll y, const int i)
	{
		return abs(x) + abs(y) <= S[i];
	}

	void work()
	{
		scanf("%d", &n);
		for (int i = 1; i <= n; i++)
		{
			scanf("%lld%lld", &X[i], &Y[i]);
			if (i != 1 && ((X[i] + Y[i]) & 1) != ((X[1] + Y[1]) & 1))
				return void(puts("-1"));
		}
		if (!((X[1] + Y[1]) & 1))
			D[++dc] = 1;
		for (int i = 0; i <= 30; i++)
			D[++dc] = 1LL << i;
		printf("%d\n", dc);
		for (int i = 1; i <= dc; i++)
		{
			printf("%lld ", D[i]);
			S[i] = S[i - 1] + D[i];
		}
		puts("");
		for (int i = 1; i <= n; i++)
		{
			ll x = X[i], y = Y[i];
			for (int j = dc; j; j--)
				for (int k = 0; k < 4; k++)
				{
					ll tx = x + dx[k] * D[j], ty = y + dy[k] * D[j];
					if (check(tx, ty, j - 1))
					{
						R[j] = CH[k];
						x = tx, y = ty;
						break;
					}
				}
			puts(R + 1);
		}
	}
}

int main()
{
	TYC::work();
	return 0;
}

Measured memory_bytes: 256
import sys
def gaiseki(x0, y0, x1, y1):
    return x0*y1 - y0*x1
def muki(x0, y0, x1, y1, x2, y2):
    return gaiseki(x1-x0, y1-y0, x2-x1, y2-y1) > 0
for line in sys.stdin:
    x0, y0, x1, y1, x2, y2, xp, yp = map(float, line.split())
    m0 = muki(xp, yp, x0, y0, x1, y1)
    m1 = muki(xp, yp, x1, y1, x2, y2)
    m2 = muki(xp, yp, x2, y2, x0, y0)
    if m0 == m1 and m1 == m2:
        print('YES')
    else:
        print('NO')






Measured memory_bytes: 5588
import sys
import math
from collections import defaultdict

sys.setrecursionlimit(10**7)
def input():
    return sys.stdin.readline()[:-1]

mod = 10**9 + 7

def I(): return int(input())
def II(): return map(int, input().split())
def III(): return list(map(int, input().split()))
def Line(N,num):
    if N<=0:
        return [[]]*num
    elif num==1:
        return [I() for _ in range(N)]
    else:
        read_all = [tuple(II()) for _ in range(N)]
        return map(list, zip(*read_all))

#################

S = str(input())
n = len(S)
count = 0
for i in range(n//2):
    if S[i]!=S[n-1-i]:
        count += 1
print(count)

Measured memory_bytes: 38384
#include <stdio.h>

int main () {
	int H1,M1,H2,M2,K;
	scanf("%d%d%d%d%d", &H1,&M1,&H2,&M2,&K);
	
	int sum= ((H2-H1)*60) + (M2-M1) -K;
	printf("%d", sum);
	
	

	
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
using namespace std;
#define REP(i, n) for(int i = 0; i < n; i++)
#define REPR(i, n) for(int i = n - 1; i >= 0; i--)
#define FOR(i, m, n) for(int i = m; i <= n; i++)
#define FORR(i, m, n) for(int i = m; i >= n; i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
 
using ll = long long;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using P = pair<ll, ll>;

int main(){
    ll a, b, c;
    cin >> a >> b >> c;
    if(a < b && b < c){
        cout << "Yes" << endl;
        return 0;
    }
    cout << "No" << endl;
    return 0;
}


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

using namespace std;

int main() {
  int n, m;
  cin >> n >> m;
  vector<int> s(m), c(m);
  for (int i = 0; i < m; i++) {
    cin >> s[i] >> c[i];
  }
  for (int num = 0; num < 1000; num++) {
    string t = to_string(num);
    int d = t.size();
    bool ok = true;
    for (int i = 0; i < m; i++) {
      if (d < s[i]) {
        ok = false;
        continue;
      }
      if (c[i] != t[s[i] - 1] - '0') ok = false;
    }

    if (ok && d == n) {
      cout << num << endl;
      return 0;
    }
  }
  cout << -1 << endl;

  return 0;
}

Measured memory_bytes: 256
#include <stdio.h>
#include <string.h>
main(){
  char a[1002];
  int n,kazu,i,j=0;

  scanf("%d",&n);
  fgets(a,sizeof(a),stdin);
  
  for(;n--;){
  
    fgets(a,sizeof(a),stdin);
    kazu=strlen(a);
    a[kazu] = '\0';

    for(i=0;i<kazu-6;i++){
      if(a[i]=='H' && a[i+1]=='o' && a[i+2]=='s' && a[i+3]=='h' && a[i+4]=='i' && a[i+5]=='n' && a[i+6]=='o'){
	a[i+6]='a';
      }
    }
    printf("%s",a);
  }
  return 0;
}

Measured memory_bytes: 600
#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cmath>
#include<algorithm>
#include<cstring>
#include<vector>
#include<sstream>
#include<queue>
#include<stack>
#include<string>
#include<climits>
#include<map>
#include<set>
#define REP(i,s,n) for(int i=s;i<n;i++)
#define rep(i,n) REP(i,0,n)
#define INF 1<<30
#define F first
#define S second
using namespace std;
typedef pair<int,int> P;
int famine[10000];

void add(string s){
  reverse(s.begin(),s.end());
  bool plus = false;
  int A,B,C,i;
  for(i=0;i<10000;i++){
    A = i<s.length()?s[i]-'0':0;
    B = famine[i];
    C = plus?1:0;
    plus = A+B+C>=10?true:false;
    famine[i] = (A+B+C)%10;
  }    
  bool cle = false;
 
}


int main(){
  string s;
  int sam = 0,st;
  bool config;

  for(int i=0;i<10000;i++)famine[i] = 0;
  while(getline(cin,s,'\n')){
    config = false;
    for(int i=0;i<=s.length();i++){    
      if(!('0' <= s[i] && s[i] <= '9') || i == s.length() ){
	if(config){
	  add(s.substr(st,i-st));
	  config = false;
	}
	continue;
      }
      if(!config)st = i;
      config = true;
    }
  }
  bool cle = false;
  for(int i=10000;i>=0;i--){
    if(!cle && famine[i] == 0)continue;
    cle = true;
    cout << famine[i];
  }
  cout << endl;
return 0;
}

Measured memory_bytes: 1224