akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
#define RI register int
int read() {
	int q=0;char ch=' ';
	while(ch<'0'||ch>'9') ch=getchar();
	while(ch>='0'&&ch<='9') q=q*10+ch-'0',ch=getchar();
	return q;
}
const int N=100005;
int red[N],num[N],n,m,ans;
int main()
{
	int x,y;
	n=read(),m=read();
	for(RI i=1;i<=n;++i) num[i]=1;
	red[1]=1;
	for(RI i=1;i<=m;++i) {
		x=read(),y=read();
		if(red[x]) red[y]=1;
		--num[x],++num[y];
		if(!num[x]) red[x]=0;
	}
	for(RI i=1;i<=n;++i) if(red[i]) ++ans;
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define mo 1000000007
#define pi 3.1415926535898
#define eps 1e-9 
using namespace std;
long long read(){
    long long xx=0,flagg=1;
    char ch=getchar();
    while((ch<'0'||ch>'9')&&ch!='-')
        ch=getchar();
    if(ch=='-'){
        flagg=-1;
        ch=getchar();
    }
    while(ch>='0'&&ch<='9'){
        xx=xx*10+ch-'0';
        ch=getchar();
    }
    return xx*flagg;
}
void pus(long long xx,long long flagg){
    if(xx<0){
        putchar('-');
        xx=-xx;
    }
    if(xx>=10)
        pus(xx/10,0);
    putchar(xx%10+'0');
    if(flagg==1)
        putchar(' ');
    if(flagg==2)
        putchar('\n');
    return;
}
int n,i,j,x,a[200005],book[200005],zhan[200005],tail,flag,book2[200005];
int top,nex[200005],to[200005],fir[200005];
void lj(int u,int v){
	top++;
	nex[top]=fir[u];
	fir[u]=top;
	to[top]=v;
}
void ss(int v){
	if(flag==1)
		return;
	book[v]=i;
	tail++;
	zhan[tail]=v;
	for(int top1=fir[v];top1;top1=nex[top1])
		if(book[to[top1]]==i){
			flag=1;
			return;
		}
		else if(book[to[top1]]==0)
			ss(to[top1]);
	if(flag==1)
		return;
	zhan[tail]=0;
	tail--;
}
void ss2(int v){
	if(book[v]==0)
		book[v]=1;
	for(int top1=fir[v];top1;top1=nex[top1])
		if(book[to[top1]]==0)
			ss2(to[top1]);
	for(int top1=fir[v];top1;top1=nex[top1])
		if(book[to[top1]]==1)
			book2[a[to[top1]]]=v;
	j=0;
	while(book2[j]==v)
		j++;
	a[v]=j;
}
int main(){
	//freopen("camp.in","r",stdin);
	//freopen("camp.out","w",stdout);
	n=read();
	for(i=1;i<=n;i++){
		x=read();
		lj(x,i);
	}
	for(i=1;i<=n;i++)
		if(book[i]==0)
			ss(i);
	for(i=1;i<=n;i++)
		book[i]=0;
	for(i=1;i<=tail;i++)
		book[zhan[i]]=2;
	for(i=1;i<=tail;i++)
		ss2(zhan[i]);
	flag=0;
	for(i=2;i<=tail;i++)
		if(a[zhan[i]]!=a[zhan[i-1]])
			flag=1;
	if(flag==0&&(tail&1))
		printf("IMPOSSIBLE\n");
	else
		printf("POSSIBLE\n");
	return 0;
}

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


int main(){
    int n;
    cin >> n;
    int cnt = 0;
    rep(i, n){
        int d1, d2;
        cin >> d1 >> d2;
        if(d1 == d2){
            cnt++;
        }
        else{
            cnt = 0;
        }
        if(cnt == 3){
            cout << "Yes" << endl;
            return 0;
        }
    }
    cout << "No" << endl;
    return 0; 
}


Measured memory_bytes: 3632
#include <stdio.h>
int main(){
    int N, M, A[10000];
    scanf("%d%d", &N, &M);
    for (int i = 0; i < M; i++)
    {
        scanf("%d", &A[i]);
        N = N - A[i];
    }
    if(N < 0){
        printf("%d", -1);
    }
    else{
        printf("%d", N);
    }
    return 0;
}

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


int main(void){
	char  s[100024];
	int str[100024]={0};
	int str_count=0;
	int ans = 0;
	int n,k;
	scanf("%d %d",&n,&k);
	scanf("%s",s);
	int i,j;

	int hoge=1;
	for(i=1;i<n;i++){
		if(s[i]==s[i-1]){
			hoge++;
		}else{
			str[str_count++]=hoge;
			hoge=1;
		}
	}
	str[str_count++]=hoge;
	
	int flag = (s[0] == '0')?0:1;
	for(i=0;i<str_count;i++){
		int piyo=0;
		if(flag==0){
			for(j=i;j<i+k*2;j++){
				piyo+=str[j];
				if(str[j]==0){
					if(ans<piyo){
						ans=piyo;
					}
					printf("%d\n",ans);
					return 0;
				}
			}
			flag=1;
		}else{
			for(j=i;j<i+1+k*2;j++){
				piyo+=str[j];
				if(str[j]==0){
					if(ans<piyo){
						ans=piyo;
					}
					printf("%d\n",ans);
					return 0;
				}
			}
			flag=0;
		}
		if(ans<piyo){
			ans=piyo;
		}
	}
	printf("%d\n",ans);

	for(i=0;i<str_count+5-k*2;i++){
		printf("%d ",str[i]);
	}



	return 0;
}


Measured memory_bytes: 640
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
ll ar[200005],br[200005],cr[200005];
int main()
{
    ll n,t,a;
    char c;
    cin>>c;
    if(c>=97)cout<<'a'<<endl;
    else cout<<'A'<<endl;
}


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

int main() {
	int h, w;
	cin >> h >> w;
	vector<string> a(h);
	for (int i = 0; i < h; i++) {
		cin >> a[i];
	}

	vector<bool> row(h, false);
	vector<bool> col(w, false);
	for (int i = 0; i < h; i++) {
		for (int j = 0; j < w; j++) {
			if (a[i][j] == '#') {
				row[i] = true;
				col[j] = true;
			}
		}
	}

	for (int i = 0; i < h; i++) {
		if (row[i]) {
			for (int j = 0; j < w; j++) {
				if (col[j]) {
					cout << a[i][j];
				}
			}
			cout << endl;
		}
	}

  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
#include<complex>
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 = (1e+18) + 7;
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-6;
const ld pi = acos(-1.0);
//typedef vector<vector<ll>> mat;
typedef vector<int> vec;

ll mod_pow(ll a, ll n) {
	ll res = 1;
	while (n) {
		if (n & 1)res = res * a%mod;
		a = a * a%mod; 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;
}

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 << 20;
modint fact[max_n], factinv[max_n];
void init() {
	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];
}


void solve() {
	int n; cin >> n;
	vector<string> s(n);
	vector<int> t(n);
	rep(i, n) {
		cin >> s[i] >> t[i];
	}
	string x; cin >> x;
	rep(i, n) {
		if (x == s[i]) {
			int ans = 0;
			for (int j = i + 1; j < n; j++) {
				ans += t[j];
			}
			cout << ans << endl; return;
		}
	}
}

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


Measured memory_bytes: 16640
#include <bits/stdc++.h>
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define ok() puts(ok?"Yes":"No");
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> ii;
typedef vector<vi> vvi;
typedef vector<ii> vii;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef set<int> si;
typedef map<string, int> msi;
typedef greater<int> gt;
typedef priority_queue<int, vector<int>, gt> minq;
typedef long long ll;
typedef pair<ll,ll> pll;
const ll LINF = 1e18L + 1;
const int INF = 1e9 + 1;
//clang++ -std=c++11 -stdlib=libc++ 

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

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};

mint fact[200005];

mint choose(int n, int k) {
  if (n<k) return mint(0);
  return fact[n] / fact[n-k] / fact [k];
}

istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}

