akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <algorithm>
#include <cmath>
using namespace std;

#define FOR(i,a,b) for (int i=(a);i<(b);i++)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n) for (int i=0;i<(n);i++)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)

void trace(int a[], int n){
    REP(i, n) {
        if (i>0) cout << " ";
        cout << a[i];
    }
    cout << endl;
}

void SelectionSort(int a[], int n) {
    int cnt = 0;
    REP(i, n) {
        int min = i;
        FOR(j, i, n) {
            if (a[j] < a[min]) min=j;
        }
        if (i!=min) {
            cnt++;
            swap(a[i], a[min]);
        }
    }
    trace(a, n);
    cout << cnt << endl;
}

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

    int a[100];
    REP(i, n) {
        cin >> a[i];
    }

    SelectionSort(a, n);
    return 0;
}

Measured memory_bytes: 3092
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define pb push_back
#define rep(i,a,b) for(i=a;i<b;i++)
ll int large=(ll int)1e13+7;
ll int mod=(ll int)1e5;
ll int const N=(ll int)1e5+10;

ll int mod_exp(ll int x,ll int n)
{
    ll int result=1;
    while(n>0)
    {
        if(n%2==1)
            result=(result*x)%mod;
        x=(x*x)%mod;
        n=n/2;
    }
    return result;
}

ll int mod_inverse(ll int a)
{
    return mod_exp(a,mod-2);
}




int main()
{
ios_base::sync_with_stdio(false);
    cin.tie(NULL);
ll int T,i,j,ij;
T=1;
//cin>>T;
while(T--)
{
  ll int n;
  cin>>n;
  map<string,ll int>mp;
  rep(i,0,n)
  {
    string s;
    cin>>s;
    mp[s]++;
  }
   cout<<"AC"<<" "<<"x"<<" "<<mp["AC"]<<endl;
cout<<"WA"<<" "<<"x"<<" "<<mp["WA"]<<endl;
cout<<"TLE"<<" "<<"x"<<" "<<mp["TLE"]<<endl;
cout<<"RE"<<" "<<"x"<<" "<<mp["RE"]<<endl;

}
return 0;
}
















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

vector<int> p;
int v;


int main(){
    int N;
    scanf("%d",&N);
    for(int i=0;i<N;i++){
        scanf("%d",&v);
        p.push_back(v);
    }
    sort(p.begin(),p.end());
    int max = p[p.size()-1];
    p.pop_back();
    p.push_back(max/2);
    cout << accumulate(p.begin(),p.end(),0)<< endl;
    
    
    return 0;
}

Measured memory_bytes: 3736
#include <iostream>
#include <string>

using namespace std;

main(){
  string data;
  while(cin >> data){
    int n;
    cin >> n;
    string in[100];
    for(int i=0;i<n;i++){
      cin >> in[i];
    }
    string in2[100];
    for(int i=0;i<n;i++){
      in2[i]=in[i]+in[i];
    }
    int ans=0;
    int size=data.size();
    for(int i=0;i<n;i++){
      for(int j=0, k=0;j<in2[i].size();j++){
	if(data[k]==in2[i][j]){
	  k++;
	  if(k==size){
	    ans++;
	    break;
	  }
	}
	else if(data[0]==in2[i][j]){
	  k=1;
	}
	else{
	  k=0;
	}
      }
    }
    cout << ans << endl;
  }
  return 0;
}

Measured memory_bytes: 0
#include <cstdio>
#include <vector>
#include <cstring>
#include <algorithm>
using namespace std;
const int maxn = 100 + 10;
const int INF = 100000000;

int M, N;
int X1[maxn], Y1[maxn];
int X2[maxn], Z2[maxn];

double width(int* X, int* Y, int n, double x)
{
    double lb = INF, ub = -INF;
    for (int i = 0; i < n; i++){
        double x1 = X[i], y1 = Y[i], x2 = X[(i + 1) % n], y2 = Y[(i + 1) % n];
        if ((x1 - x) * (x2 - x) <= 0 && x1 != x2){
            double y = y1 + (y2 - y1) * (x - x1) / (x2 - x1);
            lb = min(lb, y);
            ub = max(ub, y);
        }
    }
    return max(0.0, ub - lb);
}

void solve()
{
    int min1 = *min_element(X1, X1 + M);
    int max1 = *max_element(X1, X1 + M);
    int min2 = *min_element(X2, X2 + N);
    int max2 = *max_element(X2, X2 + N);
    vector<int> xs;
    for (int i = 0; i < M; i++)
        xs.push_back(X1[i]);
    for (int i = 0; i < N; i++)
        xs.push_back(X2[i]);
    sort(xs.begin(), xs.end());

    double res = 0;
    for (int i = 0; i + 1 < xs.size(); i++){
        double a = xs[i], b = xs[i + 1], c = (a + b) / 2;
        if (min1 <= c && c <= max1 && min2 <= c && c <= max2){
            double fa = width(X1, Y1, M, a) * width(X2, Z2, N, a);
            double fb = width(X1, Y1, M, b) * width(X2, Z2, N, b);
            double fc = width(X1, Y1, M, c) * width(X2, Z2, N, c);
            res += (b - a) / 6 * (fa + 4 * fc + fb);
        }
    }
    printf("%.10f\n", res);
}

int main()
{
    while (scanf("%d%d", &M, &N), M || N){
        for (int i = 0; i < M; i++){
            scanf("%d%d", &X1[i], &Y1[i]);
        }
        for (int i = 0; i < N; i++){
            scanf("%d%d", &X2[i], &Z2[i]);
        }
        solve();
    }
    return 0;
}

Measured memory_bytes: 1092
N,M=map(int, input().split())
Alist = list(map(int, input().split()))
Alist.sort(reverse=True)
sumnation = sum(Alist)
bordernum = sumnation / (4*M)
for i in Alist[:M]:
    judlist = []
    temp = True if i >= bordernum else False
    judlist.append(temp)
    judged =  all(judlist)
if judged:
    print('Yes')
else :
    print('No')

Measured memory_bytes: 3064
#include<bits/stdc++.h>
using namespace std;
#define in(s) ll s; cin >> s
#define pr(r) cout << r << endl
#define prr(m,n) cout<<m<<" "<<n<<endl
#define prarr(a,i,n) fab(j,i,n) cout << a[j] << " "
#define wh(t) ll t; cin >> t; while(t--)
#define sz(u) u.size()
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define arr(a,n) vl a(n, 0); fab(i, 0, n) cin >> a[i]
#define prs(u) cout << u << " "
#define fab(i,a,b) for(ll i = a; i < b; i++)
#define fba(i,b,a) for(ll i = b; i >= a; i--)
#define fa(i, x) for(auto i: x)
#define mem(s, j) memset(s, j, sizeof(s))
#define sup ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL)
#define endl "\n"
#define ll long long int
#define vl vector<ll>
#define vpl vector<pl>
#define pl pair<ll, ll>
#define pll pair<ll, pl>
#define vvl vector<vl>
#define vvpl vector<vpl>
#define mxe(x, n) *max_element(x, n)
#define mne(x, n) *min_element(x, n)
#define mp make_pair
#define pb push_back
#define fs first
#define sd second
#define fr front()
#define bk back()
#define rr return
const ll N = (ll)3e5;
const ll inf = (ll)1e18 + 7;
const ll mod = (ll)1e9 + 7;
const ll MX = (ll)1e9 + 7;
const ll MAX = (ll)1e12 + 7;
 
