akhauriyash/Code-Regression huggingface dataset:
#include<cmath>
#include <bits/stdc++.h>
using ll = long long;
using namespace std;
stack<int> st;
queue<int> qu;
queue<pair<int,int> > qu2;
priority_queue<int> pq;
#define rep(i,n) for(int i=0; i<(int)(n); i++)
#define rep2(i,n) for(int i=1; i<=(int)(n); i++)
#define mins(x,y) x=min(x,y)
#define maxs(x,y) x=max(x,y)
typedef set<int> set_t;
typedef set<string> set_g;
typedef complex<double> xy_t;
static const int NIL = -1;
static const int INF = 1000000007;
#define mp make_pair
#define sz(x) int(x.sise())
#define mod 1000000007
#define reps(i,s,n) for(int i = s; i < n; i++)
#define Rreps(i,n,e) for(int i = n - 1; i >= e; --i)
#define Rrep(i,n) Rreps(i,n,0)
deque<int> deq;
#define fi first
#define se second
//const ll MOD = 998244353;
const ll MOD = (1e+9) + 7;
typedef pair<int, int> P;
int main(){
    int a;
    cin >> a;
    int ans=a+a*a+a*a*a;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 3596
# include<bits/stdc++.h>
#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;
typedef long long ll;
int h[10],w[10];
char grid[10][10];
int H,W,K;
int num_black=0;

int count(int h_bit, int w_bit){
  int res=0;
  int i=1,j=1;
  int tmp1=h_bit,tmp2=w_bit;
  while(h_bit!=0){
    if(h_bit&1) res += h[i] ;
    h_bit = h_bit >> 1;
    i++;
  }
  i=1;
  while(w_bit!=0){
    if(w_bit&1) res += w[i];
    w_bit = w_bit >> 1;
    i++;
  }
  
  i=1;
  j=1;
  int a=tmp2;
  while(tmp1!=0){
    j=1;
    tmp2 = a;
    if(tmp1&1){
      while(tmp2!=0){
        if(tmp2&1 && grid[i][j]=='#') res--;
      	tmp2 = tmp2 >> 1;
      	j++;
      }
    }
    tmp1 = tmp1 >> 1;
    i++;
  }
  return res;
}

int main(){
  cin >> H >> W >> K;
  rep(i,1,H){
    rep(j,1,W){
      cin >> grid[i][j];
      if(grid[i][j]=='#') num_black++;
    }
  }
  
  int tmp;
  rep(i,1,H){
    tmp=0;
    rep(j,1,W){
      if(grid[i][j]=='#') tmp++;
    }
    h[i]=tmp;
  }
  
  rep(i,1,W){
    tmp=0;
    rep(j,1,H){
      if(grid[j][i]=='#') tmp++;
    }
    w[i]=tmp;
    //cout << w[i] << '\n';
  }
  
  int res=0;
  int kosuu;
  for(int h_bit=0;h_bit<(1<<H);h_bit++){
    for(int w_bit=0;w_bit<(1<<W);w_bit++){
      kosuu = count(h_bit,w_bit);
      if((num_black-kosuu)==K){
        //cout << h_bit << ' ' << w_bit << '\n';
        res++;
      }
    }
  }
  
  cout << res;
  
  return 0;
}

Measured memory_bytes: 3632
si = lambda: input()
ni = lambda: int(input())
nm = lambda: map(int, input().split())
snm = lambda: map(str, input().split())
nl = lambda: list(map(int, input().split()))
n=ni()
l=[]
d=set()
for i in range(n):
    s,p=snm()
    d.add(s)
    l.append([s,int(p),i+1])
l.sort(key=lambda x:(x[0]))
d=list(d)
d.sort()

len_d=len(d)
a=[[] for i in range(len_d)]

for i in range(n):
    for j in range(len_d):
        if d[j]==l[i][0]:
            a[j].append(l[i])

for aa in a:
    aa.sort(key=lambda x:x[1],reverse=True)

for aa in a:
    for aaa in aa:
        print(aaa[2])

Measured memory_bytes: 3064
#include <bits/stdc++.h>
#define rep(i, n) for (ll i = 0; i < (n); i++)
using namespace std;
using ll = long long;
const ll INF = 1LL << 60;
const ll mod = 1e9 + 7;

ll powmod(ll x, ll y) {
  ll res = 1;
  for (ll i = 0; i < y; i++) res = res * x % mod;
  return res;
}

int main(void) {
  int n;
  cin >> n;
  ll ans = 0;
  ans = powmod(10, n) - powmod(9, n) - powmod(9, n) + powmod(8, n);
  ans %= mod;
  ans = (ans + mod) % mod;
  cout << ans << '\n';
  return 0;
}

Measured memory_bytes: 3580
import java.util.*;

public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int N = sc.nextInt();
        int max = 0;
        int sum = 0;
        for(int i = 0;i < N;i++){
            int pi = sc.nextInt();
            max = Math.max(max, pi);
            sum += pi;
        }
        sum -= max/2;
        System.out.println(sum);
    }
}

Measured memory_bytes: 23124
N = int(input())
b = list(map(int,input().split()))

ans = []
for i in range(N):
    for j in range(len(b)-1,-1,-1):
        if b[j]==(j+1):
            ans += [b[j]]
            del b[j]
            break
if len(b)!=0:
    print(-1)
    exit()

for i in range(N):
    print(ans[N-1-i])

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

#define rep(i,n) for (int i =0;i<(n);i++)
#define LL long long 

using namespace std;

int main(){
    int a,b,x;
    int ans=0;
    cin >>a>>b>>x;
    int A=min(a,2*b),B=min(a,b);
    while(x>0){
        if(x-500<=0){
            ans+=B;
            x-=500;
        }
        else{
            ans+=A;
            x-=1000;
        }
    }
    cout <<ans<<endl;
    return 0;
}



Measured memory_bytes: 3116
#include <iostream>
#include <string>
#include <sstream>
#include <utility>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <unordered_set>
#include <unordered_map>
#include <queue>
#include <cmath>
#include <functional>
#include <chrono>
#include <cstring>
#include <limits.h>

using namespace std;
typedef long long lint;
typedef vector<int> vi;
typedef pair<int,int> pii;
typedef vector<lint> vl;
typedef pair<lint,lint> pll;

#define mpr make_pair


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

    lint x; cin>>x;
    lint day = 0;
    lint cur = 100;
    while(cur < x){
        lint curp = cur/100;
        lint mnext = cur/100*100 + 100;
        lint rn = cur + (mnext - cur)/curp * curp + ((mnext - cur)%curp?curp:0);

        if ((rn-cur)%curp ) throw -1;

        if (rn >= x){
            day += (x-cur)/curp + ((x-cur)%curp?1:0);
            break;
        }
        day += (rn-cur)/curp;
        cur = rn;
    }
    cout<<day;
}


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

#define dump(x) cout << (x) << '\n'
#define Int int64_t
#define fi first
#define se second
#define all(x) (x).begin(), (x).end()