mint m_power[200005];

int main() {
  ll n,m,k; cin>> n>>m>>k;
  fact[0] = 1;
  m_power[0] = 1;
  for (int i=1; i<n; i++) {
    fact[i] = i * fact[i-1].x % mod;
    m_power[i] = (m_power[i-1].x * (m-1)) % mod;
  }
  mint ans =0 ;
  rep(i,k+1) {
    mint temp = m * m_power[n-i-1].x;
    temp *= fact[n-1];
    temp /= fact[n-1-i];
    temp /= fact[i];
    ans += temp;
  }
  cout << ans << endl;
  return 0;
}

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

int main(int argc, const char * argv[]) {
    
    // cinを高速にするためのおまじない
    cin.tie(0);
    ios::sync_with_stdio(false);
    
    int n,a,b;
    cin >> n >> a >> b;
    
    int i, checking;
    //vector<int> digit;
    int digit_sum = 0;
    int sum = 0;
    
    for(i=1;i<=n;i++){
        checking = i;
        digit_sum = 0;
        while(checking>0){
            digit_sum += (checking%10);
            checking=checking/10;
        }
        if(a<=digit_sum && digit_sum<=b){
            sum += i;
        }
    }
    
    cout << sum << endl;
    
    return 0;
}

Measured memory_bytes: 256
// D - Fennec VS. Snuke
#include <bits/stdc++.h>
using namespace std;
using vi = vector<int>;
using vvi = vector<vi>;
#define ote(x) cout<<(x)<<endl
#define rp(i,s,e) for(int i=(s);i<(e);++i)

void vprn(vector<int> &v){ for(int i=0;i<v.size();i++) cout<<v[i]<<(i<v.size()-1?",\t":"\n"); }
void vvprn(vector<vector<int>> &vv){
	rp(i,1,vv.size()){
		cout<<i<<") ";
		vprn(vv[i]);
	}
}

void distance(int p, int d, vvi &tree, vi &visited){
	// printf("p %d  d %d\n",p,d);//
	if(visited[p] > 0){
		// printf("visited p %d\n", p);//
		return;
	}
	// printf("set visited p %d d %d\n", p,d);//
	visited[p] = d;
	for(auto c: tree[p]){
		distance(c, d+1, tree, visited);
	}
}

string solve(int N, vi &A, vi &B){
	vvi tree(N+1, vi());
	rp(i, 0, N-1){
		tree[A[i]].push_back(B[i]);
		tree[B[i]].push_back(A[i]);
	}
	// vvprn(tree);//
	vi f(N+1), s(N+1);
	distance(1, 1, tree, f);
	distance(N, 1, tree, s);
	// printf("f ");vprn(f);//
	// printf("s ");vprn(s);//
	int c = 0;
	rp(i, 1, N+1){
		c += f[i]<=s[i]? 1: -1;
		// cout<< (f[i]<=s[i]? "f ":"s ") <<"\n";//
	}
	// printf("c %d\n",c);//
	return c>0? "Fennec": "Snuke";
}

int main(){
	int N; cin>>N;
	vi A(N-1), B(N-1);
	rp(i, 0, N-1) cin>>A[i]>>B[i];
	cout<< solve(N, A, B) <<endl;
}