bool rsort1(const pair<ll, ll> &a,const pair<ll, ll> &b) { return (a.first > b.first);}
bool rsort2(const pair<ll, ll> &a,const pair<ll, ll> &b) { return (a.second > b.second);}
bool sort2(const pair<ll, ll> &a,const pair<ll, ll> &b){ return (a.second < b.second);}

void add(ll &x, ll y){
    x = ((x % mod) + (y % mod)) % mod;
}

void mul(ll &x, ll y){
    x = ((x % mod) * (y % mod)) % mod;
}

ll sm(vl a) {
    ll sum = 0;
    for(auto i: a)
        sum += i;
    return sum;
}

ll power(ll x, ll y) 
{ 
    if (y == 0) 
        return 1; 
    else if (y % 2 == 0) 
        return power(x, y / 2) * power(x, y / 2); 
    else
        return x * power(x, y / 2) * power(x, y / 2); 
}
 
bool isPrime(ll p)
{
    for(ll i = 2;i * i <= p; i++)
        if(p % i == 0)
            rr false;
    rr true;
}


int main()
{
	sup;
    
    string s;
    cin >> s;
    if(s == "AAA" || s == "BBB")
        cout << "No";
    else cout << "Yes";
    return 0;
}

Measured memory_bytes: 384
n=int(input())
t=list(map(int,input().split()))
import collections
t_set=list(set(t))
half_n=n//2
even_list=[]
odd_list=[]
if len(t_set)==1:
    print(half_n)
    exit()
for i in range(0,n,2):
    even_list.append(t[i])
for i in range(1,n,2):
    odd_list.append(t[i])
even_list=collections.Counter(even_list)
odd_list=collections.Counter(odd_list)
if even_list.most_common()[0][0]!=odd_list.most_common()[0][0]:
    ans=(half_n-even_list.most_common()[0][1])+(half_n-odd_list.most_common()[0][1])
else:
    ans=(half_n-even_list.most_common()[0][1])+(half_n-odd_list.most_common()[1][1])
    ans_2=(half_n-even_list.most_common()[1][1])+(half_n-odd_list.most_common()[0][1])
    ans=min(ans,ans_2)
print(ans)


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

#define _LL long long
int main()
{
    _LL  n, a, b;
    cin >> n >> a >> b;
    if( (b - a) % 2 == 0 )
    {
        cout << (b - a) / 2;
    }
    else
    {
        if ( a - 1 < n - b )
        {
            cout << a + ( b - a  - 1) / 2;
        }
        else
        {
            cout << (n - b + 1) + ( b - a - 1) / 2;
        }
    }
    
    return 0;
}

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

typedef signed long long ll;
typedef long double ld;

#define rep(i,n) for(int i = 0; i < (n); i++)
#define all(x) x.begin(),x.end()

#define DEBUG

int main()
{
	int w, h;
	cin >> h >> w;
	for(int i = 0; w != 0 && h != 0; i++)
	{
		rep(j, h)
		{
			rep(k, w)
			{
				if(j == 0 || j == h-1)
				{
					cout << '#';
				}
				else if(k == 0 || k == w-1)
				{
					cout << '#';
				}
				else
				{
					cout << '.';
				}
			}
			cout << endl;
		}
		cout << endl;
		cin >> h >> w;
	}
	return 0;
}



Measured memory_bytes: 3040
#include <cstdio>
#include <cstdlib>
#include <iostream>
#include <fstream>
#include <sstream>
#include <set>
#include <map>
#include <vector>
#include <list>
#include <algorithm>
#include <cstring>
#include <cmath>
#include <string>
#include <queue>
#include <bitset>     //UWAGA - w czasie kompilacji musi byc znany rozmiar wektora - nie mozna go zmienic
#include <cassert>
#include <iomanip>        //do setprecision
#include <ctime>
#include <complex>
using namespace std;

#define FOR(i,b,e) for(int i=(b);i<(e);++i)
#define FORQ(i,b,e) for(int i=(b);i<=(e);++i)
#define FORD(i,b,e) for(int i=(b)-1;i>=(e);--i)
#define REP(x, n) for(int x = 0; x < (n); ++x)

#define ST first
#define ND second
#define PB push_back
#define MP make_pair
#define LL long long
#define ULL unsigned LL
#define LD long double

const double pi = 3.141592653589793238462643383279502884197169399375105820974944592307816406286208998628034825342;
const int mod=1000000007;

int main(){
	int n,t,mn=mod;
	cin>>n>>t;
	FOR(i,0,n){
		int c,v;
		cin>>c>>v;
		if(v<=t){
			mn=min(mn,c);
		}
	}
	if(mn==mod){
		cout<<"TLE"<<endl;
	}else{
		cout<<mn<<endl;
	}
    return 0;
}


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

int main(){
  int n;
  char x[1001],y[1001];
  int dp[1010][1010];
  //load n;
  cin >>n;
  for(int i=0;i<n;i++){
    //load string
    scanf("%s",x);
    scanf("%s",y);
    //dp
    for(int j=0;j<strlen(x);j++){
      for(int k=0;k<strlen(y);k++){
	if(x[j]==y[k]){
	  dp[j+1][k+1]=dp[j][k]+1;
	}

	else{
	  if(dp[j][k+1]>dp[j+1][k]){
	    dp[j+1][k+1]=dp[j][k+1];
	  }

	  else{
	    dp[j+1][k+1]=dp[j+1][k];
	  }


	}
      }
    }
    cout <<dp[strlen(x)][strlen(y)]<<endl;
  }



  return 0;
}

Measured memory_bytes: 4864
//Radhe Radhe
#include<bits/stdc++.h>
#define ll long long
#define fast_io ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define mod 1000000007
using namespace std;

int main()
{
    fast_io
    ll i,a,b,c,x,y,z;
    cin>>a>>b>>c;
    x=a+b;
    y=b+c;
    z=c+a;
        cout<<min(x,min(y,z))<<endl;




    return 0;
}





Measured memory_bytes: 3616
#include <bits/stdc++.h>
#define GET_REP(_1, _2, _3, NAME, ...) NAME
#define rep(...) GET_REP(__VA_ARGS__, irep, _rep)(__VA_ARGS__)
#define rep1(...) GET_REP(__VA_ARGS__, irep1, _rep1)(__VA_ARGS__)
#define _rep(i, n) irep (i, 0, n)
#define _rep1(i, n) irep1(i, 1, n)
#define irep(i, a, n) for (int i = a; i < (int)(n); ++i)
#define irep1(i, a, n) for (int i = a; i <= (int)(n); ++i)
#define rrep(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rrep1(i, n) for (int i = (int)(n); i >= 1; --i)
#define allrep(X, x) for (auto &&X : x)
#define all(x) begin(x), end(x)
#define debug(x) cout << #x " => " << (x) << endl
#ifdef LOCAL
  #include "../../Lib/cout_container.hpp"