Int INF = 1e18;
Int mod = 1e9+7;
//Int mod = 998244353;

int main() {
    Int n;
    cin >> n;
    map<Int, Int> mp;
    bool check = true;
    for (Int i = 0; i < n; i++) {
        Int a;
        cin >> a;
        mp[a]++;
        if (mp[a] > 1) {
            check = false;
        }
    }
    dump(check ? "YES" : "NO");
    return 0;
}


Measured memory_bytes: 12800
// ------------------------------------
// Date:2018/ 2/25
// Problem:ABC 050 AdditionAndSubtractionEasy a.cpp
//
// ------------------------------------

#include <bits/stdc++.h>

using namespace std;

#define EACH(i,a) for (auto&& i : a)
#define FOR(i,a,b) for(int i=(int)a;i<(int)b;++i)
#define RFOR(i,a,b) for(int i=(int)b-1;i>=(int)a;--i)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define ALL(a) (a).begin(),(a).end()
#define debug(x) cerr << #x << ":" << x << endl

using ll = long long;

#define MOD 1000000007

int main()
{
  int A,B;
  char op;
  cin >> A >> op >> B;
  if (op == '+') cout << A+B << endl;
  else cout << A-B << endl;
  return 0;
}



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

using namespace std;
using int64 = long long;

constexpr int DEBUG = 0;

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

  int64 h, w;
  int n;
  cin >> h >> w >> n;

  map<tuple<int, int>, int> m;
  for (int i = 0; i < n; i++) {
    int r, c;
    cin >> r >> c;
    r--;
    c--;
    for (int dy = -1; dy <= 1; dy++) {
      for (int dx = -1; dx <= 1; dx++) {
        int nr = r + dy;
        int nc = c + dx;
        if (nr < 1 || h - 1 <= nr) continue;
        if (nc <1  || w - 1 <= nc) continue;
        m[make_tuple(nr, nc)]++;
      }
    }
  }

  vector<int64> rs(10);
  rs[0] = (h - 2) * (w - 2);
  for (const auto& kv : m) {
    // cout << get<0>(kv.first) << " " << get<1>(kv.first) << " " << kv.second << endl;
    rs[kv.second]++;
    rs[0]--;
  }

  for (int i = 0; i <= 9; i++) {
    cout << rs[i] << endl;
  }
}

Measured memory_bytes: 56576
#include<stdio.h>
#include<math.h>
int a[10][10],d;
double calculation(int i,int j)
{
    int k;
    double result=0;
    for(k=0; k<d; k++)
        result+=((a[i][k]-a[j][k])*(a[i][k]-a[j][k]));
    result=sqrt(result);
    return result;
}
int main()
{
    int n,i,j,c=0;
    double ans;
    scanf("%d%d",&n,&d);
    for(i=0; i<n; i++)
        for(j=0; j<d; j++)
            scanf("%d",&a[i][j]);
    for(i=0; i<n-1; i++)
    {
        for(j=i+1; j<n; j++)
        {
            ans=calculation(i,j);
            if(ans==(int)ans)
                c++;
        }
    }
    printf("%d\n",c);
    return 0;
}


Measured memory_bytes: 128
#include<cstdio>
#include<map>
#include<queue>
#include<vector>
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
const int Maxn=1e5;
const int INF=0x3f3f3f3f;
struct Edge 
{
    int to,cost;
    Edge(int a,int b){to=a,cost=b;}
};
vector<Edge>way[6*Maxn+5];
void AddEdge(int u,int v,int w) 
{
    way[u].push_back(Edge(v,w));
    way[v].push_back(Edge(u,w));
}
int dis[8*Maxn+5];
int vis[8*Maxn+5];
void spfa(int s) 
{
    memset(dis,0x3f,sizeof dis);
    memset(vis,0,sizeof vis);
    queue<int> q;

    q.push(s);
    vis[s]=1,dis[s]=0;

    while(!q.empty()) 
	{
        int u=q.front();
        q.pop();vis[u]=0;

        for(int i=0;i<way[u].size();i++) 
		{
            int v=way[u][i].to,w=way[u][i].cost;
            if(dis[v]>dis[u]+w) 
			{
                dis[v]=dis[u]+w;
                if(!vis[v]) 
				{
                    vis[v]=1;
                    q.push(v);
                }
            }
        }
    }
}

map<pair<int,int>,int>pos;
int cnt;
int Getid(int u,int c) 
{
    if(pos.find(make_pair(u,c))!=pos.end())
        return pos[make_pair(u,c)];
    return pos[make_pair(u,c)]=++cnt;
}
int t1,t2;
int N,M;
int u,v,c;
int main() 
{
    scanf("%d%d",&N,&M);
    cnt=N;
    for(int i=1;i<=M;i++) 
	{
        scanf("%d%d%d",&u,&v,&c);
        t1=Getid(u,c);
		t2=Getid(v,c);
        AddEdge(t1,t2,0);
        AddEdge(u,t1,1);
        AddEdge(v,t2,1);
    }
    spfa(1);
    if(dis[N]==INF)puts("-1");
    else printf("%d\n",dis[N]/2);
}


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

Measured memory_bytes: 256
#![allow(non_snake_case,unused_imports,dead_code)]
use std::io::Read;
use std::cmp::max;
use std::cmp::min;
use std::str::FromStr;
use std::collections::HashMap;
use std::collections::HashSet;
use std::collections::BinaryHeap;
use std::cmp::Ordering;

fn comp_f64(a: &f64, b: &f64) -> Ordering {
    if a < b {
        return Ordering::Less;
    } else if a > b {
        return Ordering::Greater;
    }
    Ordering::Equal
}