Measured memory_bytes: 11904
import math
def f_pow(x,n):
    if n == 0:
        return 1
    half = f_pow(x, n//2)
    if n % 2:
        return x * half * half % mod
    else:
        return half * half % mod

def c(n, r):
    p,q = 1,1
    for i in range(r):
        p = p*(n-i)%mod
        q = q*(i+1)%mod
    return p * f_pow(q, mod-2)%mod

n,a,b = map(int,input().split())
mod = 10**9+7

s = f_pow(2, n) - 1
print((s - c(n,a) - c(n,b))%mod)

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

int cmp(int a, int b)
{
    return a > b;
}


int main()
{
    int n, k, ara[101], ans = 0;
    scanf("%d%d", &n, &k);
    for(int i = 0; i < n; i++)scanf("%d", &ara[i]);
    sort(ara, ara+n, cmp);
    for(int i = 0; i < k; i++)ans+=ara[i];
    printf("%d", ans);
    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
const int MN=200000+5;
const int P=1000000007;
using namespace std;
typedef long long ll;
template<typename T>T&IN(T&in){
	in=0;char c=getchar();int f=1;
	while(!isdigit(c)){if(c=='-')f=-1;c=getchar();}
	while(isdigit(c))in=in*10+c-'0',c=getchar();
	in*=f;return in;
}
int n,m,a,b,N;ll ans;
ll fac[MN],inv[MN];
ll qp(ll a,ll b){ll c=1;for(;b;b>>=1,a=a*a%P)if(b&1)c=c*a%P;return c;}
ll C(int n,int m){return n>=m?fac[n]*inv[m]%P*inv[n-m]%P:0;}
void input(){
	IN(n),IN(m),IN(a),IN(b),fac[0]=1;N=200000;
	for(int i=1;i<=N;++i)fac[i]=fac[i-1]*i%P;
	inv[N]=qp(fac[N],P-2);
	for(int i=N;i>=1;--i)inv[i-1]=inv[i]*i%P;
	for(int i=b+1;i<=m;++i){
		ans=(ans+C(n-a-1+i-1,i-1)*C(a-1+m-i,a-1)%P)%P;
	}
	printf("%lld\n",ans);
}
int main(){
	input();
	return 0;
}

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

using namespace std;
using ll = long long;

int main() {
	cin.sync_with_stdio(false);
	string s;
	for (int i = 0;i < 3;i++) {
		cin >> s;
		cout << char(toupper(s[0]));
	}
	cout << endl;

	return 0;
}

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

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

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

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// mod
const ll MOD = 1000000007ll;
#define FIX(a) ((a)%MOD+MOD)%MOD

// floating
typedef double Real;
const Real EPS = 1e-11;
#define EQ0(x) (abs(x)<EPS)
#define EQ(a,b) (abs(a-b)<EPS)
typedef complex<Real> P;

int main(){
  int n,c;
  cin>>n>>c;
  vector<vector<pii>> v(c);
  REP(i,n){
    int s,t,x;
    cin>>s>>t>>x;
    --x;
    v[x].push_back(pii(s,t));
  }
  vi imo(125252,0);
  REP(x,c){
    sort(ALL(v[x]));
    int bef = -252521;
    for(pii P : v[x]){
      int s = P.first, t = P.second;
      if(s==bef)s++;
      imo[s]++;
      imo[t+1]--;
      bef = t;
    }
  }
  REP(i,125252-1)imo[i+1]+=imo[i];
  int ans = 0;
  REP(i,125252)CHMAX(ans,imo[i]);
  cout<<ans<<endl;
  return 0;
}


Measured memory_bytes: 1920
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
 
#define int long long
#define ull unsigned long long
#define ld long double
#define rep(a) rep1(i,a)
#define rep1(i,a) rep2(i,0,a)
#define rep2(i,b,a) for(int i=(b); i<((int)(a)); i++)
#define rep3(i,b,a) for(int i=(b); i>=((int)(a)); i--)
#define all(a) a.begin(),a.end()
#define pii pair<int,int>
#define pb push_back
#define mp make_pair
#define sz(a) ((int)a.size())
#define pow2(x) (1ll<<(x))
#define ceiling(a,b) (((a)+(b)-1)/(b))
#define print0(a) cout << (a) << ' '
#define print1(a) cout << (a) << '\n'
#define print2(a,b) cout << (a) << ' ',print1(b)
#define print3(a,b,c) cout << (a) << ' ',print2(b,c)
#define print4(a,b,c,d) cout << (a) << ' ',print3(b,c,d)
#ifdef i_am_noob
#define debug(a) print2(#a,a)
#else
#define debug(a) 
#endif
#define ordered_set tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>
 
using namespace std;
using namespace __gnu_pbds;
 
const int Mod=1000000007,Mod2=998244353;
const int MOD=Mod2;
 
inline int add(int a, int b){return (a+b>=MOD?a+b-MOD:a+b);}
inline int sub(int a, int b){return (a+MOD-b>=MOD?a-b:a+MOD-b);}
int Pow(int a, int b){
	if(!b) return 1;
	int tmp=Pow(a*a%MOD,b>>1);
	return (b&1?tmp*a%MOD:tmp);
}
inline int inverse(int n){return Pow(n,MOD-2);}
 
const int maxn=100005;
//i_am_noob
int a,b;

signed main(){
	ios_base::sync_with_stdio(0),cin.tie(0);
	cin >> a >> b;
	print1(a<b?0:10);
	return 0;
}


Measured memory_bytes: 256
N = int(input())
A = list(map(int,input().split()))
[print(A[x],'',end='') for x in range(N-1)]
print(A[N-1])
for i in range(1,N):
    v=A[i]
    j=i-1
    while j>=0 and A[j]>v:
        A[j+1] = A[j]
        j-=1
    A[j+1]=v
    [print(A[x],'',end='') for x in range(N-1)]
    print(A[N-1])



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

const int DIM = 1e5 + 5;

int arr[DIM];

int main(void) {
    ios::sync_with_stdio(false);
    
    string str;
    cin >> str;
    
    cout << str.front() << str.size() - 2 << str.back();
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define ll long long int 
#define dg 0
ll ar[2000010];
int main() 
{
    ll i,cnt=0,n,c,l,ff,fs,s,x,y,z,j;
    vector< pair< pair<ll,ll> , ll> > vec;
    vector<ll> st[100006],en[100006];
    vector< pair< pair<ll,ll> , ll> >::iterator it;
    cin>>n>>c;
    for(i=0;i<n;i++)
    {
        cin>>x>>y>>z;
        vec.push_back(make_pair(make_pair(x,y),z));
    }
    sort(vec.begin(),vec.end());
    for(it=vec.begin();it!=vec.end();it++)
    {
        //f=*it.first();
        //pair< <pair< ll,ll>,ll > p= it;
        s=it->second;
        ff=it->first.first;
        fs=it->first.second;
        //cout<<fs<<" "<<ff;
        l=st[s].size();
        if(l==0)
        {
            st[s].push_back(ff);
            en[s].push_back(fs);
        }
        else
        {
            
            if(ff==en[s][l-1])
            {
                
                en[s][l-1]=fs;
            }
            else
            {
                st[s].push_back(ff);
                en[s].push_back(fs);
            }
        }
    }
    for(i=1;i<=c;i++)
    {
        l=st[i].size();
        for(j=0;j<l;j++)
        {
            //cout<<l<<" hh\n";
            ar[st[i][j]*2-1]++;
            ar[en[i][j]*2]--;
        }
    }
    //for(i=1;i<35;i++)
    //cout<<i<<" ";
    //cout<<"\n";
    for(i=1;i<2000010;i++)
    {
        //cout<<i<<" "<<ar[i]<<" ";
        ar[i]+=ar[i-1];
        cnt=max(cnt,ar[i]);
    }
    cout<<cnt<<"\n";
    return 0;
}    

Measured memory_bytes: 25840
n = gets
array = readlines.map(&:chomp!)

a = array.group_by(&:itself).map { |k, v| [k, v.size] }
max_n = a.max { |x, y| x[1] <=> y[1] }[1]

b = a.select { |e| e[1] == max_n }.sort_by { |e| e[0] }

b.each do |e|
  puts e.first
end


Measured memory_bytes: 72208
open System

[<EntryPoint>]
let main argv =
    let [|n; k|] = stdin.ReadLine().Split() |> Array.map int
    let a = stdin.ReadLine().Split() |> Array.map int
    let b = Array.sort a 
    b.[0..k-1] |> Array.sum |> printf "%d"

    0 


Measured memory_bytes: 30412
package main
 
import (
    "bufio"
    "fmt"
    "os"
    "strconv"
    "sort"
)

func main(){
    
    N := nextInt()
    _ = nextInt()
    S := nextStrings(N)
 
	sort.Strings(S)
 
	for _, x := range S {
        fmt.Print(x)
	}
    fmt.Print("\n")
 
 }
 
/* templates */
 
func Max(a []int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r < a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Min(a []int) int {
    r := a[0]
    for i := 0; i < len(a); i++ {
        if r > a[i] {
            r = a[i]
        }
    }
    return r
}
 
func Sum(a []int) (r int) {
    for i := range a {
        r += a[i]
    }
    return r
}
 
func Abs(a float64) float64 {
    if a < 0 {
        return -a
    }
    return a
}
 
type Pair struct {
    a, b int
}
 
type Pairs []Pair
 
func (p Pairs) Len() int {
    return len(p)
}
 
func (p Pairs) Swap(i, j int) {
    p[i], p[j] = p[j], p[i]
}
 
func (p Pairs) Less(i, j int) bool {
    return p[i].b < p[j].b
}
 
var nextReader func() string
 
func init() {
    nextReader = NewScanner()
}
 
func NewScanner() func() string {
    r := bufio.NewScanner(os.Stdin)
    r.Buffer(make([]byte, 1024), int(1e+11))
    r.Split(bufio.ScanWords)
    return func() string {
        r.Scan()
        return r.Text()
    }
}

func nextString() string {
    return nextReader()
}
 
func nextInt64() int64 {
    v, _ := strconv.ParseInt(nextReader(), 10, 64)
    return v
}
 
func nextInt() int {
    v, _ := strconv.Atoi(nextReader())
    return v
}
 
func nextInts(n int) []int {
    r := make([]int, n)
    for i := 0; i < n; i++ {
        r[i] = nextInt()
    }
    return r
}

func nextStrings(n int) []string {
    r := make([]string, n)
    for i := 0; i < n; i++ {
        r[i] = nextString()
    }
    return r
}

func nextFloat64() float64 {
    f, _ := strconv.ParseFloat(nextReader(), 64)
    return f
}


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

using namespace std;

int main() {
  string S;
  cin >> S;
  int ans = 700;
  for (int i = 0; i < 3; ++i) {
    if (S[i] == 'o') ans += 100;
  }
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
import java.io.*;
import java.util.*;

public class Main {

    public static void solve(InputReader in, PrintWriter out) throws Exception {

        int n = in.nextInt();

        int[] arr = new int[n];

        for(int i=0;i<n;i++)
            arr[i]=in.nextInt();

        int xor =0;

        for(int i=0;i<n-1;i+=2)
        xor=xor^arr[i]^arr[i+1];

        for(int i=0;i<n;i++)
            out.print((xor^arr[i])+" ");

        out.println();


    }

    /////////////////////////////////////////////////////////


    private final static long hash(long x, long y) {
        x += offset;
        y += offset;
        return x << 32 | y;
    }

    private final static int offset = (int) 3e5;

    public static void main(String[] args) throws Exception {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        solve(in, out);
        out.close();
    }

    static class InputReader {
        private BufferedReader reader;
        private StringTokenizer tokenizer;

        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }

        private String nextToken() throws IOException {
            while (tokenizer == null || !tokenizer.hasMoreTokens())
                tokenizer = new StringTokenizer(reader.readLine());
            return tokenizer.nextToken();
        }

        public String nextLine() throws IOException {
            return reader.readLine();
        }

        public int nextInt() throws IOException {
            return Integer.parseInt(nextToken());
        }

        public long nextLong() throws IOException {
            return Long.parseLong(nextToken());
        }

        public double nextDouble() throws IOException {
            return Double.parseDouble(nextToken());
        }

    }
}

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

using namespace std;

void solve()
{
    int a,b;
    cin>>a>>b;

    int pow=1;
    int res;

    if(b<=99)
    {
    if(a==0)
    {
        cout<<b%100;
    }
    else if(a==1)
    {
        cout<<(b%100)*100;
    }
    else
        cout<<(b%100)*100*100;
    }
    else
    {
         if(a==0)
    {
        cout<<101;
    }
    else if(a==1)
    {
        cout<<(101)*100;
    }
    else
        cout<<(101)*100*100;
    }

}

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

    solve();

  return 0;
}


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

#define rep(i, n) REP(i, 0, n)
#define REP(i, x, n) for(int i = x; i < n; i++)
#define OP(x) cout << x << endl;

int main() {
    int d, g;
    int p[d], c[d];
    cin >> d >> g;
    rep(i, d) cin >> p[i] >> c[i];

    int ans = 1001;
    for(int bit = 0; bit < (1 << d); bit++){
        int sum = 0;
        int cnt = 0;
        rep(i,d){
            if(bit & (1 << i)){
                cnt += p[i];
                sum += (i+1)*100*p[i]+c[i];
            }
        }
        // 足りない場合は高得点の問題から解いていく
        // この時全完してもボーナス点は上で考慮されるため加算不要
        if(sum < g){
            for(int i = d-1; i >= 0; i--){
                // フラグの立ってない問題を解く
                if(bit & (1 << i)) continue;
                rep(j,p[i]){
                    if(sum >= g) break;
                    sum += (i+1)*100;
                    cnt += 1;
                }
            }
        }
        if(sum >= g) ans = min(ans, cnt);
    }

    OP(ans);
    return 0;
}


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

#define REP(i, n) for(int (i)=0;(i)<(n);++(i))
#define REPV(iter, v) for(auto (iter)=(v).begin(); (iter)!=(v).end();++(iter))
#define ALL(v) (v).begin(),(v).end()

#define MOD 1000000007

using namespace std;

typedef long long ll;

int main()
{
    string S;
    cin >> S;
    char ans;
    for (char c = 'a'; c <= 'z'; ++c)
    {
        if (S[0] == c)
        {
            ans = 'a';
        }
    }
    for (char c = 'A'; c <= 'Z'; ++c)
    {
        if (S[0] == c)
        {
            ans = 'A';
        }
    }

    cout << ans << endl;
}


Measured memory_bytes: 3616
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		try {
			String a = sc.next();
			String b = sc.next();

			if (a.equals("H")) {
				System.out.println(b);
			} else {
				if (b.equals("H")) {
					System.out.println("D");
				} else {
					System.out.println("H");
				}
			}

		} finally {
			sc.close();
		}
	}
}

Measured memory_bytes: 21716
#include <iostream>

using namespace std;

int pow(int a, int b) {
    int ans = a;
    for (int i = 1; i < b; ++i)
        ans *= a;
    return ans;
}

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

    if (x == 1) {
        cout << x << '\n';
        return 0;
    }

    int answer = 0;
    for (int b = 2; b < x; ++b) {
        for (int p = 2;; ++p) {
            int n = pow(b, p);
            if (n > x)
                break;
            answer = max(answer, n);
        }
    }
    cout << answer << '\n';
}