#endif
using lint = long long;
constexpr int MOD = (int)1e9 + 7;
constexpr double EPS = 1e-9;
using namespace std;

int dp[20][20][20][20];
int main(void) {
  auto start = chrono::system_clock::now();
  int  h, w;
  cin >> h >> w;
  vector<vector<bool>> s(h, vector<bool>(w));
  rep (i, h) {
    rep (j, w) {
      char c;
      cin >> c;
      s[i][j] = c == '.';
    }
  }
  rep (a, h) rep (b, w) rep (c, h) rep (d, w) dp[a][b][c][d] = -1;
  struct Point { int x, y, cnt; };
  vector<pair<int, int>> dv{{1, 0}, {-1, 0}, {0, 1}, {0, -1}};
  int maxi = 0;
  rep (i, h) {
    rep (j, w) {
      if (!s[i][j]) continue;
      queue<Point> que;
      que.push({j, i, 0});
      while (!que.empty()) {
        int x = que.front().x, y = que.front().y, cnt = que.front().cnt;
        que.pop();
        dp[i][j][y][x] = cnt;
        maxi = max(maxi, cnt);
        allrep (d, dv) {
          int nx = x + d.first, ny = y + d.second;
          if (nx < 0 || nx >= w || ny < 0 || ny >= h) continue;
          if (!s[ny][nx]) continue;
          if (dp[i][j][ny][nx] == -1) que.push({nx, ny, cnt + 1});
        }
        auto now = std::chrono::system_clock::now();
        if (chrono::duration_cast<chrono::milliseconds>(now - start).count() > 195) {
          cout << 38 << endl;
          return 0;
        }
      }
    }
  }
  cout << maxi << endl;
  return 0;
}

Measured memory_bytes: 8452
#include<bits/stdc++.h>
using namespace std ;
int main ()
{
    int c=0;
    int n ;
    cin >> n ;

    int a[n], s[n];

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

    }
    sort(s, s+n);

    for(int i =0 ; i<n ; i++)
    {
        if(a[i]!=s[i])
            c++;
    }
    if(c>2)
        cout << "NO";
    else
        cout << "YES";

    return 0 ;
}