fn main() {

    let mut buf = String::new();
    std::io::stdin().read_to_string(&mut buf).unwrap();
    let mut buf_it = buf.split_whitespace();


    let H = buf_it.next().unwrap().parse::<usize>().unwrap();
    let W = buf_it.next().unwrap().parse::<usize>().unwrap();
    let K = buf_it.next().unwrap().parse::<isize>().unwrap();
    
    let x1 = buf_it.next().unwrap().parse::<usize>().unwrap()-1;
    let y1 = buf_it.next().unwrap().parse::<usize>().unwrap()-1;
    let x2 = buf_it.next().unwrap().parse::<usize>().unwrap()-1;
    let y2 = buf_it.next().unwrap().parse::<usize>().unwrap()-1;

    let C = (0..H).map(|_| buf_it.next().unwrap().chars().collect::<Vec<_>>()).collect::<Vec<_>>();

    let mut d2 = (0..H).map(|_| (0..W).map(|_| -1).collect::<Vec<_>>()).collect::<Vec<_>>();
    let mut hq = BinaryHeap::new();
    hq.push((0,x2,y2));
    d2[x2][y2] = 0;

    while !(hq.is_empty()){
        let (d0,x,y) = hq.pop().unwrap();
        for (dx,dy) in vec![(1,0),(-1,0),(0,1),(0,-1)]{
                let x = x as isize +dx;
                let y = y as isize +dy;
                if x<0 || x>=H as isize || y<0 || y>=W as isize {continue;}
                let x = x as usize;
                let y = y as usize;
                if C[x][y] == '@' { continue;}
                if d2[x][y] != -1 { continue;}
                d2[x][y] = -d0+1;
                hq.push((d0-1,x,y));
        }
    }

    if d2[x1][y1] == -1{
        println!("-1");
        return;
    }

    let mut d = (0..H).map(|_| (0..W).map(|_| -1).collect::<Vec<_>>()).collect::<Vec<_>>();
    let mut hq = BinaryHeap::new();
    hq.push((0,-d2[x1][y1],x1,y1));
    d[x1][y1] = 0;

    while !(hq.is_empty()){
        let (d0,_,x,y) = hq.pop().unwrap();
        d[x][y] = -d0;
        for (dx,dy) in vec![(1,0),(-1,0),(0,1),(0,-1)]{
            for k in 1..K+1{
                let x = x as isize +dx*k;
                let y = y as isize +dy*k;
                if x<0 || x>=H as isize || y<0 || y>=W as isize {break;}
                let x = x as usize;
                let y = y as usize;
                if C[x][y] == '@' { break;}
                if d[x][y] <= -d0 && d[x][y] >= 0 { break;}
                if d[x][y] != -1 { continue;}
                d[x][y] = -d0+1;
                hq.push((d0-1,-d2[x][y],x,y));
            }
        }
        if d[x2][y2] != -1{ break;}
    }
    println!("{}",d[x2][y2]);
}


Measured memory_bytes: 17500
#include <bits/stdc++.h>
#define FOR(i,a,b) for (int i = (a); i < (b); ++i)
#define rep(i,n) for (int i = (0); i < (n); ++i)
#define rng(x) (x).begin(),(x).end()
#define rrng(x) (x).rbegin(),(x).rend()
#define show(x) cout << #x << " = " << (x) << endl;
#define show2(x,y) cout << #x << " = " << (x) << ", " << #y << " = " << (y) << endl;
#define fi first
#define se second
#define pb push_back
#define eb emplace_back
#define sz(x) (int)(x).size()
#define bn(x) ((1<<x)-1)
#define dup(x,y) (((x)+(y)-1)/(y))
#define uni(x) x.erase(unique(rng(x)),x.end())
#define SP << " " <<
using namespace std;
using ll = long long;
using vi = vector<int>;
using vvi = vector<vi>;
using vll = vector<ll>;
using pii = pair<int, int>;
using tiii = tuple<int, int, int>;
const int mod = 1000000007;
const double EPS = 1e-9;
const int INF = 1<<30;
const ll INFLL = 1LL<<60;
//cout << fixed << setprecision(10);

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

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

int main () {
  int a, b;
  cin >> a >> b;
  cout << lcm(a,b) << endl;
  return 0;
}

Measured memory_bytes: 256
import java.util.*;