Measured memory_bytes: 256
#include<stdio.h>
#define MAX 2222222
#define INFTY (1<<30)

void maxHeapify(int);
void insert(int);
void increaseKey(int,int);
int heapExtractMax(void);

int H,A[MAX];

int main(){
  int key;
  char c[10];
  A[H] = -INFTY;

  while(1){
    scanf("%s",c);
    if(c[0] == 'e' && c [1] =='n'){
      break;
    }
    if(c[0] == 'i'){
      scanf("%d",&key);
      insert(key);
    }
    else{
      printf("%d\n",heapExtractMax());
    }
  }
  return 0;
}
void maxHeapify(int i){
  int l,r;
  int max,keep;
  l = 2*i;
  r = 2*i+1;
  if(l <= H && A[l] >A[i]) {
    max = l;
  }
  else{
    max = i;
  }
  if(r <= H&& A[r] >A[max]) {
    max = r;
  }

  if(max != i){
    keep = A[i];
    A[i] = A[max];
    A[max] = keep;
    maxHeapify(max);
  }
}

void insert(int x){
  H++;
  A[H] = -INFTY;
  increaseKey(H,x);
}

void increaseKey(int i, int x){
  int c;
  if(x <A[i]){
    return ;
  }
  A[i] = x;
  while(i > 1 && A[i/2] < A[i]){
    c = A[i/2];
    A[i/2] = A[i];
    A[i] = c;
    i = i/2;
  }
}