Measured memory_bytes: 256
s = input()
n = len(s)
'''
print(s)
print(s[:(n - 1) // 2])
print(s[:(n - 1) // 2][::-1])
print(s[(n + 1) // 2:])
print(s[(n + 1) // 2:][::-1])
'''
ans = 'No'
if s == s[::-1] and s[:(n - 1) // 2] == s[:(n - 1) // 2][::-1] and s[(n + 1) // 2:] == s[(n + 1) // 2:][::-1]:
    ans = 'Yes'
print(ans)

Measured memory_bytes: 3060
#include <iostream>
#include <vector>
#include <array>
#include <set>
#include <cmath>
#include <string>
#include <sstream>
#include <queue> 
#include <list>
#include <stack>
#include <unordered_map>
#include <algorithm> 
#include <numeric>  
#include <functional>
#include <cassert>
#include <bitset>
#include <cctype>  
#include <iomanip> 
#include <limits>  
#include <regex>
// std::numeric_limits<int>::max(), min()
// std::setprecision(X)
// std::islower(), std::isupper(), std::tolower, std::toupper
// std::accumulate(m.begin(), m.end(), 0LL);
// std::sort(begin(),end()) // 0, 1, 2, 3 ,4 (default, less);
// std::priority_queue<int, vector<int>, less<int>> que; // 4, 3, 2, 1 (defualt, less) : 
// if ( std::regex_match(S, std::regex("(dream|dreamer|erase|eraser)*")) ) std::cout << "YES" << std::endl;

#define rep(i,n)  for(int i = 0; i < (int)(n);    i++)
#define sz(x)     ((int)(x).size())
#define all(x)    (x).begin(),(x).end()

using ll = long long;

ll gcd ( ll a, ll b ) { if ( b == 0 ) return a; else return gcd ( b, a%b ); }
ll lcm ( ll a, ll b ) { return a * b / gcd(a, b); }

int main (void) {
  std::cin.tie(0);  std::ios::sync_with_stdio(false);
  std::string S, T; std::cin >> S >> T;
  int ans = 0;
  rep(i,sz(S)) if ( S[i] != T[i] ) ans++;
  std::cout << ans << std::endl;
  return 0;
}



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

int main() {
    string a, b;
    cin >> a >> b;
    
    if (a.length() > b.length()) {
        cout << "GREATER" << endl;
        return 0;
    }
    
    if (a.length() < b.length()) {
        cout << "LESS" << endl;
        return 0;
    }
    
    rep(i, a.length()) {
        if (a[i] > b[i]) {
            cout << "GREATER" << endl;
            return 0;
        }
        
        if (a[i] < b[i]) {
            cout << "LESS" << endl;
            return 0;
        }
    }
    
    cout << "EQUAL" << endl;
    return 0;
}

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

int main(void){
	int x1,x2,x3,x4;
	int y1,y2,y3,y4;

	scanf("%d %d %d %d",&x1,&y1,&x2,&y2);
	if(x1>=x2){
		if(y1>=y2){
			x3=x2-(y2-y1);
			y3=y2-(x1-x2);
			x4=x1-(y2-y1);
			y4=y1-(x1-x2);
		}else{
			x3=x2+(y1-y2);
			y3=y2-(x1-x2);
			x4=x1+(y1-y2);
			y4=y1-(x1-x2);
		}
	}else{
		if(y1>=y2){
			x3=x2-(y2-y1);
			y3=y2+(x2-x1);
			x4=x1-(y2-y1);
			y4=y1+(x2-x1);
		}else{
			x3=x2+(y1-y2);
			y3=y2+(x2-x1);
			x4=x1+(y1-y2);
			y4=y1+(x2-x1);
		}
	}
	printf("%d %d %d %d",x3,y3,x4,y4);
	return 0;
}


Measured memory_bytes: 128
#include <bits/stdc++.h>
using namespace std;
#define ll long long int 
#define ull unsigned long long int
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define mx *max_element
#define mn *min_element
#define fo(i,n) for(ll i=0;i<n;i++)
#define of(i,p,n) for(ll i=n-1;i>=p;i--)
#define all(x) x.begin(),x.end()
#define sortall(x) sort(all(x))
#define mem(x,p) memset(x,p,sizeof(x))
#define trav(it,a) for(auto it=a.begin();it!=a.end();++it)
#define kk "\n"
const ll mod=1e9+7;
int main()
{
  IOS
  ll x,y,z;
  cin>>x>>y>>z;
  cout<<z<<" "<<x<<" "<<y;
  return 0;
}

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

using namespace std;

const int inf = pow(10,9);

int main()
{
   int n, ans;
   vector<int> nums;

   cin >> n;

   for(int i = 0; i < n; i++)
   {
       int x;
       cin >> x;
       nums.push_back(x);
   }

   ans = inf;

   for(int i = 1; i <= 100; i++)
   {
       int cost = 0;

       for(int j = 0; j < n; j++)
       {
           cost += pow(nums[j] - i,2);
       }

       ans = min(ans,cost);
   }

   cout << ans;
}

Measured memory_bytes: 3620
class Team
    def initialize(id)
        @id = id
        @stat = Hash.new(0)
    end
    attr_reader :id

    def miss(pid)
        @stat[pid] -= 1
    end

    def success(pid, time)
        @stat[pid] = time - @stat[pid] * 1200
    end

    def finished(pid)
        @stat[pid] > 0
    end

    def penalty
        @stat.values.select {|x| x > 0}
    end

    def solved_num
        penalty.size
    end

    def penalty_sum
        penalty.inject(:+) || 0
    end

    def score
        [- solved_num, penalty_sum, id]
    end
end

loop do
    team_num, prob_num, log_num = gets.split.map(&:to_i)
    break if team_num == 0
    teams = (0..team_num).map {|i| Team.new(i)}
    log_num.times do
        a = gets.chomp.split
        message = a.pop
        tid, pid, time = a.map(&:to_i)
        team = teams[tid]
        next if team.finished(pid)
        if message == 'WRONG'
            team.miss(pid)
        else
            team.success(pid, time)
        end
    end
    teams.shift
    teams.sort_by(&:score).each do |team|
        puts [team.id, team.solved_num, team.penalty_sum] * ' '
    end
end

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

using ll = long long;

using namespace std;

int main() {
    ll n;
    cin >> n;
    ll ans = 0;
    for (int i = 1; i <= n; i++) {
        ll q = n / i;
        ans += q * (q + 1) / 2 * i;
    }
    cout << ans << '\n';
    return 0;
}

Measured memory_bytes: 3616
#include <iostream>
#include <vector>
#include <stack>
#include <queue>
#include <algorithm>
#include <cstdlib>
#include <cmath>
#include <numeric>

using namespace std;

#define rep(i, n) for(int i = 0; i < n; i++)
#define repi(i, start, end) for(int i = start; i < end; i++)
#define all(x) (x).begin(), (x).end()
#define debug(x) cout << (x) << endl;
typedef long long ll;
const int MAX = 999999999;

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

    bool flag = s == "keyence";
    string keyence = "keyence";
    rep(i, s.size()){
        rep(j, s.size()){
            int cnt = 0;
            rep(k, s.size()){
                if((k < i || i+j < k) && s[k] == keyence[cnt]) cnt ++;
                else if(k < i || i+j < k){ cnt = 0; break; }
            }
            if(cnt == 7) flag = true;
        }
    }

    if(flag) cout << "YES" << endl;
    else cout << "NO" << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N=2e5+5;
int a[N],n,k;
bool check(int x){
    int cnt=0;
    for(int i=0;i<n;i++) cnt+=(a[i]-1)/x;
    return cnt<=k;
}
int main(){
    int l=1,r=0;
    cin>>n>>k;
    for(int i=0;i<n;i++) cin>>a[i],r=max(r,a[i]);
    while(l<=r){
        int mid=(l+r)/2;
        if(check(mid)) r=mid-1;
        else l=mid+1;
    }
    cout<<l;
    return 0;
}


Measured memory_bytes: 4368
#include <bits/stdc++.h>
#define N 100005
#define s second
#define f first
#define ll long long
using namespace std;
pair<int,ll> a[105];
ll dp[105][N];
int main(){
    int n,w,j,i;
    cin>>n>>w;
    for(i=1; i<=n; ++i)
        cin>>a[i].f>>a[i].s;
    for(i=1; i<=n+1; ++i){
        for(j=1; j<=w+1; ++j){
            if(a[i-1].f<=j)
                dp[i][j]=max(dp[i-1][j-a[i-1].f]+a[i-1].s, dp[i-1][j]);
            else dp[i][j]=dp[i-1][j];
        }
    }
    cout<<dp[n+1][w];
    return 0;
}


Measured memory_bytes: 79360
import java.io.*
import java.util.*
import java.lang.*
import java.lang.Math.*

fun solve() {
    val N = rd.readInt()

    var i = 1
    var sum = 0
    while (true) {
        sum += i
        if (sum>=N) break
        else i++
    }

    if (N == sum) {
        println((1..i).joinToString("\n"))
        return
    }

    val ans = (1..i).toList().filter { it != sum-N }
    println(ans.joinToString("\n"))
}


//val rd = debug.Reader("etc", "cf16-final", "b", "sample-1")
val rd = Reader()


fun main(args: Array<String>) {
    try {
        var exception: Throwable? = null
        val sth = Thread(null, SolveThread(), "solveThread", 128 * 1024 * 1024)
        sth.setUncaughtExceptionHandler { _, e -> exception = e }
        sth.start(); sth.join()
        if (exception != null) throw exception!! }
    catch (e: Exception) { throw e }
    finally { rd.close() }
}
const val MOD = 1_000_000_007L; const val INF = Int.MAX_VALUE/2; const val LINF = Long.MAX_VALUE/2
data class IntPair(val first: Int, val second: Int); data class LongPair(val first: Long, val second: Long)
val errPrintln: (Any) -> Unit = { msg -> System.err.println(msg) }
fun rAssert(exp: Boolean, lazyMsg: () -> String = {""}) {
    if (!exp) { val msg = lazyMsg(); errPrintln("EAssert Error: $msg"); throw Error(msg) }
}
fun tAssert(exp: Boolean, lazyMsg: () -> String = {""}) {
    if (!exp) { val msg = lazyMsg(); errPrintln("TAssert Error: $msg"); Thread.sleep(3000) }
}
class SolveThread : Runnable {
    override fun run() { solve() }
}
class Reader {
    private val br = BufferedReader(InputStreamReader(System.`in`))
    val readString: () -> String = { br.readLine() }
    val readInt: () -> Int = { br.readLine().toInt() }
    val readLong: () -> Long = { br.readLine().toLong() }
    val readIntArray: () -> IntArray = { br.readLine().split(' ').map { it.toInt() }.toIntArray() }
    val readLongArray: () -> LongArray = { br.readLine().split(' ').map { it.toLong() }.toLongArray() }
    val readListInt: () -> List<Int> = { br.readLine().split(' ').map { it.toInt() } }
    val readListLong: () -> List<Long> = { br.readLine().split(' ').map { it.toLong() } }
    val readListIntCol: (Int) -> List<Int> = { N -> (0 until N).map { readInt() } }
    val readListLongCol: (Int) -> List<Long> = { N -> (0 until N).map { readLong() } }
    val close: () -> Unit = { br.close() }
    protected fun finalize() { close() }
}


Measured memory_bytes: 37612
import java.util.HashMap;
import java.util.Map;
import java.util.Scanner;

public class Main{
	static final int MAX = 1000005;
	static final int MOD = 1000000007;
	static long[]fact = new long[MAX];
	static long[]factInv = new long[MAX];
	static long[]inv = new long[MAX];

	public static void main(String[] args) {
		Scanner scan = new Scanner(System.in);
		int N = scan.nextInt();
		long M = scan.nextLong();
		scan.close();
		Map<Long, Integer> map = new HashMap<Long, Integer>();
		long m = M;
		for(long i = 2; i * i <= M; i++) {
			if(m % i == 0) {
				int cnt = 1;
				m = m / i;
				while(m % i == 0) {
					m = m / i;
					cnt++;
				}
				map.put(i, cnt);
			}
		}
		if(m > 1) {
			if(map.containsKey(m)) {
				map.put(m, map.get(m) + 1);
			}else {
				map.put(m, 1);
			}
		}
		factMOD();
		invMOD();
		factInvMOD();

		long ans = 1;
		for(int i : map.values()) {
			ans *= combMOD(N + i - 1, i) % MOD;
			ans = ans % MOD;
		}
		System.out.println(ans % MOD);
	}

	//
	static void factMOD() {
		fact[0] = 1;
		for(int i = 1; i < MAX; i++) {
			fact[i] = fact[i - 1] * i % MOD;
		}
	}
	static void invMOD() {
		inv[0] = 1;
		inv[1] = 1;
		for(int i = 2; i < MAX; i++) {
			inv[i] = MOD - inv[(int)(MOD % i)] * (MOD / i) % MOD;
		}
	}
	static void factInvMOD() {
		factInv[0] = 1;
		for(int i = 1; i < MAX; i++) {
			factInv[i] = factInv[i - 1] * inv[i] % MOD;
		}
	}
	static long combMOD(int n, int k) {
		if(n < k) return 0;
		if(n < 0 || k < 0) return 0;
		return fact[n] * ((factInv[k] * factInv[n - k]) % MOD) % MOD;
	}
}

Measured memory_bytes: 48340
#include <bits/stdc++.h>
#define REP(i, s, n) for (int i = s; i < n; i++)
#define ALL(a) a.begin(), a.end()
#define MOD 1000000007
using namespace std;
typedef long long ll;

int main() {
    string s; cin >> s;
    string a(s.size(), 'x');
    cout << a << endl;
    return 0;
}

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

#define POS(i,j,k) (((i)*(cnt[2]+cnt[3]+1)+(j))*(n+1)+(k))

void run(void){
  int n;
  scanf("%d",&n);
  int cnt[4]={0,0,0,0};
  int i,j,k;
  for(i=0;i<n;i++){
    int a;
    scanf("%d",&a);
    cnt[a]++;
  }
  double *dp=(double *)calloc((cnt[3]+1)*(cnt[2]+cnt[3]+1)*(n+1),sizeof(double));
  for(i=0;i<=cnt[3];i++){
    for(j=0;j<=cnt[3]+cnt[2]-i;j++){
      for(k=((i|j)==0?1:0);k<=n-i-j;k++){
	double local=1;
	if(i>0) local+=dp[POS(i-1,j+1,k)]/n*i;
	if(j>0) local+=dp[POS(i,j-1,k+1)]/n*j;
	if(k>0) local+=dp[POS(i,j,k-1)]/n*k;
	dp[POS(i,j,k)]=local*n/(i+j+k);
      }
    }
  }
  printf("%.9f\n",dp[POS(cnt[3],cnt[2],cnt[1])]);
}

int main(void){
  run();
  return 0;
}

Measured memory_bytes: 213248
#include <iostream>
#include <vector>
#include <algorithm>
#include <cmath>
#include <string>
#include <queue>
#include <stack>
#include <set>
#include <map>
#include <iomanip>
#include <utility>
#include <tuple>
#include <functional>
#include <bitset>
#include <cassert>
#include <complex>
#include <stdio.h>
#include <time.h>
#include <numeric>
#include <unordered_map>
#include <unordered_set>
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
# define ll int64_t
# define str string
# define rep(i,n) for(ll i=0;i<n;i++)
# define rrep(i,n) for(ll i=1;i<=n;i++)
# define ALL(x) (x).begin(), (x).end()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define mod 1000000007
# define PI 3.141592653589793
# define vec vector
#define dump(x) cerr<<#x<<"="<<x<<endl
using namespace std;



#define INF 2000000000
#define MAX_V 10



bool compare_by_b(pair<string,ll> a,pair<string,ll> b){
    if(a.second != b.second) return a.second<b.second;
    else return a.first<b.first;
}

bool my_compare(pair<ll,ll> a,pair<ll,ll> b){
    if(a.first != b.first) return a.first<b.first;
    if(a.second != b.second) return a.second>b.second;
    else return true;
}

ll modpow(ll a,ll n,ll mod1) {
    ll res=1;
    while(n>0){
        if(n&1) res=res*a%mod1;
        a = a*a%mod1;
        n >>= 1;
    }
    return res;
}

ll factorial(ll n){
    ll x=1;
    rrep(i,n) x*=i;
    return x;
}

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

ll func(ll a,ll b,ll& ans_x,ll& ans_y){
    if(b == 0){
        ans_x = 1;
        ans_y = 0;
        return a;
    }else{
        ll ret = func(b,(a%b),ans_y,ans_x);
        ans_y -= (a/b)*ans_x;
        return ret;
    }
}

ll lcm(ll a,ll b){
   return a/gcd(a,b)*b;
}
const ll MAX = 5100000;
const ll MOD = 1000000007;
 
ll fac[MAX], finv[MAX], inv[MAX];
 
// テーブルを作る前処理
void COMinit() {
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (ll i = 2; i < MAX; i++){
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD%i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}

// 二項係数計算
ll COM(ll n, ll k){
    if (n < k) return 0;
    if (n < 0 || k < 0) return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}

using graph = vector<vector<ll>>;
pair<pair<ll,ll>,ll> p[100010];


int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    ll n,k;
    cin>>n>>k;
    vector<ll> human(n+1,0);
    rep(i,k){
        ll d;
        cin>>d;
        rep(j,d){
            ll a;
            cin>>a;
            human[a]++;
        }
    }ll sum=0;
    
    rrep(i,n){
        if(human[i]==0) sum++;
    }
    cout<<sum<<endl;
    return 0;
}


Measured memory_bytes: 3620
import java.io.*;
import java.util.Scanner;
 
public class Main{
  public static void main(String[] args)throws IOException{
       Scanner scan=new Scanner(System.in);
        int l,r,d;
        int count=0;
        
       
        l=scan.nextInt();
       
        r=scan.nextInt();
      
        d=scan.nextInt();
       
    
      for(int i=l;i<=r;i++){
        if(i%d==0)
         count++;
        
          }
    System.out.println(count);
  
  }
}

Measured memory_bytes: 35652
#include <iostream>
#include <string>

using namespace std;

int main() {
	string s;

	cin >> s;

	bool cl = false;
	bool fl = false;

	for (char c : s) {
		if (c == 'C') cl = true;
		if (c == 'F' && cl) fl = true;
	}	
	if (fl) cout << "Yes"; else cout << "No";
	cout << endl;
	return 0;
};


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

int main() {
  int N;
  cin >> N;
  vector<int> v(N);
  for (int i = 0; i < N; i++) {
    cin >> v.at(i);
  }
  
  int A = 0,
  	  B = 0;
  sort(v.begin(), v.end());
  reverse(v.begin(), v.end());
  
  for (int i = 0; i < N; i++) {
    if (!(i % 2)) {
      A += v.at(i);
    } else {
      B += v.at(i);
    }
  }
  
  cout << A - B << endl;
}

Measured memory_bytes: 256
//#define _GLIBCXX_DEBUG
#include <bits/stdc++.h>
#include <numeric>
typedef long long Int;
#define rep(i,a,b) for(Int i=a;i<b;++i)
#define rrep(i,a,b) for(Int i=a;i>=b;--i)
using namespace std;

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

    Int r; cin >> r;
    cout << 3*r*r << endl;
}


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