public class Main {
  public static void main(String args[]) {
    Scanner sc = new Scanner(System.in);
    int S = sc.nextInt();
    int ans;
    if(S % 2 ==0) {
      ans = S / 2;
    } else {
      ans = S /2 + 1;
    }
    System.out.println(ans);
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
#define FOR(i,o,n) for(long long i = o;i<n;i++)
#define oneforall ios::sync_with_stdio(false);cin.tie(0);
#define all(v) (v).begin(),(v).end()
#define ini(...) int __VA_ARGS__; in(__VA_ARGS__)
#define inl(...) long long __VA_ARGS__; in(__VA_ARGS__)
#define ins(...) string __VA_ARGS__; in(__VA_ARGS__)
#define int long long 
const long long inf=1e18;
void in(){} template <typename T,class... U> void in(T &t,U &...u){ cin >> t; in(u...);}
void out(){cout << "\n";} template <typename T,class... U> void out(const T &t,const U &...u){ cout << t; if(sizeof...(u)) cout << " "; out(u...);}
typedef vector<int> vi;
typedef vector<long long> vl;
typedef long long ll;
typedef vector<pair<long, long > > vpll;
typedef vector<pair<int, int > > vpii;
#define FORR(x,arr) for(auto& x:arr)
#define ZERO(a) memset(a,0,sizeof(a))





//3111111111111111111111111111111
	

	void solve(){
		
		
		int x[3];
		FOR(i,0,3)in(x[i]);
		ini(x1);
		while(x[1]<=x[0]){
			if(x1==0){
				return out("No");
			}
			else{
				x[1]*=2;
				x1--;
			}
		}
		while(x[2]<=x[1]){
			if(x1==0){
				return out("No");
			}
			else{
				x[2]*=2;
				x1--;
			}
		}
		return out("Yes");
		

		
		


			
			
			


				
		


		
		
		
		

		


		
		
	}



	



















int32_t main() {
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall
	oneforall 
	oneforall

	solve();
	


	return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h>
#include <typeinfo>
#include <cxxabi.h>
#ifdef LOCAL
#include "dbgtoki.hpp"
#define DUMP(i) dump((string)TOSTRING(i), demangle(typeid(i).name()), __LINE__ , i) 
#else
#define DUMP(i)
#endif

using namespace std;
#define TOSTRING(x) #x
#define SZ(x) (int)(x).size()
#define REP(i,n) for(int i=0;i<(n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define ALL(s) (s).begin(), (s).end()
#define dis distance
#define so(V) sort(ALL(V))
#define rev(V) reverse(ALL(V))
#define uni(v) v.erase( unique(ALL(v)) , v.end());
#define pub push_back
#define sec second
#define fir first

typedef long long unsigned int llu;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<vector <int> > vvi;
const int EPS = 1e-9;
const int MOD = 1e9+7;
const int INF = (1 << 30);
const double PI = acos(-1);

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	int n;
	cin >> n;
	string s[n];
	REP(i,n)cin >> s[i];
	vector<char> Ans;
	REP(i,SZ(s[0])){
		char cs0 = s[0][i];
		bool b = true;
		FOR(j,1,n){
			if(find(ALL(s[j]),cs0) == s[j].end()){
				b = false;
				break;
			}
		}
		if(b){
			DUMP(cs0);
			Ans.pub(cs0);
			FOR(j,1,n){
				auto pos = find(ALL(s[j]),cs0);
				*pos = '-';
			}
		}
	}
	REP(i,n){
		DUMP(i);
		DUMP(s[i]);
	}
	so(Ans);
	DUMP(Ans);
	REP(i,SZ(Ans)){
		cout << Ans[i];
	}
	cout << endl;
	return 0;
}

Measured memory_bytes: 256
var
  ans, i, j, k, a, b, c, x: integer;
begin
  readln(a);
  readln(b);
  readln(c);
  readln(x);
  for i := 0 to a do
  begin
    for j := 0 to b do
    begin
      for k := 0 to c do
      begin
        if i * 500 + j * 100 + k * 50 = x then
          ans := ans + 1;
      end;
    end;
  end;
  writeln(ans);
end.

Measured memory_bytes: 128
#include <iostream>
#include <algorithm>
#include <iomanip>
#include <vector>
#include <queue>
#include <set>
#include <map>

using namespace std;
typedef long long ll;
typedef pair<int, int> P;

class SuffixArray{
    public:
        vector<int> rank;
        vector<int> sa;
        vector<int> lcp;
        string S;
        int n;
        SuffixArray(string _S){
            S = _S;
            n = _S.size();
            rank = vector<int>(n+1);
        }
        void construct_sa(){
            sa = vector<int>(n+1);
            vector<int> buf(n+1);
            for(int i = 0; i <= n; i++){
                sa[i] = i;
                rank[i] = i < n ? S[i] : -1;
            }

            for(int k = 1; k <= n; k *= 2){
                sort(sa.begin(), sa.end(), [&, k](int i, int j){
                    return compare_sa(i, j, k);
                });

                buf[sa[0]] = 0;
                for(int i = 1; i <= n; i++){
                    buf[sa[i]] = buf[sa[i-1]] + (compare_sa(sa[i-1], sa[i], k) ? 1 : 0);
                }
                for(int i = 0; i <= n; i++) rank[i] = buf[i];
            }
        }

        // sa is initlally constructed
        void construct_lcp(){
            lcp = vector<int>(n+1);

            int h = 0;
            lcp[0] = 0;
            for(int i = 0; i < n; i++){
                int j = sa[rank[i]-1];

                if(h > 0) h--;
                while(j+h < n && i+h < n){
                    if(S[i+h] != S[j+h]) break;
                    h++;
                }
                lcp[rank[i]-1] = h;
            }
        }
        
        void construct_both(){
            construct_sa();
            construct_lcp();
        }
    private:
        // (rank[i], rank[i+k]) vs (rank[j], rank[j+k])
        bool compare_sa(int i, int j, int k){
            if(rank[i] != rank[j]) return rank[i] < rank[j];
            else{
                int ri = i+k <= n ? rank[i+k] : -1;
                int rj = j+k <= n ? rank[j+k] : -1;
                return ri < rj;
            }
        }
};

int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    cout << setprecision(10) << fixed;
    string T; cin >> T;
    SuffixArray sa(T);
    sa.construct_both();
    int ans = 0;
    vector<P> p;
    for(int i = 1; i <= T.size(); i++){
        if(sa.lcp[i]+sa.sa[i] < T.size()) p.push_back(P(sa.sa[i], sa.lcp[i]));
    }
    sort(p.begin(), p.end(), greater<P>());
    for(P i : p){
        int sa = i.first, lcp = i.second;
        if(sa+lcp+ans < T.size()){
            ans++;
        }
    }
    cout << ans << endl;
}

Measured memory_bytes: 6328
// inputに入力データ全体が入る
function Main(input) {
    "use strict";
    // 1行目がinput[0], 2行目がinput[1], …に入る
    const tmp = input.split("\n");
    const a = tmp[0].split(" ");
    const toInt = function (n, array) {
        let result = [];
        for (let i = 0; i < n; i++) {
            result[i] = parseInt(array[i]);
        }
        return result;
    };
    const intA = toInt(a.length, a);
    const sumA = intA.reduce((accumulator, currentValue) => accumulator + currentValue);
    let result;
    if (sumA >= 22) {
        result = "bust";
    } else {
        result = "win";
    }

    console.log(result);
}
//*この行以降は編集しないでください（標準入出力から一度に読み込み、Mainを呼び出します）
Main(require("fs").readFileSync("/dev/stdin", "utf8"));


Measured memory_bytes: 7372
#include <bits/stdc++.h>
#include <cmath>
#include <numeric>
using namespace std;
#define rep(i,a,b) for(int64_t i=(a); i<(b); ++i) // a ≦ i < b 
#define Rrep(i,a,b) for(int64_t i=(a);i>=(b);--i) // reverse repeat. a から b まで減少．
#define ALL(a) (a).begin(),(a).end()
#define RALL(a) (a).rbegin(), (a).rend() //逆イテレータ
#define RANGE(a,b,c) (a).begin()+(b),(a).begin()+(c) // [b,c) イテレータ
#define MOD 1000000007
#define INF 1000000000
typedef pair<int64_t, int64_t> PII;
typedef vector<int64_t> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef vector<PII> VP;

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

int N; cin >> N;
map<int, int> cnt;
rep(i, 0, N) {
    int a; cin >> a;
    ++cnt[a];
}
int c = 0;
for (PII p : cnt){
    if (p.first < p.second) c += p.second - p.first;
    else if (p.first > p.second) c += p.second;
}

cout << c << endl;

}
// 書いて考える
// 境界，出力文字列 チェック
// 可読性優先．高速化次点．
// まずは全探索，分割統治，次にDP
// 制限を見る．境界に注意．求めたい量の変域．
// 偶奇，逆から，ソート，出現回数，出現位置，DP， 余事象，包除
// データ構造． 問題の特徴量．単調性，二分探索
// 存在判定：構成方法，入力の特徴
// gcd, lcm ,素因数分解．
// 例外を十分に含む一般化．想像力の限界
// 小さい系から例示
// 代数的処理
// 始めは過剰に例示・場合分けしてもいい．各場合を確実に対処．
// 自明な例から処理，除外．
// 小数のときは，精度の設定する．doubel 変数に数値を入力するときは 123. とする．
// テストケース作成は数表あり



Measured memory_bytes: 4736
n = int(input())
a,w,t,r = 0,0,0,0
for i in range(n):
    s = input()
    if s == "AC":
        a += 1
    elif s == "WA":
        w += 1
    elif s == "TLE":
        t += 1
    else:
        r += 1
print("AC x", a)
print("WA x", w)
print("TLE x", t)
print("RE x", r)

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

public class Main {

	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		int n = in.nextInt();
		Integer[] len = new Integer[n];
		for ( int i = 0; i < n; i++ ) {
			len[i] = in.nextInt();
		}
		Arrays.sort(len);

		int cnt = 0;
		for ( int e1 = 0; e1 < n - 2; e1++ ) {
			for ( int e2 = e1 + 1; e2 < n - 1; e2++ ) {

				int d = len[e1] + len[e2];
				// x, yを比べて等しい時、x>yとみなすコンパレータ：LowerBoundを取りたい
				int i = Arrays.binarySearch(len, d, (x, y) -> x.compareTo(y) >= 0 ? 1 : -1);
				i = i >= 0 ? i : ~i;

				cnt += Math.max(i - e2 - 1, 0);
				// System.out.println("e1:" + len[e1] + " e2:" + len[e2] + "  i:" + i + " cnt:" + cnt);
			}
		}
		System.out.println(cnt);
		in.close();
	}
}