int heapExtractMax(){
  int max;
  if (H < 1){
    return -INFTY;
  }
  max = A[1];
  A[1] = A[H];
  H--;
  maxHeapify(1);
  return max;
}



Measured memory_bytes: 5648
/* template.cpp(shinobu_menkoi) {{{ */
#include <bits/stdc++.h>
using namespace std;

// clang-format off
#define GET_MACRO(_1, _2, _3, _4, NAME, ...) NAME
#define rep(...) GET_MACRO(__VA_ARGS__, rep4, rep3, rep2, rep1)(__VA_ARGS__)
#define rep1(n) rep2(_, n)
#define rep2(i, n) rep3(i, 0, n)
#define rep3(i, a, n) rep4(i, a, n, 1)
#define rep4(i, a, n, s) for (lint i = (a); i < (lint)(n); i += (s))
#define rrep(...) GET_MACRO(__VA_ARGS__, rrep4, rrep3, rrep2, rrep1)(__VA_ARGS__)
#define rrep1(a) rrep2(_, a)
#define rrep2(i, a) rrep3(i, a, 0)
#define rrep3(i, a, n) rrep4(i, a, n, 1)
#define rrep4(i, a, n, s) for (lint i = (a); i >= (lint)(n); i -= (s))
#define each(i, ctn) for (auto &&i : (ctn))

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define all(v) begin(v), end(v)
#define debug(x) cerr << (x) << " (L:" << __LINE__ << ")" << '\n'
#define TEMP_T template <class T>
#define TEMP_TU template <class T, class U>

TEMP_T using vec = vector<T>;
TEMP_T using heap = priority_queue<T>;
TEMP_T using minheap = priority_queue<T, vec<T>, greater<T>>;
using lint = long long;
using ulint = unsigned long long;
using ld = long double;
using vi = vec<int>;
using vvi = vec<vi>;
using vvvi = vec<vvi>;
using pii = pair<int, int>;
using vs = vec<string>;

TEMP_TU ostream &operator<<(ostream &os, const pair<T, U> &p) { return os << p.fi << " " << p.se; }
TEMP_TU istream &operator>>(istream &is, pair<T, U> &p) { return is >> p.fi >> p.se; }

constexpr int INF{1001001001};
constexpr lint LINF{1001001001001001001ll};
constexpr int MOD{(int)1e9 + 7};
constexpr double EPS{1e-9};
const double PI{acos(-1)};
constexpr int dx[]{0, 1, 0, -1, 1, -1, 1, -1}, dy[]{1, 0, -1, 0, 1, -1, -1, 1};

inline bool inside(int y, int x, int h, int w) { return y >= 0 && x >= 0 && y < h && x < w; }
TEMP_T inline bool chmin(T &a, const T &b) { if (a > b) a = b; return a > b; }
TEMP_T inline bool chmax(T &a, const T &b) { if (a < b) a = b; return a < b; }
TEMP_T inline void print(const T &x) { cout << x << '\n'; }
TEMP_T inline void print(const vec<T> &v, string d = "\n") { rep(i, v.size()) cout << v[i] << (i == (lint)(v.size() - 1) ? "\n" : d); }
template <class T = int> inline T in() { T x; cin >> x; return x; }
template <class T = string> vec<T> split(const string &s, char d = ',') {
  vec<T> v; stringstream ss(s); for (string b; getline(ss, b, d); ) {
    stringstream conv(b); T t; conv >> t; v.eb(t); } return v;
}
struct pre_ { pre_() { cin.tie(nullptr); ios::sync_with_stdio(false); cout << fixed << setprecision(12); } } pre__;
// clang-format on
/* }}} */
#define int long long
int lcm(int a, int b) {
  return a / __gcd(a, b) * b;
}

signed main() {
  int n;
  cin >> n;
  int res;
  rep(i, n) {
    int a;
    cin >> a;
    if (i == 0) res = a;
    else res = lcm(res, a);
  }
  print(res);
}


Measured memory_bytes: 256
fun main() {
    solve()
}

private fun solve() {
    val n = readInt()
    val arr1 = mutableListOf<Int>()
    val arr2 = mutableListOf<Int>()

    repeat(n) {
        val (a1, a2) = readInts()

        arr1.add(a1)
        arr2.add(a2)
    }

    var doubletFound = false
    var doubletCount = 0
    repeat(n) { i ->
        if (arr1[i] == arr2[i]) {
            if (++doubletCount == 3) doubletFound = true
        } else {
            doubletCount = 0
        }
    }

    if (doubletFound) println("Yes")
    else println("No")
}

private fun readLn() = readLine()!! // string line
private fun readInt() = readLn().toInt() // single int
private fun readStrings() = readLn().split(" ") // list of strings
private fun readInts() = readStrings().map { it.toInt() } // list of ints

Measured memory_bytes: 37952
#include <bits/stdc++.h>
using namespace std;
typedef signed long long ll;