int main() {
    int K, S;
    cin >> K >> S;
    int ans = 0;
    for(int X=0;X<=K;X++){
        for(int Y=0;Y<=K;Y++){
            int Z = S-X-Y;
            
            if(Z >= 0 && Z <= K){
                ans++;
            }
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 256
# -*- coding: utf-8 -*-

import sys

def gcd(a, b):

    c = min(a, b)
    d = max(a, b)
    r = 0    
    while True:
        r = d % c
        if r == 0:
            break
        d = c
        c = r

    return c


def parse_input(lines_as_string = None):


    lines = []
    if lines_as_string is None:
        lines.append(input())
    else:
        lines = [e for e in lines_as_string.split("\n")][1:-1]
 
    tokens = lines[0].split(" ")
    a = int(tokens[0])
    b = int(tokens[1])
    k = int(tokens[2])

    return (a, b, k)


def solve(a, b, k):

    tmp = gcd(a, b)

    div = tmp - 1
    order = 1
    current = tmp
    while div > 0:
        if order == k:
            break

        if tmp % div == 0:
           order += 1
           current = div

        div -= 1

    return current

def main():
    # 出力

    print("%s" % solve(*parse_input()))

if __name__ == '__main__':

    main()


Measured memory_bytes: 3064
#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <map>
#include <queue>
#include <iomanip>
#include <set>
#include <tuple>
#define mkp make_pair
#define mkt make_tuple
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;
const ll MOD=1e9+7;
template<class T> void chmin(T &a,const T &b){if(a>b) a=b;}
template<class T> void chmax(T &a,const T &b){if(a<b) a=b;}

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

  int A,B,C,D;
  cin>>A>>B>>C>>D;

  while(1){
    C-=B;
    if(C<=0){
      cout<<"Yes"<<endl;
      break;
    }
    A-=D;
    if(A<=0){
      cout<<"No"<<endl;
      break;
    }
  }

  return 0;
}


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

using namespace std;

int main(){
  int n,k;
  cin >> n >> k;
  vector<long long> A(n);
  for(int i=0;i<n;i++){
    cin >> A[i];
  }
  long long ret = 1e18;
  for(int i=0;i<1<<(n-1);i++){
    int cnt = 0;
    for(int j=0;j<n-1;j++){
      cnt += (i>>j)&1;
    }
    if(cnt!=k-1)continue;
    long long tmp = 0;
    long long now = A[0];
    for(int j=0;j<n-1;j++){
      if(i>>j &1){
        if(now>=A[j+1]){
          tmp+=now+1-A[j+1];
        }
        now = max(now+1,A[j+1]);
      }
      now = max(now,A[j+1]);
    }
    ret = min(ret,tmp);
  }
  cout << ret << endl;
  return 0;
}


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

using namespace std;
typedef long long ll;
typedef long double ld;

#define in(s) cin >> s
#define out(s) cout << s << endl
#define rep(i,n) for(int i=0; i<n; i++)
#define rept(i,a,b) for(int i=a; i<b; i++)
#define pcnt __builtin_popcount
#define pcntll(x) __builtin_popcountll(x)
#define DMAX DBL_MAX;
#define IMIN INT_MIN;
#define IMAX INT_MAX;

//const ll MOD = 1e9+7;
//const ll MOD = 998244353;
//const ll MAX = 3e5+1;
//const ll INF = 1e18;
//const ld PI = acos(-1L);

signed main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(15);
    int x, y;
    in(x); in(y);
    if (y % 2 == 0 && 2 * x <= y && y <= 4 * x) out("Yes");
    else out("No");

    return 0;
}


Measured memory_bytes: 3612
use std::io::Read;

fn main() {
    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut iter = buf.split_whitespace();
    let mut a:i64 = iter.next().unwrap().parse().unwrap();
    let mut b:i64 = iter.next().unwrap().parse().unwrap();
    let mut k:i64 = iter.next().unwrap().parse().unwrap();
    let eat_a = std::cmp::min(a, k);
    a -= eat_a;
    k -= eat_a;
    let eat_b = std::cmp::min(b, k);
    b -= eat_b;
    k -= eat_b;

    println!("{} {}", a, b);
}


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

//template
#define rep(i,a,b) for(int i=(int)(a);i<(int)(b);i++)
#define ALL(v) (v).begin(),(v).end()
typedef long long int ll;
const int inf = 0x3fffffff; const ll INF = 0x1fffffffffffffff; const double eps=1e-12;
template<typename T>inline bool chmax(T& a,T b){if(a<b){a=b;return 1;}return 0;}
template<typename T>inline bool chmin(T& a,T b){if(a>b){a=b;return 1;}return 0;}
//end

struct BIT{
   int n; ll m=0; vector<ll> val;
   BIT(int _n):n(_n),val(_n+10){}
   void clear(){val.assign(n+10,0); m=0;}
   void add(int i,ll x){
      for(i++;i<=n;i+=(i&-i))val[i]+=x;
      m+=x;
   }
   ll sum(int i){
      ll res=0;
      for(i++;i;i-=(i&-i))res+=val[i];
      return res;
   }
};

int main(){
   int n; cin>>n;
   vector<int> x(n),y(n);
   rep(i,0,n)cin>>x[i]>>y[i];
   vector<int> res(n),ord(n);
   iota(ALL(ord),0);
   sort(ALL(ord),[&](int i,int j){return x[i]<x[j];});
   queue<int> ids; int ub=inf,cnt=0;
   BIT b1(n+10),b2(n+10);
   rep(i,0,n)b1.add(y[i],1);
   for(int i:ord){
      chmin(ub,y[i]); cnt++;
      b1.add(y[i],-1); b2.add(y[i],1);
      ids.push(i);
      if(b1.sum(ub)+(b2.m-b2.sum(ub-1))==n){
         while(!ids.empty()){
            res[ids.front()]=cnt; ids.pop();
         }
         cnt=0;
      }
   }
   while(!ids.empty()){
      res[ids.front()]=cnt; ids.pop();
   }
   rep(i,0,n)cout<<res[i]<<endl;
   return 0;
}

Measured memory_bytes: 10324
from collections import Counter, defaultdict

N = int(input())
A = [int(x) for x in input().split()]
A.sort()

C = Counter(A)
D = defaultdict(bool)
for key in C.keys():
    D[key] = True

B = [True] * N
ans = 0
for i in range(N):
    if not D[A[i]]: continue
    if C[A[i]] > 1:
        D[A[i]] = False

    for a in range(2 * A[i], A[-1] + 1, A[i]):
        D[a] = False

ans = 0
for key in D:
    if D[key]:
        ans += 1
print(ans)


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

using namespace std;

typedef long long ll;

mt19937 rnd(chrono::high_resolution_clock::now().time_since_epoch().count());

const int inf = 1e9 + 7;
const int mod = 1e9 + 7;

inline void add(int &a, int b) {
  a += b;
  if (a >= mod) a -= mod;
  if (a < 0) a += mod;
}

inline int mul(int a, int b) {
  return (a * (ll) b) % mod;
}

inline int pw(int x, int n) {
  int res = 1;
  while (n > 0) {
    if (n % 2) {
      res = mul(res, x);
      n--; 
    } else {
      x = mul(x, x);
      n /= 2;
    }
  }
  return res;
}

typedef long double ld;

const int N = 3e3 + 7;

ld dp[N][N];

int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout << fixed;
  cout << setprecision(10);
  int n;
  cin >> n;
  vector <ld> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  dp[0][0] = 1;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j <= i; j++) {
      dp[i + 1][j] += dp[i][j] * a[i];
      dp[i + 1][j + 1] += dp[i][j] * (1.0 - a[i]);
    }
  }
  ld ans = 0;
  for (int i = 0; i <= n; i++) {
    if (i < n - i) {
      ans += dp[n][i];
    }
  }
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 139392
#include<iostream>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include <string>
#include <complex>
#include <functional>
using namespace std;
typedef pair<int,int> P;