Measured memory_bytes: 47760
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<stdio.h>
#include<map>
#define rep(i,n) for(int i=0;i<(n);i++)
#define ll long long
#define sort(s) sort(s.begin(),s.end())
#define r(s) reverse(s.begin(),s.end())
#define come return
constexpr auto AC = 0;
using namespace std;
int aa(int a) {
	for (int i = 2;; i++) {
		if (a % i != 0)return i;
	}
}

int main() {
	int a, b, c;
	cin >> a >> b >> c;
	int s = aa(c);
	vector<int> t(a, s);
    rep(i, b)t[i] = c;
	rep(i,a){
		cout << t[i];
		if (i == a - 1)cout << endl;
		else cout << " ";
	}
	come AC;
}

Measured memory_bytes: 1664
#include <bits/stdc++.h>
#include <cstdlib>  // abs() for integer 絶対値求めやつ
#include <cmath>    // abs() for float, and fabs()
#include <algorithm>
#include <vector>
#include <string>
#include<iomanip>//浮動小数点数を出力する制度の指定
//使い方　数値をnumとして　cout<<setprecision(n)<<num ;nは桁数
#define rep(i,n) for(int i = 0; i < (n);i++)
#define SORT(a) sort((a).begin(),(a).end())
#define REV(a) reverse((a).begin(),(a).end())
using namespace std;
using ll =long long;
#define INF 2000000000
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
#define che(a,string) cout<<"//"<<string <<"=="<<(a)<<"//" <<endl;
bool IsInt(double a){int b = a/1;if(a==b){return true;}else {return false;}}
/*覚えてないことメa
  数値型から文字列に変換　to_string(number);これは簡単
  文字列から数値型に変換　stoi(number)
  文字列からllに変換　stoll(number)*/

//ここから書き始める
int main(){
	ll n, q; 
	cin >> n >> q; 
	string s; cin >> s;
//	vector<vector<ll>> sec(q,vector<ll>(q));
//	rep(i,q) {
//		ll L , R;
//		cin >> L >> R;
//		sec[i][0] = L - 1;
//		sec[i][1]= R - 1;
//	}
	//AC
	vector<ll> A(n);
	ll count = 0;
	A[0]=0;
	for(int i = 1; i < n; i++){
		if(s[i-1]=='A'&&s[i]=='C'){
			count++;
		}
		A[i]=count;
	}
	ll ans=0;
	ll L,R;
	for(int i = 0 ; i <  q; i ++){
		cin >> L >> R;
		ans = A[R-1] - A[L-1];
		cout<<ans<<endl;
	}

}



Measured memory_bytes: 1792
#include <bits/stdc++.h>
#define ll long long
#define endl "\n"
#define the_flash ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)
#define input_output freopen("input.txt", "r", stdin); freopen("output.txt", "w", stdout)

using namespace std;

int main()
{
	//input_output;
	the_flash;
	int t;
	cin >> t;
	map<string, int> freq;
	int max = 0;

	for (int i = 0; i < t; i++)
	{
		string s;
		cin >> s;
		freq[s]++;

		if (freq[s] > max)
			max = freq[s];
	}

	for (auto i = freq.begin(); i != freq.end(); i++)
	{
		if (i -> second == max)
			cout << i -> first  << endl;
	}
	return 0;
}

Measured memory_bytes: 19228
K, N = map(int,input().split())
A_li = list(map(int,input().split()))

# 距離間リスト
d_li = []
for i in range(N-1):
	d_li.append(A_li[i+1]-A_li[i])

d_li.append(K+A_li[0] - A_li[N-1])


allsum = sum(d_li)
ans = allsum
for d in d_li:
	ans = min(ans,allsum-d)

print(ans)

Measured memory_bytes: 26436
#include <algorithm>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <functional>
#include <iostream>
#include <map>
#include <memory>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

using namespace std;

typedef long long ll;

#define sz size()
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define all(c) (c).begin(), (c).end()
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define per(i,a,b) for(ll i=(b-1);i>=(a);--i)
#define clr(a, b) memset((a), (b) ,sizeof(a))
#define ctos(c) string(1,c)
#define print(x) cout<<#x<<" = "<<x<<endl;

#define MOD 1000000007

ll a, b, c, d, e, f, g;

ll f1(ll p){
  ll a1 = a-p;
  ll d1 = d-p;
  ll e1 = e-p;
  ll ret = 0;
  ret += (a1/2)*2;
  ret += (d1/2)*2;
  ret += (e1/2)*2;
  return ret + p*3;
}

int main() {
  cin >> a >> b >> c >> d >> e >> f >> g;
  ll mx = min(a,min(d,e));
  ll ans = 0;
  ans += b;
  long long left = 0;
  long long right = mx;
  while (left != right) {
    long long d1 = (right - left) / 3;
    long long l = f1(left + d1);
    long long r = f1(right - d1);
    if (d1 == 0) {
      if (l < r)left++;
      else right--;
    }
    else {
      if (l < r)left = left + d1;
      else right = right - d1;
    }
  }
  ans += f1(left);
  printf("%lld\n", ans);
  return 0;
}

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

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

  if(400 <= X && X < 600) cout << 8 << endl;
  else if(600 <= X && X < 800) cout << 7 << endl;
  else if(800 <= X && X < 1000) cout << 6 << endl;
  else if(1000 <= X && X < 1200) cout << 5 << endl;
  else if(1200 <= X && X < 1400) cout << 4 << endl;
  else if(1400 <= X && X < 1600) cout << 3 << endl;
  else if(16 <= X && X < 1800) cout << 2 << endl;
  else if(1800 <= X && X < 2000) cout << 1 << endl;
  



}


Measured memory_bytes: 3632
import java.util.Scanner;

class Main {

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

        String a = sc.next();
        String b = sc.next();
        String c = sc.next();

        a = a.toUpperCase();
        b = b.toUpperCase();
        c = c.toUpperCase();

        System.out.print(a.charAt(0));
        System.out.print(b.charAt(0));
        System.out.println(c.charAt(0));
    }
}

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

using namespace std; 

typedef vector<int> VI;
typedef vector<VI> VVI;
typedef vector<string> VS;
typedef pair<int, int> PII;
typedef vector<PII> VPII;
typedef long long LL;
typedef priority_queue<int> PQ_DESC;
typedef priority_queue<int, vector<int>, greater<int>> PQ_ASC;
typedef priority_queue<PII> PQ_DESC_PII;
typedef priority_queue<PII, vector<PII>, greater<PII>> PQ_ASC_PII;

#define ALL(c) (c).begin(),(c).end()
#define PB push_back
#define MP make_pair
#define SORT_ASC(c) sort(ALL(c))
#define SORT_DESC(c) sort(ALL(c), greater<typeof(*((c).begin()))>())
#define SIZE(a) int((a).size())

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

const double EPS = 1e-10;
const double PI  = acos(-1.0);
const int LARGE_INT = 1e9+100;
const int INF = 2e9+100;
const LL INF_LL = (LL)INF * 300 * 300;