#undef _P
#define _P(...) (void)printf(__VA_ARGS__)
#define FOR(x,to) for(x=0;x<(to);x++)
#define FORR(x,arr) for(auto& x:arr)
#define ITR(x,c) for(__typeof(c.begin()) x=c.begin();x!=c.end();x++)
#define ALL(a) (a.begin()),(a.end())
#define ZERO(a) memset(a,0,sizeof(a))
#define MINUS(a) memset(a,0xff,sizeof(a))
//-------------------------------------------------------

int N,K;
ll mo;
ll from[155][155][155];
ll to[155][155][155];

ll hoge(int N) {
	ll from[151]={};
	ll to[151];
	
	from[0]=1;
	int i,j;
	FOR(i,N) {
		ZERO(to);
		FOR(j,K+1) {
			(to[0]+=from[j])%=mo;
			if(j+1<=K) (to[j+1]+=from[j])%=mo;
		}
		
		swap(from,to);
	}
	
	ll ret=0;
	FOR(i,N+1) ret+=from[i];
	return ret%mo;
}

void solve() {
	int i,j,k,l,r,x,y; string s;
	
	cin>>N>>K>>mo;
	
	if(K%2==0) {
		K/=2;
		cout<<hoge(N/2)*hoge((N+1)/2)%mo<<endl;
	}
	else {
		from[0][1][154]=1;
		for(i=2;i<=N+1;i++) {
			ZERO(to);
			
			int a,b;
			for(a=0;a<i;a+=2) for(b=1;b<i;b+=2) for(j=max(a,b);j<=154;j++) if(from[a][b][j]) {
				ll v=from[a][b][j];
				//cout<<i<<" "<<a<<" "<<b<<" "<<j<<" "<<v<<endl;
				int nex;
				if(i%2==0) {
					// keep
					nex=j;
					if(b+2+K>=i) nex=154;
					(to[i][b][nex]+=v)%=mo;
					
					// remove
					if(i==j) continue;
					nex=j;
					if(b!=i-1 && a==i-2) nex=min({154,j,i+K});
					(to[a][b][nex]+=v)%=mo;
				}
				else {
					// keep
					nex=j;
					if(a+2+K>=i) nex=154;
					(to[a][i][nex]+=v)%=mo;
					
					// remove
					if(i==j) continue;
					nex=j;
					if(a!=i-1 && b==i-2) nex=min({154,j,i+K});
					(to[a][b][nex]+=v)%=mo;
				}
			
			}
			swap(from,to);
		}
		
		ll ret=0;
		FOR(x,155) FOR(y,155) FOR(j,155) ret+=from[x][y][j];
		cout<<ret%mo<<endl;
	}
}


int main(int argc,char** argv){
	string s;int i;
	if(argc==1) ios::sync_with_stdio(false), cin.tie(0);
	FOR(i,argc-1) s+=argv[i+1],s+='\n'; FOR(i,s.size()) ungetc(s[s.size()-1-i],stdin);
	cout.tie(0); solve(); return 0;
}


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

int main(){
    int H, W;
    cin >> H >> W;
    while ((H != 0) || (W != 0)){
        int c=0;
        for(int i = 0; i < H * W; i++){    
            if(c % 2 == 0) cout << "#";
            else cout << ".";
            if((i + 1) % W == 0){
                cout << endl;
                if(W % 2 == 0) c++;
            }
            c++;
                
        }
        cout << endl;
        cin >> H >> W;
    }
    return 0;
}


Measured memory_bytes: 3076
import Control.Monad
import Control.Monad.ST
import qualified Data.Array as A
import qualified Data.Array.ST as ST
import qualified Data.Array.Unboxed as AU
import qualified Data.ByteString.Char8 as BS
import Data.Char
import Data.Int
import qualified Data.IntMap as IM
import Data.List
import qualified Data.Map as M
import Data.Maybe
import Data.Ord
import qualified Data.Set as S
import Data.Time
import qualified Data.Vector as V
import qualified Data.Vector.Mutable as VM
import qualified Data.Vector.Unboxed as VU
import qualified Data.Vector.Unboxed.Mutable as VUM

readInt :: IO [Int]
readInt = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

readInts :: Int -> IO [[Int]]
readInts n = replicateM n readInt

readString :: IO [String]
readString = map BS.unpack . BS.words <$> BS.getLine

readStrings :: Int -> IO [[String]]
readStrings n = replicateM n <$> readString

toPair :: [a] -> (a, a)
toPair [x, y] = (x, y)

main = do
  [n] <- readInt
  a <- readInt
  print $ solve a

solve :: [Int] -> Int
solve a
  | even $ length (filter (< 0) a) = foldl (\acc n -> acc + abs n) 0 a
  | otherwise = foldl (\acc n -> acc + abs n) 0 a - minimum (map abs a) * 2

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

int main(){
    int n, k, q;
    int pt[100001] = {0};
    cin >> n >> k >> q;
    for(int i=0;i<q;++i){
        int a;
        cin >> a;
        ++pt[a];
    }
    for(int i=1;i<=n;++i){
        if(pt[i]-q+k > 0) cout << "Yes" << endl;
        else cout << "No" << endl;
    }

    return 0;
}


Measured memory_bytes: 1024
#include<bits/stdc++.h>
#define ALL(c) (c).begin(),(c).end()
#define EACH(i,c) for(auto i=(c).begin();i!=(c).end();++i)
using namespace std;
#define int long long

const double INF = 1e30;

typedef double Weight;
struct Edge{
    int from, to;
    Weight weight;
    int rev;     // ネットワークフロー時の逆辺
    Edge(int from, int to, Weight weight) :
        from(from), to(to), weight(weight) { }
    Edge(int from, int to, Weight weight, int rev) :
        from(from), to(to), weight(weight), rev(rev){ }
};
bool operator < (const Edge &a, const Edge &b){
    if(a.weight != b.weight) return a.weight > b.weight;
    if(a.from != b.from) return a.from > b.from;
    return  a.to > b.to;
}
typedef vector<Edge> Edges;
typedef vector<Edges> Graph;

typedef vector<Weight> Array;
typedef vector<Array> Matrix;

void addFlowEdge(Graph &g, int a, int b, Weight c){
    g[a].push_back(Edge(a, b, c, g[b].size()));
    g[b].push_back(Edge(b, a, 0, g[a].size() - 1));
}
void addUndirectedEdge(Graph &g, int a, int b, Weight c){
    g[a].push_back(Edge(a, b, c, g[b].size()));
    g[b].push_back(Edge(b, a, c, g[a].size() - 1));
}