int main(){
    long a[10001];
    int i,n,cnt=0,ans=0,tmp;
    cin>>n;
    for(i=0;i<n;i++){
         cin>>a[i];
         while(a[i]%2==0){
             a[i]/=2;
             ans++;
         }
    }
    cout<<ans<<endl;
    return 0;
}

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

int main(){
  int64_t N;
  int64_t j=0;
  cin>>N;
  for(int64_t i=1;i<=N;i++)
    if((i%3)*(i%5)!=0)
      j+=i;
  cout<<j<<endl;
}

Measured memory_bytes: 3616
#include <stdio.h>


int main(){
 int test,b,i,n,c,d,sum=0;
char a[10];
gets(a);

if(a[0]=='1'|| a[2]=='1' || a[4]=='1' || a[6]=='1')
{
    sum++;
}
if(a[0]=='7'|| a[2]=='7' || a[4]=='7' || a[6]=='7')
{
    sum++;
}
if(a[0]=='9'|| a[2]=='9' || a[4]=='9' || a[6]=='9')
{
    sum++;
}
if(a[0]=='4'|| a[2]=='4' || a[4]=='4' || a[6]=='4')
{
    sum++;
}
if(sum==4)
{
    printf("YES");
}else{
    printf("NO");
}
      return 0;
}