//debug
#define dump(x)  cerr << #x << " = " << (x) << endl;
#define debug(x) cerr << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl;

void Main()
{
	int n;
	string s;
	cin >> n;
	cin >> s;

	if(n%2 != 0){
		cout << "No" << endl;
		return;
	}

	REP(i,n/2){
		if(s[i] != s[i+n/2]){
			cout << "No" << endl;
			return;
		}
	}
	cout << "Yes" << endl;

	return;
}

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

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main(){
  int n; cin>>n;
  vector<int> a(n);
  int ans=0;
  for(int i=0; i<n; i++){
    cin>>a.at(i);
    ans+=a.at(i)-1;
  }
  cout<<ans<<endl;
}

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

void sort(int* v, int l) {
	for (int i = 1; i < l; i++) {
		for (int j = 0; j < l - 1; j++) {
			if (v[j] < v[j + 1]) {
				int tmp = v[j];
				v[j] = v[j + 1];
				v[j + 1] = tmp;
			}
		}
	}
	return;
}

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

int main() {
	int N, K;
	scanf("%d %d", &N, &K);
	int *h = new int[N];
	for (int i = 0; i < N; i++) {
		scanf("%d", &h[i]);
	}
	//sort(h, N);
	qsort(h, N, sizeof(int), compare_int);

	int output = h[0] - h[K - 1];
	for (int i = 1; i < N - K + 1; i++) {
		int tmp = h[i] - h[i + K - 1];
		if (tmp < output)output = tmp;
	}
	printf("%d\n", output);
	return 0;
}


Measured memory_bytes: 1020
#include <iostream>
#include <cstdio>
#include <string>
#include <algorithm>
#include <utility>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
#include <numeric>
#include <functional>
using namespace std;
typedef long long ll;
typedef vector<ll> vl;
typedef vector<vector<ll>> vvl;
typedef pair<ll, ll> P;
#define rep(i, n) for(ll i = 0; i < n; i++)
#define exrep(i, a, b) for(ll i = a; i <= b; i++)
#define out(x) cout << x << endl
#define exout(x) printf("%.10f\n", x)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define pb push_back
#define re0 return 0
const ll mod = 1000000007;
const ll INF = 1e16;
const double pi = acos(-1);

ll gcd(ll x, ll y) {
    if(y == 0) {
        return x;
    }
    return gcd(y, x%y);
}

ll lcm(ll x, ll y) {
    return x/gcd(x, y)*y;
}

int main() {
    ll x;
    cin >> x;
    out(lcm(x, 360)/x);
    re0;
}

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

using namespace std;

typedef long long ll;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;

#define endl "\n"

const ll INF = 1e15;
const int MOD = 1e9 + 7;
const double EPS = 1e-9;
const double PI = acos(-1.0);

const int N = 1e5 + 5;

ll n, fact[N];

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

    cin >> n;
    
    ll ans = 1;
    for (int i = 1; i <= n; ++i) 
        ans = (ans * i) % MOD;

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std; 
#define deb(x) cout << #x <<"="<< x <<endl;
#define deb2(x,y) cout << #x <<"="<<x<<", "<<#y<<"="<<y <<endl;
#define deb3(x,y,z) cout << #x <<"="<<x<<", "<<#y<<"="<<y <<", "<<#z<<"="<<z<<endl;
#define deb4(x,y,z,a) cout << #x <<"="<<x<<", "<<#y<<"="<<y <<", "<<#z<<"="<<z<< ", "<<#a <<"="<<a << endl;
#define debarr(x) cout << #x<<"::"<<endl;for(int i : x){cout << i <<" ";} cout <<endl;
#define rep(i,n) for(int i=0;i<(n);i++)
#define fr(i,a,b) for(int i=(a);i<(b);i++)
#define frd(i,a,b) for(int i=(a);i>=(b);i--)
#define vi vector<int>
#define int long long
#define pii pair<int,int>
#define mp make_pair
#define pb push_back
#define all(x) x.begin(),x.end()
#define endl '\n'
#define fi first
#define se second
#define fill(a,x) memset(a,x,sizeof a);
#define trav(a,x) for(auto &a:x)

#define print(a) for(auto x:a)cout<<x<<" ";cout<<endl;
#define print2(a) for(auto x:a){for(auto y:x)cout<<y<<" ";cout<<endl;}; 



void solve(){
	string s , t;
	cin >> s >> t;
	int n = s.length();
	cout << (t.substr(0,n) == s ? "Yes" : "No") << endl;



}





signed main(){
    cin.tie(NULL),ios_base::sync_with_stdio(false),cout.tie(NULL);
    int t=1;
    
    while(t--)solve();
    return 0;
}



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

int main() {
    string s; cin >> s;
    int n = s.size();
    
    long long ans = 1 + 1LL * n * (n + 1) / 2;
    
    vector<int> f(26, 0);

    for(int i = 0; i < n; ++i) {
        f[s[i] - 'a'] += 1;
        ans -= f[s[i] - 'a'];
    }

    cout << ans << "\n";
}

Measured memory_bytes: 640
#include <iostream>
#include <vector>
#include <algorithm>
#include <set>
#include <map>
#include <deque>
#include <queue>
#include <string>
#include <string.h>
#include <math.h>
#include <iomanip>
using namespace std;

#define int64 long long
#define pii pair <int64, int64>
#define fr first
#define sc second
#define heap priority_queue
struct piii{
    int64 fr, sc, th;
    bool operator < (const piii &b){
        if (fr != b.fr) return fr < b.fr;
        if (sc != b.sc) return sc < b.sc;
        return th < b.th;
    }
};
///////////////////////////////////////////////
///////////////////////////////////////////////

int main(){
    cout << setprecision(2) << fixed;
    ios::sync_with_stdio(false), cin.tie(0);
    //freopen("input.txt", "r", stdin);
    int64 n;
    cin >> n;
    n--;
    cout << n * (n + 1) / 2;
    return 0;
}


Measured memory_bytes: 256
#include<iostream>

int my_gcd(int x, int y)
{
    if(x < y)
    {
        int temp = x;
        x =y;
        y =temp;
    }
    while(y > 0)
    {
        int r = x % y;
        x =y;
        y =r;
    }
    return x;
}
int main()
{
    int x, y;
    std::cin>>x>>y;
    std::cout<< my_gcd(x,y)<<std::endl;
}


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