void dijkstra(const Graph &g, int s, vector<Weight> &dist, vector<int> &prev){
    int n = g.size();
    dist.assign(n, INF);
    dist[s] = 0;
    prev.assign(n, -1);
    priority_queue<Edge> Q;     // a < b <-> a.weight > b.weight
    Q.push(Edge(-2, s, 0));
    while(!Q.empty()){
        Edge e = Q.top(); Q.pop();
        if(prev[e.to] != -1) continue;
        prev[e.to] = e.from;
        EACH(i, g[e.to]){
        //for(Edges::const_iterator i=g[e.to].begin(); i!=g[e.to].end(); ++i){    //マクロが使えないとき
            if(dist[i -> to] > dist[i -> from] + i -> weight){
                dist[i -> to] = dist[i -> from] + i -> weight;
                Q.push(Edge(i -> from, i -> to, dist[i -> to]));
            }
        }
    }
}
vector<int> buildPath(const vector<int> &prev, int t){
    vector<int> path;
    for(int v = t; v >= 0; v = prev[v])
        path.push_back(v);
    reverse(path.begin(), path.end());
    return path;
}

signed main(){
	int x1, y1, x2, y2, N;
	cin >> x1 >> y1 >> x2 >> y2 >> N;
	vector<tuple<int,int,int>> v;
	v.push_back(make_tuple(x1, y1, 0));
	v.push_back(make_tuple(x2, y2, 0));

	for(int i = 0; i < N; ++i) {
		int x, y, r;
		cin >> x >> y >> r;
		v.push_back(make_tuple(x, y, r));
	}

	N += 2;

	Graph g(N);

	for(int i = 0; i < N; ++i) for(int j = i + 1; j < N; ++j) {
		int dx = get<0>(v[j]) - get<0>(v[i]), dy = get<1>(v[j]) - get<1>(v[i]);
		int R = get<2>(v[i]) + get<2>(v[j]);
		double d = max(0.0, sqrt(dx * dx + dy * dy) - R);
		addUndirectedEdge(g, i, j, d);
	}
	vector<double> dist(N);
	vector<int> prev(N);
	dijkstra(g, 0, dist, prev);
	printf("%.10f\n", dist[1]);

	return 0;
}


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

bool check(const string& s)
{
  stack<char> stk;
  for (string::const_iterator it = s.begin(); it != s.end(); ++it) {
    switch (*it) {
      case '(':
        stk.push(')');
        break;
      case '[':
        stk.push(']');
        break;
      case ')':
      case ']':
        if (stk.empty() || stk.top() != *it) {
          return false;
        }
        stk.pop();
        break;
    }
  }
  return stk.empty();
}

int main()
{
  for (string s; getline(cin, s) && s != ".";) {
    cout << (check(s) ? "yes" : "no") << endl;
  }
  return 0;
}

Measured memory_bytes: 900
#include<iostream>
#include<string>
#include<algorithm>
#include<cmath>
#include<vector>
#include<stack>
#include<climits>
#include<cstring>
#include<queue>
using namespace std;

int main(){
    int a, b, c;
    cin >> a >> b >> c;
    vector<int> divisor;
    for(int i=1;i<c+1;i++){
        if(c%i == 0){
            divisor.push_back(i);
        }
    }
    int S = 0;
    for (int i=a;i<b+1;i++){
        for(int j=0;j<divisor.size();j++){
            if(i == divisor[j]){
                S++;
                break;
            }
        }
    }
    cout << S << endl;
    return 0;
}

Measured memory_bytes: 3156
#include <iostream>

using namespace std;

typedef long long ll;

const int MOD = 1e9 + 7; // change if needed

struct Modint {
  ll val;
  
  Modint (ll _val = 0)
    : val(_val % MOD) {}

  Modint operator+ (Modint other) const {
    return Modint(val + other.val);
  }

  void operator+= (Modint other) {
    val += other.val;
    val %= MOD;
  }

  Modint operator- () const {
    return Modint(MOD - val);
  }

  Modint operator- (Modint other) const {
    return Modint(val + MOD - other.val);
  }

  void operator-= (Modint other) {
    val += MOD - other.val;
    val %= MOD;
  }

  Modint operator* (Modint other) const {
    return Modint(val * other.val);
  }

  void operator*= (Modint other) {
    val *= other.val;
    val %= MOD;
  }

  bool operator== (Modint other) const {
    return val == other.val;
  }

  bool operator!= (Modint other) const {
    return val != other.val;
  }
};

Modint exp (Modint a, int k) {
  if (k == 0) {
    return Modint(1);
  } else if (k % 2 == 0) {
    Modint half = exp(a, k / 2);
    return half * half;
  } else {
    return a * exp(a, k - 1);
  }
}

Modint inv (Modint a) {
  return exp(a, MOD - 2);
}

ostream& operator<< (ostream& out, Modint p) {
  out << p.val;
  return out;
}

const int MAX_N = 5e3 + 5;

Modint dp [MAX_N][MAX_N];
Modint isum [MAX_N];
Modint dsum [MAX_N][MAX_N];

Modint irange (int l, int r) {
  l = max(0, l);
  if (r < l) return Modint(0);
  if (l == 0) return isum[r];
  return isum[r] - isum[l - 1];
}

Modint dget (int diag, int idx) {
  if (diag < 0 || idx < 0) return Modint(0);
  return dsum[diag][idx];
}

Modint tpow [MAX_N];

int main () {
  tpow[0] = Modint(1);
  for (int i = 1; i < MAX_N; i++) {
    tpow[i] = Modint(2) * tpow[i - 1];
  }
  
  int n, A, B;
  cin >> n >> A >> B;

  if (A > B) swap(A, B);
  if (A == 1) {
    cout << exp(Modint(2), n) << endl;
    return 0;
  }

  dp[0][0] = Modint(1);
  dsum[0][0] = Modint(1);
  isum[0] = Modint(1);
  for (int i = 1; i <= n + 1; i++) {
    for (int b = 1; b <= i; b++) {
      if (b == 1) {
        if (i == 1) {
          dp[i][b] = 1;
        } else {
          dp[i][b] = irange(i - A, i - 2);
        }
      } else {
        dp[i][b] = dget(i - b, i - A - 1);
        if (b - 1 < B) {
          dp[i][b] += dp[i - 1][b - 1];
        }
      }

      if (b < B) {
        isum[i] += dp[i][b];
        dsum[i - b][i] += dp[i][b];
      }
      dsum[i - b][i] += dsum[i - b][i - 1];
    }

    isum[i] += isum[i - 1];
  }

  /*
  for (int i = 1; i <= n + 1; i++) {
    for (int b = 1; b <= n + 1; b++) {
      cout << dp[i][b] << " ";
    }
    cout << endl;
  }
  */
  
  Modint ans (0);
  for (int i = 1; i <= n + 1; i++) {
    for (int b = B; b <= n + 1; b++) {
      if (i == n + 1) {
        if (b != B) {
          ans += dp[i][b];
        }
      } else {
        ans += dp[i][b] * tpow[n - i];
      }
    }
  }
  cout << ans << endl;
}