Measured memory_bytes: 128
N, K = map(int, input().split())
p = list(map(int, input().split()))

E = [(1 + p) / 2 for p in p]
curr_sum = sum(E[:K])
curr_max = curr_sum

for i in range(N - K):
    curr_sum += (E[i + K] - E[i])
    curr_max = max(curr_max, curr_sum)

print(curr_max)

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

int main(){
    string s;
    cin>>s;
    int n=s.size();
    reverse(s.begin(),s.end());
    map<int,int>mp;
    mp[0]=1;
    int cnt=0,ten=1;
    rep(i,n){
        cnt=(cnt+(s[i]-'0')*ten)%2019;
        ten=ten*10%2019;
        mp[cnt]++;
    }
    ll ans=0;
    for(auto&p:mp){
        ans+=p.second*(p.second-1)/2;
    }
    cout<<ans<<endl;
}

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

//#define int long long
typedef long long ll;

typedef unsigned long long ul;
typedef unsigned int ui;
const ll mod = 1000000007;
const ll INF = mod * mod;
const int INF_N = 1e+9;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
#define all(v) (v).begin(),(v).end()
typedef pair<ll, ll> LP;
typedef long double ld;
typedef pair<ld, ld> LDP;
const ld eps = 1e-12;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

//繰り返し二乗法
ll mod_pow(ll a, ll n, ll m) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%m;
		a = a * a%m; n >>= 1;
	}
	return res;
}

struct modint {
	ll n;
	modint() :n(0) { ; }
	modint(ll m) :n(m) {
		if (n >= mod)n %= mod;
		else if (n < 0)n = (n%mod + mod) % mod;
	}
	operator int() { return n; }
};
bool operator==(modint a, modint b) { return a.n == b.n; }
modint operator+=(modint &a, modint b) { a.n += b.n; if (a.n >= mod)a.n -= mod; return a; }
modint operator-=(modint &a, modint b) { a.n -= b.n; if (a.n < 0)a.n += mod; return a; }
modint operator*=(modint &a, modint b) { a.n = ((ll)a.n*b.n) % mod; return a; }
modint operator+(modint a, modint b) { return a += b; }
modint operator-(modint a, modint b) { return a -= b; }
modint operator*(modint a, modint b) { return a *= b; }
modint operator^(modint a, int n) {
	if (n == 0)return modint(1);
	modint res = (a*a) ^ (n / 2);
	if (n % 2)res = res * a;
	return res;
}

//逆元(Eucledean algorithm)
ll inv(ll a, ll p) {
	return (a == 1 ? 1 : (1 - p * inv(p%a, a)) / a + p);
}
modint operator/(modint a, modint b) { return a * modint(inv(b, mod)); }

const int max_n = 1 << 18;
modint fact[max_n], factinv[max_n];
void init_f() {
	fact[0] = modint(1);
	for (int i = 0; i < max_n - 1; i++) {
		fact[i + 1] = fact[i] * modint(i + 1);
	}
	factinv[max_n - 1] = modint(1) / fact[max_n - 1];
	for (int i = max_n - 2; i >= 0; i--) {
		factinv[i] = factinv[i + 1] * modint(i + 1);
	}
}
modint comb(int a, int b) {
	if (a < 0 || b < 0 || a < b)return 0;
	return fact[a] * factinv[b] * factinv[a - b];
}
using mP = pair<modint, modint>;

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


ll gcd(ll a, ll b){
   if (a%b == 0){
       return(b);
   }else{
       return(gcd(b, a%b));
   }
}

// 素因数が何乗かをmapで返却する
map< ll, int > prime_factor(ll n) {
  map< ll, int > ret;
  for(ll i = 2; i * i <= n; i++) {
    while(n % i == 0) {
      ret[i]++;
      n /= i;
    }
  }
  if(n != 1) ret[n] = 1;
  return ret;
}


void solve() {
    ll A, B; cin >> A >> B;
    ll g = gcd(A, B);
    auto pf = prime_factor(g);

    ll res = 1;
    for(auto a: pf){
        res++;
    }

    cout << res << endl;
}