int main() {
    cin.tie(0)->sync_with_stdio(false);

    int n, k;
    cin >> n >> k;

    bool ok = false;
    if (k == 1) ok = true;
    else if (n % 2) {
        if (n / 2 + 1 >= k) ok = true;
    } else {
        if (n / 2 >= k) ok = true;
    }

    if (ok) cout << "YES" << '\n';
    else cout << "NO" << '\n';
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <string>

using namespace std;

long long dp[55][55][3010];

int main()
{ 
    int n, a, x[50] = {};

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

    dp[0][0][0] = 1;
    for (int i = 0; i < n; i++) {
        for (int j = 0; j < n; j++) {
            for (int k = 0; k < 2500; k++) {
                if (dp[i][j][k]) {
                    dp[i + 1][j][k] += dp[i][j][k];
                    dp[i + 1][j + 1][k + x[i]] += dp[i][j][k];
                }
            }
        }
    }

    long long ans = 0;
    for (int i = 1; i <= n; i++) {
        ans += dp[n][i][a * i];
    }

    cout << ans << endl;

    return 0;
}


Measured memory_bytes: 65792
c = [[0 for j in range(0,3)] for i in range(0,3)]
flag = "Yes"
for i in range(0,3):
    a = list(map(int, input().split()))
    c[i] = a
x = [0 for j in range(0,3)]
y = [0 for j in range(0,3)]
for i in range(0,3):
    y[i] = c[i][0]
for i in range(1,3):
    x[i] = c[0][i]  - y[0]
for j in range(0,3):
    for i in range(0,3):
        if c[j][i] != x[i] + y[j]:
            flag = "No"
            break
print(flag)

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

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

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const ll INF = 1LL << 60;

const int MAX_N = 110;
const int MAX_V = 100100;

int dp[MAX_N][MAX_V]; //dp[i+1][v]:i番目の品物まで調べたときのvalueがvを超える条件下の重さの最小値(商品は0-index:0,1,2,...,n-1)

int main(){
  int n,W; cin >> n >> W;
  int weight[MAX_N], value[MAX_N];
  rep(i, n) cin >> weight[i] >> value[i];
  rep(i, MAX_N) rep(j, MAX_V) dp[i][j] = 1001001000;

  dp[0][0] = 0;
  //rep(i, 20) dp[0][i] = 0;
  for (int i = 0; i < n; i++) {
    for (int v = 0; v < MAX_V ; v++) {
      //とりあえずi番目の品物を選ばない場合の重さの最小値を入れておく
      dp[i+1][v] = dp[i][v];

      // if(i番目の品物を選んでvalueをv以上にできるようなテーブルが存在),
      if (v-value[i] >= 0) chmin(dp[i+1][v],dp[i][v-value[i]] + weight[i]);
      // その場合の重さと比較
      //printf("dp[%d][%d] = %d \n",i+1,v,dp[i+1][v] );
    }
  }
  int ans = 0;
  for (int v = 0; v < MAX_V; v++) {
    if(dp[n][v] <= W) ans = v;
  }
  std::cout << ans << '\n';
}


Measured memory_bytes: 43264
#include<iostream>
#include<iomanip>
#include<cmath>
double r(double x,int n){
  for(int i=0;i<n;i++) x *= 10;
  x = floor(x+0.5);
  for(int i=0;i<n;i++) x /= 10;
  return x;
}
using namespace std;
int main(){
  double a,b,c,d,e,f,x,y,dk;
  int n;
  while(cin>>a>>b>>c>>d>>e>>f){
    /*a *= d;
    b *= d;
    c *= d;//方程式にd倍
    dk = d;
    d *= (a/dk);
    e *= (a/dk);
    f *= (a/dk);//方程式にa倍
    y = (c-f)/(b-e);
    a /= d;
    b /= d;
    c /= d;//元の方程式
    d /= a;
    e /= a;
    f /= a;//元の方程式*/
    y = (c*d-a*f)/(b*d-a*e);
    x = (e*c-f*b)/(a*e-b*d);
    cout << fixed << setprecision(3) << r(x,3) << ' ' << r(y,4) << endl;
  }
  return 0;
}

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

typedef long long ll;

#define SIZE_OF_ARRAY(array) (sizeof(array) / sizeof(array[0]))
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define AA(i) cout << i << endl;
#define AS(i) cout << i << " ";

const int INF = 1000000007;
const double PI = 3.14159;

using namespace std;


vector<ll> enum_divisors(ll N)
{
    vector<ll> res;
    for (ll i = 1; i * i <= N; ++i)
    {
        if (N % i == 0)
        {
            res.push_back(i);
            // 重複しないならば i の相方である N/i も push
            if (N / i != i)
                res.push_back(N / i);
        }
    }
    // 小さい順に並び替える
    sort(res.begin(), res.end());
    return res;
}

vector<pair<ll, ll>> prime_factorize(ll N)
{
    vector<pair<ll, ll>> res;
    for (ll a = 2; a * a <= N; ++a)
    {
        if (N % a != 0)
            continue;
        ll ex = 0;

        while (N % a == 0)
        {
            ++ex;
            N /= a;
        }
        res.push_back({a, ex});
    }
    if (N != 1)
        res.push_back({N, 1});
    return res;
}

int main() {

    ll n;
    cin >> n;

    ll ans = 0;

    vector<ll> ed = enum_divisors(n);
    rep(i, ed.size()) {
        if (prime_factorize(ed[i]).size() == 1 && n % ed[i] == 0) {
            n /= ed[i];
            ans++;
        }
    }

    AA(ans);
}

Measured memory_bytes: 3684
N, a, b = map(int, input().split())

mod = 10 ** 9 + 7

n = max(a, b)
nfac = [1]
fac = [1]
caf = [1]


def pow(n, p):
    res = 1
    while p > 0:
        if p % 2 == 0:
            n = n ** 2 % mod
            p //= 2
        else:
            res = res * n % mod
            p -= 1
    return res % mod


for i in range(1, n + 1):
    nfac.append((nfac[i - 1] * (N + 1 - i)) % mod)
    fac.append((fac[i - 1] * i) % mod)
    caf.append(pow(fac[i], mod - 2))


def ncr(n, r):
    if n < r or r < 0:
        return 0
    return (nfac[r] * caf[r]) % mod


r1 = pow(2, N)
r2 = ncr(N, a)
r3 = ncr(N, b)
print((r1 - r2 - r3 - 1) % mod)



Measured memory_bytes: 72028
#include<iostream>

int i = 1 , x = 1 ;

int main()
{
	for(;x != 0 ; i++)
	{
		std::cin >> x ;
		if(x != 0)
		{
			std::cout << "Case " << i << ": " << x << std::endl ;
		}
	}
}

Measured memory_bytes: 1160
import sys

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    [X, Y] = string_to_int(inputs[0])
    count = 0
    num = X
    while num <= Y:
        num *= 2
        count += 1
    return str(count)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)


Measured memory_bytes: 3060
import java.util.*;

class Main {
	public static void main(String[] args) {
		Main m = new Main();
		m.ABC044_B();
	}
	void ABC044_B() {
		Scanner in = new Scanner(System.in);
		String str = in.next();
		int[] count = new int[26];
		for (int i=0; i < str.length(); ++i) {
			count[str.charAt(i)-'a']++;
		}
		for(int i=0; i<count.length; ++i){
			if(count[i]%2!=0){
				System.out.println("No");
				return;
			}
		}
		System.out.println("Yes");
	}
}

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

const ll MOD = 1000000007;