Measured memory_bytes: 236624
using System;
using System.IO;

class Program
{
    static void Main()
    {
        int N = int.Parse(Console.ReadLine());
        int[] p = new int[N];
        int pMax = 0;
        int pMaxI = 0;
        int sum = 0;

        for (int i = 0; i < N; i++)
        {
            p[i] = int.Parse(Console.ReadLine());

            if (pMax < p[i])
            {
                pMax = p[i];
                pMaxI = i;
            }
        }

        //入力完了

        for (int i = 0; i < N; i++)
        {
            if (i == pMaxI)
            {
                sum += pMax / 2;
            }
            else
            {
                sum += p[i];
            }
        }

        Console.WriteLine(sum);
    }
}

Measured memory_bytes: 13140
import java.util.*;
import java.io.*;
public class Main
{
    public static void main(String []args) throws IOException {
    	FastScanner in  = new FastScanner(System.in);
    	PrintWriter out = new PrintWriter(new BufferedWriter(new OutputStreamWriter(System.out)), false); 
    	solve(in, out);
    	in.close();
    	out.close();
    }
    static long gcd(long a, long b){ return (b==0) ? a : gcd(b, a%b); }
    static int gcd(int a, int b){ return (b==0) ? a : gcd(b, a%b); }
    static class FastScanner{
	BufferedReader reader;
	StringTokenizer st;
	FastScanner(InputStream stream){reader=new BufferedReader(new InputStreamReader(stream));st=null;}	
	String next(){while(st == null || !st.hasMoreTokens()){try{String line = reader.readLine();if(line == null){return null;}		    
	     st = new StringTokenizer(line);}catch (Exception e){throw new RuntimeException();}}return st.nextToken();}
	String nextLine()  {String s=null;try{s=reader.readLine();}catch(IOException e){e.printStackTrace();}return s;}	    	  	
	int    nextInt()   {return Integer.parseInt(next());}
	long   nextLong()  {return Long.parseLong(next());}		
	double nextDouble(){return Double.parseDouble(next());}
	char   nextChar()  {return next().charAt(0);}
	int[]  nextIntArray(int n)         {int[] arr= new int[n];   int i=0;while(i<n){arr[i++]=nextInt();}  return arr;}
	long[] nextLongArray(int n)        {long[]arr= new long[n];  int i=0;while(i<n){arr[i++]=nextLong();} return arr;}	
	int[]  nextIntArrayOneBased(int n) {int[] arr= new int[n+1]; int i=1;while(i<=n){arr[i++]=nextInt();} return arr;}	    	
	long[] nextLongArrayOneBased(int n){long[]arr= new long[n+1];int i=1;while(i<=n){arr[i++]=nextLong();}return arr;}	    	
	void   close(){try{reader.close();}catch(IOException e){e.printStackTrace();}}				
    }
    
    /********* SOLUTION STARTS HERE ************/
    
    private static void solve(FastScanner in, PrintWriter out){
        
        int T = 1;//in.nextInt();
        for(int t = 1; t <= T; t++)
        {
            int a = in.nextInt();
            int b = in.nextInt();
            if(a==1){
                if(b==2) out.write("3\n");
                else out.write("2\n");
            }else if(a==2){
                if(b==1) out.write("3\n");
                else out.write("1\n");
            }else{
                if(b==1) out.write("2\n");
                else out.write("1\n");
            }
        }
    }
    
    /************* SOLUTION ENDS HERE **********/
}

Measured memory_bytes: 20948
trump_dictionary = {}
keys = ['S', 'H', 'C', 'D']
for key in keys:
    for num in range(13):
        trump_dictionary[key + ' ' + str(num + 1)] = 0

num = int(raw_input())
counter = 0
while counter < num:
    key = raw_input()
    if key in trump_dictionary:
        trump_dictionary.pop(key)
    counter += 1

for key in keys:
    for num in range(13):
        if key + ' ' + str(num + 1) in trump_dictionary:
            print(key + ' ' + str(num + 1))

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

using namespace std;

int main()
{
    int a, b;
    
    while (scanf("%d %d", &a, &b) && b){
        int r[3];
        
        int d = b - a;
        r[2] = d / 1000;
        d -= r[2] * 1000;
        r[1] = d / 500;
        d -= r[1] * 500;
        r[0] = d / 100;
        
        printf("%d %d %d\n", r[0], r[1], r[2]);
    }
    
    return (0);
}

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

using namespace std;

static const int MAX = 200000;

int main()
{
	int num = 0, maxProfit = -1000000000;
	int value[MAX] = { 0 };
	
	cin >> num;
	for (int i = 0; i < num; i++)
	{
		cin >> value[i];
	}

	int minValue = value[0];

	for (int i = 1; i < num; i++)
	{
		maxProfit = max(maxProfit, value[i] - minValue);
		minValue = min(minValue, value[i]);
	}

	cout << maxProfit << endl;

	return 0;
}


Measured memory_bytes: 3864
#include "bits/stdc++.h"

using namespace std;

#define endl            "\n"
#define sz(x)          (int) (x.size())
#define all(v)          v.begin(), v.end()
#define isOdd(n)       (n&1)
#define pow(n, m)      (ll)powl(n, m)
#define clr(x, val)     memset(x, val, sizeof(x))

typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;

const int N = 1e5 + 2, M = 4e5 + 5;

int ne, head[N], nxt[M], to[M];

void initGraph(int n){
    memset(head, -1, n * sizeof(head[0]));
    ne = 0;
}
void addEdge(int f, int t){
    to[ne] = t;
    nxt[ne] = head[f];
    head[f] = ne++;
}

void addBidirectedEdge(int u, int v){
    addEdge(u, v);
    addEdge(v, u);
}

int main()
{
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);

    int n, m; cin >> n >> m;
    initGraph(n);
    while(m--){
        int u, v; cin >> u >> v;
        u--, v--;
        addBidirectedEdge(u, v);
    }

    int dis[N] = {}, par[N];
    clr(dis, -1);

    queue<int> q;
    q.push(0);
    dis[0] = 0;
    while(q.size()){
        int u = q.front(); q.pop();
        for(int k = head[u]; ~k; k = nxt[k]){
            int v = to[k];
            if(~dis[v]) continue;
            dis[v] = 1 + dis[u];
            par[v] = u;
            q.push(v);
        }
    }
    if(~*find(dis, dis + n, -1)) return cout << "No", 0;

    cout << "Yes\n";
    for(int i = 1; i < n; i++)
        cout << par[i] + 1 << endl;
    return 0;
}


Measured memory_bytes: 7960