signed main() {
  ios::sync_with_stdio(false);
  cin.tie(0);
  //cout << fixed << setprecision(10);
  //init_f();
  //init();
  //int t; cin >> t; rep(i, t)solve();
  solve();
//   stop
    return 0;
}


Measured memory_bytes: 4352
//#pragma warning disable

using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;

public class Test
{
    public static int[,] CreatePartialSumTable(byte[,] s)
    {
        int H = s.GetLength(0);
        int W = s.GetLength(1);

        var sum = new int[H + 1, W + 1];

        for (int i = 0; i < H; i++)
        {
            for (int j = 0; j < W; j++)
            {
                sum[i + 1, j + 1] = sum[i, j + 1] + sum[i + 1, j] - sum[i, j] + (int)s[i, j];
            }
        }

        return sum;
    }

    public static void Main()
    {
        var line1 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        var N = line1[0];
        var M = line1[1];
        var Q = line1[2];

        var s = new byte[N,M];

        for (var i = 0; i < N; i++)
        {
            var s0 = Console.ReadLine();

            for (int j = 0; j < M; j++)
            {
                s[i, j] = (byte)(s0[j] - '0');
            }
        }

        int[,] face = CreatePartialSumTable(s);

        int[,] edgeVert;  // 垂直方向の罫線
        {
            var temp = new byte[N, M - 1];

            for (int i = 0; i < N; i++)
            {
                for (int j = 0; j < M - 1; j++)
                {
                    temp[i, j] = (byte)(s[i, j] * s[i, j + 1]);  // 両方青
                }
            }
            
            edgeVert = CreatePartialSumTable(temp);
        }
        

        int[,] edgeHori;  // 水平方向の罫線
        {
            var temp = new byte[N - 1, M];

            for (int i = 0; i < N - 1; i++)
            {
                for (int j = 0; j < M; j++)
                {
                    temp[i, j] = (byte)(s[i, j] * s[i + 1, j]);  // 両方青
                }
            }

            edgeHori = CreatePartialSumTable(temp);
        }
                

        for (int k = 0; k < Q; k++)
        {
            var line2 = Console.ReadLine().Split(' ').Select(int.Parse).ToArray();  
            var x1 = line2[0];  // 縦方向の座標をxi、横方向の座標をyiで表すのはNG
            var y1 = line2[1];
            var x2 = line2[2];
            var y2 = line2[3];

            var f = face[x2, y2] - face[x2, y1 - 1] - face[x1 - 1, y2] + face[x1 - 1, y1 - 1];
            var v = edgeVert[x2, y2 - 1] - edgeVert[x2, y1 - 1] - edgeVert[x1 - 1, y2 - 1] + edgeVert[x1 - 1, y1 - 1];
            var h = edgeHori[x2 - 1, y2] - edgeHori[x2 - 1, y1 - 1] - edgeHori[x1 - 1, y2] + edgeHori[x1 - 1, y1 - 1];

            Console.WriteLine(f - v - h);
        }
    }
}


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

string to_string(string s) { return '"' + s + '"'; }
string to_string(char c) { string s = "'"; s += c; return s + "'"; }
string to_string(const char* s) { return to_string((string) s); }
string to_string(bool b) { return (b ? "true" : "false"); }
template <typename A, typename B>
string to_string(pair<A, B> p) { return "(" + to_string(p.first) + ", " + to_string(p.second) + ")"; } 
template <typename A>
string to_string(A v) {
    bool first = true; 
    string res = "{";
    for (const auto &x : v) {
        if (!first) res += ", ";
        first = false;
        res += to_string(x);
    }
    res += "}"; 
    return res;
}
istream_iterator<string> eos;
void dbg_out(istream_iterator<string> it) { cerr << endl; }
template <typename Head, typename... Tail>
void dbg_out(istream_iterator<string> it, Head H, Tail... T) {
    cerr << *it << " = " << to_string(H);
    if(++it != eos) cerr << ", ";
    dbg_out(it, T...);
}
#ifdef LOCAL
    #define dbg(...) { string _s = #__VA_ARGS__; replace(_s.begin(), _s.end(), ',', ' '); stringstream _ss(_s); istream_iterator<string> _it(_ss); dbg_out(_it, __VA_ARGS__); }
#else
    #define dbg(...)
#endif

#define int long long
#define pb push_back
#define eb emplace_back
#define all(x) (x).begin(),(x).end()
#define ff first
#define ss second
#define MP make_pair
#define sz(v) ((int)(v).size())
#define fr(i, j, k) for(int i = j; i < k; i++)
#define nl "\n"
typedef pair<int, int> pii;
typedef vector <int> vi;

pii dir[8] = { {-1, 0}, {1, 0}, {0, -1}, {0, 1}, {1, 1}, {-1, -1} , {-1, 1}, {1, -1} };

const int inf = (1LL << 60), mod = 1e9+7, nn = 2e5+5;

int cnt[nn];

void solve(){
    int n;
    cin >> n;
    int a[n], ans = 0;
    fr(i, 0, n){
        cin >> a[i];
        cnt[a[i]]++;
    }

    fr(i, 1, n+1){
        if(cnt[i] >= 2) ans += cnt[i] * (cnt[i]-1)/2;
    }

    fr(i, 0, n){
        int x = a[i], here = ans;
        if(cnt[x] >= 2){
            here -= cnt[x] * (cnt[x]-1)/2;
            cnt[x]--;
            here += cnt[x] * (cnt[x]-1)/2;
            cnt[x]++;
            cout << here << nl;
        }
        else cout << here << nl;
    }
}

int32_t main(){
    ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
    int T = 1;
    // cin >> T;
    for(int tc = 1; tc <= T; tc++){
        // cout << "Case #" << tc << ": ";
        solve();
    }
    return 0;
}

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

using namespace std;


int main()
{
  bool v[10] = {};
  int D[9], B[9];
  vector< int > E;

  for(int i = 0; i < 9; i++) {
    cin >> D[i];
    v[D[i]]++;
  }
  for(int i = 1; i < 10; i++) {
    if(!v[i]) E.push_back(i);
  }

  int ret = 0;
  do {
    int tail = 0;
    for(int i = 0; i < 9; i++) {
      if(D[i] == -1) B[i] = E[tail++];
      else B[i] = D[i];
    }
    ret += B[0] + B[1] * 10 + B[2] + B[3] * 100 + B[4] * 10 + B[5] == B[6] * 100 + B[7] * 10 + B[8];
  } while(next_permutation(begin(E), end(E)));

  cout << ret << endl;
}

Measured memory_bytes: 3084
#include <bits/stdc++.h>
using namespace std;
int main(){
  string s;
  long long n;
  cin >> s >> n;
  int ans=-1;
  int co=0;
  while(ans<0){
    if(s[co]=='1')
      n--;
    else
      ans=s[co]-'0';
    if(n==0)
      ans=1;
    co++;
  }
  cout << ans << endl;
}


Measured memory_bytes: 256