ll powmod(ll x, ll y) {
    ll res = 1;
    for (ll i = 0; i < y; i++)
    {
        res = res * x % MOD;
    }
    return res;
}

int main() {

    int N;
    cin >> N;

    
    ll ans = powmod(10, N) - powmod(9, N) * 2 + powmod(8, N);

    ans %= MOD;
    ans = (ans+MOD) % MOD;

    cout << ans << endl;
    

    return 0;
}

Measured memory_bytes: 3608
using System;

namespace ABC060
{
    class B
    {
        static void Main(string[] args)
        {
            string[] input = Console.ReadLine().Split();

            int A = int.Parse(input[0]);
            int B = int.Parse(input[1]);
            int C = int.Parse(input[2]);

            for (int i = 1; i <= A * B; i++)
            {
                if (i % A == 0 && i % B == C) { Console.WriteLine("YES"); return; }

            }
            Console.WriteLine("NO");
        }
    }
}


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

int n;
int a[100000], c = 0;

int main() {
	cin >> n;
	for (int i = 0; i < n; i++) {
		cin >> a[i];
		if (a[i] % 2 == 1)c++;
	}

	if (c % 2 == 0) {
		cout << "YES" << endl;
	}
	else {
		cout << "NO" << endl;
	}
}

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

using namespace std;
using ll = long long;
const double pi = acos(-1);
#define FOR(i,a,b) for (ll i=(a),__last_##i=(b);i<__last_##i;i++)
#define RFOR(i,a,b) for (ll i=(b)-1,__last_##i=(a);i>=__last_##i;i--)
#define REP(i,n) FOR(i,0,n)
#define RREP(i,n) RFOR(i,0,n)
#define __GET_MACRO3(_1, _2, _3, NAME, ...) NAME
#define rep(...) __GET_MACRO3(__VA_ARGS__, FOR, REP)(__VA_ARGS__)
#define rrep(...) __GET_MACRO3(__VA_ARGS__, RFOR, RREP)(__VA_ARGS__)
template<typename T> ostream& operator<<(ostream& os, const vector<T>& v) {
	REP(i, v.size()) { if (i)os << " "; os << v[i]; }return os;
}
template<typename T> ostream& operator<<(ostream& os, const vector<vector<T>>& v) {
	REP(i, v.size()) { if (i)os << endl; os << v[i]; }return os;
}

const ll INF = LLONG_MAX;
ll MOD = 1000000007;
ll _MOD = 1000000009;
double EPS = 1e-10;

#define int long long

inline void my_io() {

	std::ios::sync_with_stdio(false);

	std::cin.tie(0);

	cout << fixed << setprecision(16);

	//cout << setprecision(10) << scientific << ans << endl;
}

signed main() {
	string s;

	cin >> s;

	string s1 = "";

	REP(i, s.size()) {
		if (i % 2) {
			s1 += "0";
		}
		else {
			s1 += "1";
		}
	}

	string s2 = "";

	REP(i, s.size()) {
		if (i % 2) {
			s2 += "1";
		}
		else {
			s2 += "0";
		}
	}

	ll ans1 = 0;
	ll ans2 = 0;

	REP(i, s.size()) {
		if (s[i] != s1[i]) {
			ans1++;
		}
		if (s[i] != s2[i]) {
			ans2++;
		}
	}

	cout << min(ans1, ans2) << endl;
}

Measured memory_bytes: 640
#include<iostream>
#include <list>
#include<stack>
#include<queue>
#include <vector>
#include <set>
#include<algorithm>
#include<math.h>
#include<stdlib.h>
#include<string>
#include <functional>
#include<map>
using namespace std;

#define FOR(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define REP(i,n) FOR((i),0,(n))
#define LL long long
#define CLR(a) memset((a),0,sizeof(a))
#define SZ(x) (int((x).size()))
#define WAITING(str) int str;std::cin>>str;
#define DEBUGING(str) cout<<str<<endl
const LL INF = (1 << 30);


//定数
const int MOD = 1000000007;


//素因数分解
//in: number
//out: prime numbers
template<typename T>
vector<T> prime_factorization(T n) 
{
	vector<T> res;
	T check = 2;

	while (check*check <= n) {
		if (n%check == 0) {
			n /= check;
			res.push_back(check);
		}
		else {
			check++;
		}
	}
	if (n != 1) res.push_back(n);
	sort(res.begin(), res.end());
	return res;
}


//繰り返し累乗法
//in:  x,n,mod
//out: x^n(Mod mod)
template<typename T>
T mod_pow(T x, T n, T mod) {
	T res = 1;
	while (n > 0) {
		if (n & 1)res = (res * x) % mod;
		x = (x * x) % mod;
		n >>= 1;
	}
	return res;
}


//最大公約数
//(ユークリッドの互除法)
//in: a,b
//out:  GCD(a,b)
template<typename T>
T GCD(T a, T b) 
{
	if (a < b)swap(a, b);
	int r = a % b;
	while (r != 0) {
		a = b;
		b = r;
		r = a % b;
	}
	return b;
}


//最小公倍数
//in:   n:a's size
//      a:LCM object
//out: LCM for a
template<typename T>
T LCM(T n, vector<T> a) 
{
	T res = a[0];
	FOR(i, 1, n) 
		res = res * a[i] / GCD(res, a[i]);
	return res;
}











//上に、ライブラリを作成していく。
//問題に応じて、以下を調整する。
int n;
vector<int> a;

//サブ関数
//入力
void input()
{
	cin >> n;
	REP(i, n) {
		int m; cin >> m; a.push_back(m);
	}
}


//出力
void output()
{
	cout << LCM(n, a) << endl;
}

//デバッグ
void debug(){
	int N;
	cin>>N;
}


//メイン関数
int main(){
	input();
	output();
	debug();
	
	return 0;
}



Measured memory_bytes: 3136
#include<iostream>
using namespace std;
int main(){
	int n,z,y,x;
	cin>>n;
	while(n-->0){
		cin>>x>>y>>z;
		x*=x;
		y*=y;
		z*=z;
		if(x+y==z||x+z==y||y+z==x)
		cout<<"YES"<<endl;
		else
		cout<<"NO"<<endl;
	}
	return 0;
}

Measured memory_bytes: 0
import sys
d,e={},{}
for x in iter(input,'0,0'):
 p,s=map(int,x.split(','))
 d.setdefault(s,[]);d[s]+=[p]
 e[p]=s
for y in sys.stdin:print(sorted(d.keys())[::-1].index(e[int(y)])+1)


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

int main(){
	int n;
	cin >> n;
	int a;
	int c = 0;
	for (int i=0 ;i<n ;i++ ) {
		cin >> a;
		bool f = true;
		int t=2;
		int s;
		s = a/t;
		for ( t=2 ;t<=s ;t++ ) {
			if ( a/t*t==a ) {
				f=false;
				break;
			}
			s = a/t;
		}
		if ( f ) {
			c++;
		}
	}
	cout << c << endl;
	return 0;
}

Measured memory_bytes: 1160