akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define ll long long
#define ull unsigned long long
using namespace std;
int n,m;
bool p[20];
vector<int> s[20];
bool check(int num)
{
    for(int i=0;i<m;i++)
    {
        bool cnt=0;
        for(int j=0;j<s[i].size();j++)
            cnt^=(1&(num>>s[i][j]));
        if(cnt!=p[i])
            return 0;
    }
    return 1;
}
int main()
{
    scanf("%d%d",&n,&m);
    for(int i=0;i<m;i++)
    {
        int x,y;
        scanf("%d",&x);
        for(int j=0;j<x;j++)
            scanf("%d",&y),s[i].push_back(y-1);
    }
    for(int i=0;i<m;i++)
        scanf("%d",&p[i]);
    int ans=0;
    for(int i=0;i<(1<<n);i++)
        ans+=check(i);
    printf("%d\n",ans);
    return 0;
}


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

int main() {
  int n;
  cin >> n;
  map<int,int> mp;
  
  for(int i= 0; i < n; i++){
  	int d;
  cin >> d;
  mp[d]++;
  }
  
  int s = 0;
  
  for(auto p : mp) {
  	s++;
  }
  
  cout << s << endl;
}


Measured memory_bytes: 256
#include<iostream>
#include<vector>
#include<algorithm>
#include<queue>
#include<deque>
#include<cmath>
#include<iomanip>
#include<map>
#include<cstring>

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using ll = long long;
using P = pair<int, int>;
const int INF = 1e9;
const ll LLINF = 4 * 1e18;
/* -- template -- */

struct cake{
    ll bea, del, fav;
};

int main() {
    int N, M; cin >> N >> M;
    cake x[N];
    rep(i, N) cin >> x[i].bea >> x[i].del >> x[i].fav;
    ll ans = 0;
    for(int bit = 0;bit < 8;++bit) {
        ll a[3];
        for(int i = 0; i < 3; ++i){
            if(1 << i & bit){
                a[i] = 1;
            }else{
                a[i] = -1;
            }
        }
        ll temp[N];
        rep(j, N) {
            temp[j] = a[0] * x[j].bea + a[1] * x[j].del + a[2] * x[j].fav;
        }
        sort(temp, temp + N, greater<ll>());
        ll tempans = 0;
        rep(j, M)tempans += temp[j];

        ans = max(tempans, ans);
    }

    cout << ans << endl;
}


Measured memory_bytes: 256
//
// Created by kashi on 27-07-2020.
//
#include<bits/stdc++.h>
using namespace std;
#define mp make_pair
#define pb push_back
#define ll long long
#define ff first
#define ss second
#define Endl endl
#define int long long
int gcd(int a,int b){
    return b?gcd(b,a%b):a;
}
bool cmps(pair<int,int>p1,pair<int,int>p2) {
    return p1.ss<p2.ss;
}
int lcm(int a, int b){
    return (a*b)/gcd(a, b);
}
 
int32_t main() {
    int N=1e9 +7;
    int n;
    cin>>n;
    int a[n];
    int sum=0;
    for(int i=0;i<n;i++) {
        cin >> a[i];
        sum += a[i];
    }
    sum%=N;
    int ans=0;
    for(int i=0;i<n-1;i++){
        sum-=a[i];
        if(sum<0)
            sum+=N;
        ans+=a[i]*sum;
        ans=ans%N;
    }
    cout<<ans<<Endl;
    return 0;
}

Measured memory_bytes: 5196
#include<bits/stdc++.h>
using namespace std;
#define ll long long
const double PI=3.1415926535;
ll x[11];

int main()
{
    ios::sync_with_stdio(false);
    cin.tie(0);
    ll r,D;
    cin>>r>>D>>x[0];
    for(int i=1;i<=10;i++)
    {
        x[i]=r*x[i-1]-D;
    }
    for(int i=1;i<=10;i++)
        cout<<x[i]<<'\n';
















}


Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
 

 class Main{
             
     static int[] ints=new int[10];
     public static void main(String[] args) throws IOException {
        BufferedReader reader =
                new BufferedReader(new InputStreamReader(System.in));
        while (true) {
            String input = reader.readLine();
            if (input == null || input.equals("0")) {
                break;
            }
            long value = Long.parseLong(input);
            int count = 0;
            for (long i = 5; i <= value; i *= 5) {
                count += value / i;
            }
            System.out.println(count);
        }
    }
     public static void main2(String args[]){
         BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
         
         try{
             String line;
             while((line=br.readLine())!= null){if(line.isEmpty())break;
             int nn = Integer.parseInt(line), count=0;
             if(nn==0)break;
                for(int i=5; i<nn;i*=5){
                    count+=nn/i;
                }
                System.out.println(count);
             }
             
         }catch(Exception e){}         
     }
   
 }

Measured memory_bytes: 17016
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  int H,W,N;
  cin >> H >> W >> N;
  int x=H;
  if(H!=W){
  	x=max(H,W);
  }
  int ans=N/x;
  if(x*ans!=N)ans++;
  cout << ans << endl;
}

Measured memory_bytes: 256
import java.util.*;

class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int N = sc.nextInt();
    int ans = 0;
    int A[] = new int[N];
    int x[][] = new int[N][N];
    int y[][] = new int[N][N];
    for (int i=0;i<N;i++) {
      A[i] = sc.nextInt();
      for(int j=0;j<A[i];j++){
        x[i][j] = sc.nextInt();
        y[i][j] = sc.nextInt();
      }
    }
    //ここまで入力

    //bit全探索
    for(int bits=1; bits < (1 << N); bits++){
      boolean flag = true;
      for(int i=0; i<N; i++){
        //不親切な人の証言は考慮しない
        if((bits & (1 << i)) == 0) continue;
        for(int j=0; j<A[i]; j++){
          if((((bits >> x[i][j]-1) & 1) ^ y[i][j]) == 1) flag = false;
          //（bitsが101のとき、人１の証言が人2は1ですなど）正直者が、正直者だと証言した人が正直者ではない場合
          //正直者が、不親切な人だと証言した人が正直者だった場合
        }
      }

      if(flag == true){
        int cnt = 0;
        for(int j = 0; j < N; j++) {
          if ((bits >> j) % 2 == 1){
            cnt++;
            ans = Math.max(ans, cnt);
          }
        }
      }

    }
    System.out.print(ans);
  }
}


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

vector<string> fromJfen(const string s) {
    vector<string> res;
    string t = ""; // row's string
    for (int i = 0; i < (int)s.size(); ++i) {
        if (s[i] == '/') continue;
        t += s[i];
        if (i == (int)s.size() - 1 || s[i + 1] == '/') {
            string r = "";
            for (int j = 0; j < (int)t.size(); ++j) {
                if (t[j] == 'b') {
                    r += "b";
                    continue;
                } else if ('0' < t[j] && t[j] <= '9') {
                    for (int k = 0; k < t[j] - '0'; ++k) r += ".";
                }
            }
            res.push_back(r);
            t = "";
        }
    }
    return res;
}

string toJfen(const vector<string> &vs) {
    string res = "";
    for (int i = 0; i < (int)vs.size(); ++i) {
        if (i != 0) res += "/";
        int cnt = 0;
        for (int j = 0; j < (int)vs[i].size(); ++j) {
            if (vs[i][j] == '.') {
                cnt++;
                if (j == (int)vs[i].size() - 1 || vs[i][j + 1] == 'b') {
                    res += char('0' + cnt);
                    cnt = 0;
                }
            } else if (vs[i][j] == 'b') {
                res += "b";
            }
        }
    }
    return res;
}

int main() {
    string S;
    while (cin >> S) {
        if (S == "#") break;
        int a, b, c, d;
        cin >> a >> b >> c >> d;

        vector<string> vs = fromJfen(S);
        vs[a - 1][b - 1] = '.';
        vs[c - 1][d - 1] = 'b';
        cout << toJfen(vs) << endl;
    }
    return 0;
}


Measured memory_bytes: 3176
#include <bits/stdc++.h>
#define fr(i, n) for (int i = 0; i < n; i++)
#define frab(i, a, b) for (int i = a; i < b; i++)
#define pb push_back

using namespace std;

typedef long long ll;
typedef long double ld;

const ll MOD = 1e9 + 7;
const ll INF = 2e15 + 10;
const ll MAX = 1e14 + 10;
const ld EPS = 1e-9;
const int N = 1e3 + 10;
const int M = 1e5 + 10;

ll a[N];
ll d[N][N];
ll pref[N];

void solve() {
    int n;
    cin >> n;
    fr(i, n)
        cin >> a[i];
    fr(i, n)
        pref[i + 1] = pref[i] + a[i];
//    fr(i, n)
//        d[i][i] = a[i];
    frab(len, 2, n + 1)
        for (int l = 0; l + len - 1 < n; l++) {
            int r = l + len - 1;
            d[l][r] = INF;
            for (int m = l; m < r; m++)
                d[l][r] = min(d[l][r], d[l][m] + d[m + 1][r]);
            d[l][r] += pref[r + 1] - pref[l];
        }
    cout << d[0][n - 1];
}



int main() {
    //freopen("a.in", "r", stdin);
    ios_base::sync_with_stdio(false);
    solve();
}


Measured memory_bytes: 3840
#include <algorithm>
#include<iostream>
#include<vector>
#include<map>
#include<set>
#include<string>

#include<stdlib.h>
#include<string.h>
#include<math.h>
#include<limits.h>

using namespace std;
int main(){
  string str;
  cin >> str;
  for(char c : str){
	if(c == '1'){
	  cout << "9";
	}
	else{
	  cout << "1";
	}
  }
  cout << endl;
  return 0;
}


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

//using Graph = vector<vector<edge>>;
using dou =long double;
string yes="yes";
string Yes="Yes";
string YES="YES";
string no="no";
string No="No";
string NO="NO";

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; }
#define rep(i, n)         for(int i = 0; i < (int)(n); i++)
#define brep(n)           for(int bit=0;bit<(1<<n);bit++)
#define erep(i,container) for (auto i : container)
#define irep(i, n)        for(int i = n-1; i >= (int)0; i--)
#define rrep(i,m,n) for(ll i = m; i < (ll)(n); i++)
#define reprep(i,j,h,w) rep(i,h)rep(j,w)
#define all(x) (x).begin(),(x).end()
#define VEC(type,name,n) std::vector<type> name(n);rep(i,n)std::cin >> name[i];
#define pb push_back
#define pf push_front
#define query int qq;std::cin >> qq;rep(qqq,qq)
#define lb lower_bound
#define ub upper_bound
#define fi first
#define se second
#define itn int
#define mp make_pair
#define sum(a) accumulate(all(a),0ll)
#define keta fixed<<setprecision
#define vvector(name,typ,m,n,a)vector<vector<typ> > name(m,vector<typ> (n,a))
#define vvvector(name,t,l,m,n,a) vector<vector<vector<t> > > name(l, vector<vector<t> >(m, vector<t>(n,a)));
#define vvvvector(name,t,k,l,m,n,a) vector<vector<vector<vector<t> > > > name(k,vector<vector<vector<t> > >(l, vector<vector<t> >(m, vector<t>(n,a)) ));
#define case std::cout <<"Case #" <<qqq+1<<": "
#define res resize
#define as assign
#define ffor for(;;)
#define ppri(a,b) std::cout << a<<" "<<b << std::endl
#define pppri(a,b,c) std::cout << a<<" "<<b <<" "<< c<<std::endl
#define aall(x,n) (x).begin(),(x).begin()+(n)
#define ssum(a) accumulate(a,0ll) 

typedef long long ll;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;
//typedef long long T;
const int INF = 1000000000;
const ll INF64 = 922337203685477580ll;
const ll MOD = 1000000007ll;
const dou pi=3.141592653589793;


int main(){
    int v,e;
    std::cin >> v>>e;
    vvector(g,int,v,v,INF);
    vvector(dp,int,(1<<v),v,INF);
    
    dp[0][0]=0;
    rep(i,e){
        int a,b,c;
        std::cin >> a>>b>>c;
        g[a][b]=c;

    }
    rep(bit,(1<<v)){
        rep(i,v){
            if(bit&(1<<i)){
                rep(j,v){
                    chmin(dp[bit][i],dp[bit-(1<<i)][j]+g[i][j]);
                }
            }
        }
    }
    if(INF!=dp[(1<<v)-1][0])std::cout << dp[(1<<v)-1][0] << std::endl;
    else std::cout << -1 << std::endl;
}


Measured memory_bytes: 6296
#include<bits/stdc++.h>
#define ll  long long int
#define ull unsigned long long 
#define ff first
#define ss second
#define fast ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define pb push_back 
#define mp make_pair
#define inf 1000000000000000
#define mod 1000000007
#define ld long double
#define pll pair<ll,ll>
using namespace std;

int main()
{ 
    

fast;

ll n;
cin>>n;

vector<ll> f(n+1,0);

for(ll x=1;x<100;x++)
{
    for(ll y=1;y<100;y++)
    {
        for(ll z=1;z<100;z++)
        {
            ll val=x*x+y*y+z*z+x*y+y*z+z*x;
            if(val<=n)
                f[val]++;
        }
    }
}

for(ll i=1;i<=n;i++)
cout<<f[i]<<'\n';

}


Measured memory_bytes: 3612
#include <cstdio>
#include <cstdlib>
#include <algorithm>
#define fo(i,a,b) for(int i=a;i<=b;i++)
#define fod(i,a,b) for(int i=a;i>=b;i--)
#define efo(i,q) for(int i=A[q];i;i=B[i][0])
using namespace std;
typedef long long LL;
const int N=200500;
int read(int &n)
{
	char ch=' ';int q=0,w=1;
	for(;(ch!='-')&&((ch<'0')||(ch>'9'));ch=getchar());
	if(ch=='-')w=-1,ch=getchar();
	for(;ch>='0' && ch<='9';ch=getchar())q=q*10+ch-48;n=q*w;return n;
}
int m,n,ans;
int a[N],nx[N];
LL b[N][30],bv[N];
LL Ans[30];
void Doit(LL q,LL K)
{
	if(q<=n)
	{
		fo(i,1,q)Ans[a[i]]+=K;
		return;
	}
	fo(i,1,N)if(bv[i]>q)
	{
		fo(j,0,25)Ans[j]+=b[i-1][j]*K;
		Doit(q-bv[i-1],K);
		return;
	}
}
int main()
{
	int q;
	char ch=' ';
	for(ch=getchar();ch<='z'&&ch>='a';ch=getchar())a[++n]=ch-'a';
	n>>=1;
	q=0;
	fo(i,2,n)
	{
		for(;q&&a[q+1]!=a[i];q=nx[q]);
		if(a[q+1]==a[i])++q;
		nx[i]=q;
	}
	m=n-nx[n];
	fo(i,1,n)++b[0][a[i]];
	fo(i,0,25)b[1][i]=b[0][i];
	fo(i,1,m)++b[1][a[i]];
	bv[0]=n,bv[1]=n+m;
	fo(i,2,1000)
	{
		bv[i]=bv[i-1]+bv[i-2];
		fo(j,0,25)b[i][j]=b[i-1][j]+b[i-2][j];
	}
	LL l,r;
	scanf("%lld%lld",&l,&r);
	Doit(r,1);
	Doit(l-1,-1);
	fo(i,0,25)printf("%lld ",Ans[i]);
	return 0;
}

Measured memory_bytes: 3200
#include <cstdlib>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <algorithm>
#include <vector>
#include <string>
#include <iostream>
#include <sstream>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <fstream>
#include <numeric>
#include <iomanip>
#include <bitset>
#include <list>
#include <stdexcept>
#include <functional>
#include <utility>
#include <ctime>
#include <random>
#include <cassert>
using namespace std;
typedef long long LL;
typedef unsigned long long ULL;
#define MEM(a,b) memset((a),(b),sizeof(a))
const LL INF = 1e9 + 7;
const int N = 1e5 + 10;

int main()
{
	//freopen("input.txt", "r", stdin);
	//freopen("output.txt", "w", stdout);
	int n, k;
	cin >> n >> k;
	double ans = 0;
	for (int i = 1; i <= n; i++)
	{
		int x = i;
		double res = 1;
		while (x < k) res /= 2, x <<= 1;
		ans += res;
	}
	printf("%.15f\n", ans / n);
	return 0;
}

Measured memory_bytes: 256
H, W = map(int, input().split())
a = []
b = []
c = []
i = 0
j = 0
k = 0
while i < H:
    moji = input()
    if "#" in moji:
        a.append([m for m in moji])
    i += 1
while j < W:
    ls = [row[j] for row in a]
    if "#" in ls:
        b.append(ls)
    j += 1
while k < len(b[0]):
    ls = [row[k] for row in b]
    c.append(ls)
    k += 1
for row in c:
    print("".join(row))


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

int main() {
  int N, K;
  cin >> N >> K;
  vector<int> V(N);
  for (int i = 0; i < N; i++) cin >> V.at(i);

  int ans = 0;
  for (int i = 0; i <= K; i++) {
    for (int j = 0; i + j <= K; j++) {
      int L = min(i, N);
      int R = min(j, max(0, N - i));
      vector<int> tmp;
      while (L) tmp.push_back(V.at(--L));
      while (R) tmp.push_back(V.at(N - 1 - --R));
      int sum = accumulate(tmp.begin(), tmp.end(), 0);
      ans = max(ans, sum);
      sort(tmp.begin(), tmp.end());
      for (int k = 0; k < min(K - i - j, (int)tmp.size()); k++) {
        sum -= tmp.at(k);
        ans = max(ans, sum);
      }
    }
  }

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

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll=long long;
#define rep(i,n) for(ll i=0;i<n;i++)
const ll INF=1e18;
const int inf=2e9;
const ll MOD=1000000007;

int main(){
    string S,T;cin>>S>>T;
    cout<<T+S<<endl;
    return 0;
}


Measured memory_bytes: 256
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using System.Text;

class TEST{
	static void Main(){
		Sol mySol =new Sol();
		mySol.Solve();
	}
}

class Sol{
	public void Solve(){
		
		long Inf = (long) 1e18;
		long[] min = new long[]{Inf, Inf};
		for(int t=0;t<2;t++){
			if(t == 1) Array.Reverse(A);
			long[][] dp = new long[5][];
			for(int i=0;i<5;i++){
				dp[i] = new long[L + 1];
				for(int j=0;j<=L;j++){
					dp[i][j] = Inf;
				}
			}
			
			dp[0][0] = 0;
			for(int i=0;i<L;i++){
				
				for(int j=0;j<5;j++){
					if(j <= 0) dp[0][i+1] = Math.Min(dp[0][i+1], dp[j][i] + A[i]);
					if(j <= 1) dp[1][i+1] = Math.Min(dp[1][i+1], dp[j][i] + (A[i] == 0 ? 2 : A[i] % 2));
					if(j <= 2) dp[2][i+1] = Math.Min(dp[2][i+1], dp[j][i] + (A[i] == 0 ? 1 : (A[i] % 2) ^ 1));
					if(j <= 3) dp[3][i+1] = Math.Min(dp[3][i+1], dp[j][i] + (A[i] == 0 ? 2 : A[i] % 2));
					if(j <= 4) dp[4][i+1] = Math.Min(dp[4][i+1], dp[j][i] + A[i]);
				}
				
//for(int ii=0;ii<5;ii++) Console.WriteLine("i:{0}: ii:{1}: {2}",i,ii,String.Join(" ",dp[ii]));Console.WriteLine();				
				
				
			}
			
			for(int i=0;i<5;i++){
				min[t] = Math.Min(min[t], dp[i][L]);
			}
		}
//Console.WriteLine(String.Join(" ",min));
		Console.WriteLine(min.Min());
		
	}
	int L;
	int[] A;
	public Sol(){
		L = ri();
		A = new int[L];
		for(int i=0;i<L;i++) A[i] = ri();
	}

	static String rs(){return Console.ReadLine();}
	static int ri(){return int.Parse(Console.ReadLine());}
	static long rl(){return long.Parse(Console.ReadLine());}
	static double rd(){return double.Parse(Console.ReadLine());}
	static String[] rsa(char sep=' '){return Console.ReadLine().Split(sep);}
	static int[] ria(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>int.Parse(e));}
	static long[] rla(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>long.Parse(e));}
	static double[] rda(char sep=' '){return Array.ConvertAll(Console.ReadLine().Split(sep),e=>double.Parse(e));}
}


Measured memory_bytes: 33628
#include<bits/stdc++.h>
using namespace std;
int a[5010];
bool dp[5010];
int n,k;
bool check(int mid)
{
	if(a[mid]>k)return 1;
	memset(dp,0,sizeof(dp));
	dp[0]=1;
	for(int i=1;i<=n;i++)
	{
		if(i==mid)continue;
		for(int j=k;j>=a[i];j--)
		dp[j]=dp[j]||dp[j-a[i]];
	}
	for(int i=k-a[mid];i<k;i++)
	if(dp[i])return true;
	return false;
}
int main()
{
	scanf("%d %d",&n,&k);
	for(int i=1;i<=n;i++)
	scanf("%d",&a[i]);
	sort(a+1,a+1+n);
	int l=1,r=n;
	while(l<=r)
	{
		int mid=(l+r)>>1;
		if(check(mid))r=mid-1;
		else l=mid+1;
	}
	cout<<r;
	return 0;
}

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

void solve(){
  unsigned long long int h, w; cin >> h >> w;
  unsigned long long int sum;
  unsigned long long int w1, w2;
  if(w == 1 || h == 1) sum = 1;
  else if(w % 2 == 0){
    w1 = w / 2;
    w2 = w / 2;
    if(h % 2 == 0){
      sum = w1 * h;
    }
    else{
      sum = w1 * h;
    }
  }
  else{
    w1 = w / 2 + 1;
    w2 = w / 2;
    if(h % 2 == 0){
      sum = (w1 + w2) * (h / 2);
    }
    else{
      sum = (w1 + w2) * (h / 2) + w1;
    }
  }
  cout << sum << endl;
  return;
}

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


Measured memory_bytes: 256
#include<bits/stdc++.h>
#define ll long long
#define fr(i,x,y) for(int i=(x);i<=(y);i++)
#define rf(i,x,y) for(int i=(x);i>=(y);i--)
#define frl(i,x,y) for(int i=(x);i<(y);i++)
using namespace std;
const int N=2002;
int n,m,A,B;

int main(){
	cin>>n>>m>>A>>B;
	fr(i,1,n){
		fr(j,1,m)
		 printf("%d",(i<=B)^(j<=A));
		puts("");
	}
	return 0;
}

Measured memory_bytes: 1280
#include <iostream>
#include <string>
#include <sstream>
#include <vector>
#include <climits>
#include <cmath>
#include <algorithm>

#define TEST_ASSERT(msg, cond) do { if (cond) { cout << msg << " => pass" << endl;} else { cout << msg << " => failed" << endl;} } while(0)

using namespace std;

int main() {

  char x, y;
  cin >> x;
  cin >> y;
  if (x < y) {
	  cout << "<" << endl;
  }
  else if (x > y) {
	  cout << ">" << endl;
  }
  else {
	  cout << "=" << endl;
  }

  return 0;
}


Measured memory_bytes: 256
#include<stdio.h>
#define N 200000
int main(){
  int n,i,j,R_t[N];
  int minv,maxv;
  scanf("%d",&n);

  for(i=0;i<n;i++)scanf("%d",&R_t[i]);

  minv=R_t[0];//??????
  maxv=R_t[1]-R_t[0];//????????????

  for(j=1;j<n;j++){
    if(maxv<R_t[j]-minv)maxv=R_t[j]-minv;
    if(minv>R_t[j])minv=R_t[j];

  }
  printf("%d\n",maxv);

  return 0;
}

Measured memory_bytes: 1380
#pragma region template
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
using vi = vector<int>;
using vvi = vector<vi>;
using vvvi = vector<vvi>;
using vll = vector<ll>;
using vvll = vector<vll>;
using vvvll = vector<vvll>;
using vld = vector<ld>;
using vvld = vector<vld>;
using vvvld = vector<vvld>;
using vs = vector<string>;
using pll = pair<ll, ll>;
using vp = vector<pll>;
template <typename T>
using pqrev = priority_queue<T, vector<T>, greater<T>>;
#define rep(i, n) for (ll i = 0, i##_end = (n); i < i##_end; i++)
#define repb(i, n) for (ll i = (n)-1; i >= 0; i--)
#define repr(i, a, b) for (ll i = (a), i##_end = (b); i < i##_end; i++)
#define reprb(i, a, b) for (ll i = (b)-1, i##_end = (a); i >= i##_end; i--)
#define ALL(a) (a).begin(), (a).end()
#define SZ(x) ((ll)(x).size())
//*
constexpr ll MOD = 1e9 + 7;
/*/
constexpr ll MOD = 998244353;
//*/
constexpr ll INF = 1e+18;
constexpr ld EPS = 1e-12L;
constexpr ld PI = 3.14159265358979323846L;
constexpr ll GCD(ll a, ll b) { return b ? GCD(b, a % b) : a; }
constexpr ll LCM(ll a, ll b) { return a / GCD(a, b) * b; }
template <typename S, typename T>
inline bool chmax(S &a, const T &b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}
template <typename S, typename T>
inline bool chmin(S &a, const T &b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}
#ifdef OJ_LOCAL
#include "dump.hpp"
#else
#define dump(...) ((void)0)
#endif
template <typename T>
bool print_(const T &a) {
  cout << a;
  return true;
}
template <typename T>
bool print_(const vector<T> &vec) {
  for (auto &a : vec) {
    cout << a;
    if (&a != &vec.back()) {
      cout << " ";
    }
  }
  return false;
}
template <typename T>
bool print_(const vector<vector<T>> &vv) {
  for (auto &v : vv) {
    for (auto &a : v) {
      cout << a;
      if (&a != &v.back()) {
        cout << " ";
      }
    }
    if (&v != &vv.back()) {
      cout << "\n";
    }
  }
  return false;
}
void print() { cout << "\n"; }
template <typename Head, typename... Tail>
void print(Head &&head, Tail &&... tail) {
  bool f = print_(head);
  if (sizeof...(tail) != 0) {
    cout << (f ? " " : "\n");
  }
  print(forward<Tail>(tail)...);
}
#pragma endregion

void Pr(bool f){
  cout << (f ? "Yes" : "No") << endl;
  exit(0);
}

int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  cout << fixed << setprecision(20);
  set<int> st;
  string s;
  cin >> s;
  rep(i, 3) st.insert(s[i]);
  Pr(SZ(st) >= 2);
}


Measured memory_bytes: 256
def main():
    N = int(input())
    A = [int(a) for a in input().split()]

    n_4 = 0
    n_2 = 0
    n_odd = 0

    for i in range(N):
        if A[i] % 4 == 0:
            n_4 += 1
        elif A[i] % 2 == 0:
            n_2 += 1
        else:
            n_odd += 1

    if (n_odd + n_2 % 2 - 1) <= n_4:
        print("Yes")
    else:
        print("No")

if __name__ == "__main__":
    main()

Measured memory_bytes: 14252
#include <stdio.h>
int main() {
  int n,a[100000],x=0,i;
  scanf("%d",&n);
  for (i=0;i<n;i++) {
    scanf("%d",&a[i]);
  }
  while (n--) {
    if (a[n]%2==1) {
      x++;
    }
  }
  if (x%2==0) {
    printf("YES\n");
  } else {
    printf("NO\n");
  }
  return 0;
}

Measured memory_bytes: 512
#include <iostream>
using namespace std;
int main(void){
    int a,b,c,d,e,s=0;
    cin>>a>>b>>c>>d>>e;
    if(a<0){
        s+=abs(a)*c;
        s+=d;
        s+=b*e;
    }
    else{
        s+=(b-a)*e;
    }
    cout<<s<<endl;
}



Measured memory_bytes: 3056
import java.util.Arrays;
import java.util.Collections;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {

		Scanner scan = new Scanner(System.in);

		int N = scan.nextInt();
		Integer a[] = new Integer[N];
		
		for(int i = 0; i<a.length;i++) {
			a[i] = scan.nextInt();
		}
		
		//int alice = 0;
		//int bob = 0;
		int ans = 0;
		Arrays.sort(a, Collections.reverseOrder());
		for(int i = 2; i<a.length+2; i++) {
			if((i % 2 == 0)) { 
				ans += a[i-2];
			} else {
				ans = ans + ((-1) * a[i-2]);
			}
		}
		System.out.println(ans);

	}

}


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

int main() {
  long long N, K;
  cin >> N >> K;
  long long res = 0;
  for (int i = 0; i < N; ++i) {
    long long A;
    cin >> A;
    res += min(A, K-A) * 2;
  }
  cout << res << endl;
}

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

class MainClass
{
    static void Main()
    {
        var NM = ReadLine().Split().Select(int.Parse).ToArray();
        int N = NM[0], M = NM[1];
        var X = ReadLine().Split().Select(long.Parse).ToArray();
        Array.Sort(X);
        var dif = new long[M - 1];
        for (int i = 0; i < M-1; i++)
        {
            dif[i] = X[i + 1] - X[i];
        }
        Array.Sort(dif);
        Array.Reverse(dif);
        long ans = X.Max() - X.Min();
        for (int i = 0; i < Min(M,N)-1; i++)
        {
            ans -= dif[i];
        }
        WriteLine(ans);
    }
}


Measured memory_bytes: 37144
#include<bits/stdc++.h>
#define PI acos(-1.0)
#define pb push_back
#define F first
#define S second
using namespace std;
typedef long long ll;
const int N=4e5+5;
const int MOD=1e9+7;
ll a[N],sum[N];
int main(void){
    ios::sync_with_stdio(false);
    cin.tie(0);cout.tie(0);

    int k;
    cin>>a[1]>>a[2]>>a[3]>>k;
    sort(a+1,a+1+3);
    for(int i=1;i<=k;i++)   a[3]*=2;
    cout <<a[1]+a[2]+a[3]<<endl;

    return 0;
}


Measured memory_bytes: 2304
#include <cstdio>
#include <cmath>
#include <cstring>
#include <cstdlib>
#include <climits>
#include <ctime>
#include <queue>
#include <stack>
#include <algorithm>
#include <list>
#include <vector>
#include <set>
#include <map>
#include <iostream>
#include <deque>
#include <complex>
#include <string>
#include <iomanip>
#include <sstream>
#include <bitset>
#include <valarray>
#include <iterator>
using namespace std;
typedef long long int ll;
typedef unsigned int uint;
typedef unsigned char uchar;
typedef unsigned long long ull;
typedef pair<int, int> pii;
typedef pair<ll, pii> plp;
typedef vector<ll> vi;

#define REP(i,x) for(int i=0;i<(int)(x);i++)
#define FOR(i,c) for(__typeof((c).begin())i=(c).begin();i!=(c).end();i++)
#define RREP(i,x) for(int i=((int)(x)-1);i>=0;i--)
#define RFOR(i,c) for(__typeof((c).rbegin())i=(c).rbegin();i!=(c).rend();i++)
#define ALL(container) container.begin(), container.end()
#define RALL(container) container.rbegin(), container.rend()
#define SZ(container) ((int)container.size())
#define mp(a,b) make_pair(a, b)
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );

template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return 1; } return 0; }
template<class T> ostream& operator<<(ostream &os, const vector<T> &t) {
os<<"["; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"]"; return os;
}
template<class T> ostream& operator<<(ostream &os, const set<T> &t) {
os<<"{"; FOR(it,t) {if(it!=t.begin()) os<<","; os<<*it;} os<<"}"; return os;
}
template<class S, class T> ostream& operator<<(ostream &os, const pair<S,T> &t) { return os<<"("<<t.first<<","<<t.second<<")";}

const ll INF = 1LL<<60;
const double EPS = 1e-8;
const int MOD = 1000000007;


int n;

main(){
	scanf("%d", &n);
	vi A(n+1);
	vector< set<plp> > vs(n+1);
	REP(i, n) scanf("%lld", &A[i+1]);
	vs[0].insert(plp(-INF, pii(0, 0)));
	REP(i, n+1){
		ll sum = 0;
//		cout << vs[i] << endl;
		for(int j=i+1;j<=n;j++){
			sum += A[j];
			auto it = vs[i].lower_bound(plp(sum, pii(0, 0)));
			if(it == vs[i].begin()) continue;
			-- it;
			int c = it->second.first + 1;
			auto jt = vs[j].upper_bound(plp(sum, pii(0, 0)));
			if(jt != vs[j].begin()){
				-- jt;
				if(jt->second.first >= c) continue;
				++ jt;
			}
			while(jt != vs[j].end()){
				if(jt->second.first <= c) jt = vs[j].erase(jt);
				else break;
			}
			vs[j].insert(plp(sum, pii(c, i)));
		}
	}
	auto it = vs[n].end();
	--it;
	int m = it->second.first;
	printf("%d\n", m);
	vi ans;
	RREP(i, m-1){
		ans.push_back(it->second.second);
		it = vs[it->second.second].lower_bound(plp(it->first, pii(0, 0)));
		-- it;
	}
	reverse(ALL(ans));
	REP(i, ans.size()) printf("%d%s", ans[i], i<ans.size()-1?" ":"");
	puts("");
	
	
	return 0;
}

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

int main(void) {
	// your code goes here
	int n = 0, total = 0, b = 0;
	scanf("%d", &n);
	int a [n];
	for(int i=0;i<n;i++)
	{
		scanf("%d", &a[i]);
		//printf("%d ", a[i]);
		total += abs(b - a[i]);
		b = a[i];
	}
	total += abs(0 - b);
	//printf("%d\n", total);
	for(int i=0;i<n;i++)
	{
		if(i==0)
		{
			printf("%d\n", total +  abs(0 - a[i+1]) -  (abs(0 - a[i]) + abs(a[i] - a[i+1])));
		}
		else if(i==n-1)
		{
			printf("%d\n", total + abs(a[i-1] - 0) - (abs(a[i-1] - a[i]) + abs(a[i] - 0)));
		}
		else
		{
			printf("%d\n", total + abs(a[i-1] - a[i+1]) - (abs(a[i-1] - a[i]) + abs(a[i] - a[i+1])));
		}
	}
	return 0;
}


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

int main(){
    float a,b,c,d,e,f;
    while(-1!=scanf("%f%f%f%f%f%f",&a,&b,&c,&d,&e,&f)){
        b/=a;
        c/=a;
        e-=d*b;
        f-=d*c;
        f/=e;
        c-=b*f;

        printf("%.3f %.3f\n", c, f);
    }
    return 0;
}

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

int main() {
  double x1, y1, x2, y2;
  cin >> x1 >> y1 >> x2 >> y2;
  cout << fixed << setprecision(8) << hypot(x1 - x2, y1 - y2) << endl;
  return 0;
}


Measured memory_bytes: 3364
#include <iostream>
#include <algorithm>
#include <fstream>
#include <vector>
#include <deque>
#include <assert.h>
#include <stack>
#include <set>
#include <map>
#include <stdio.h>
#include <string.h>
#include <utility>
#include <math.h>
#include <bitset>
#include <iomanip>
#include <complex>
#include <queue>
using namespace std;
#define rng(i,a,b) for(int i=int(a);i<int(b);i++)
#define rep(i,b) rng(i,0,b)
#define gnr(i,a,b) for(int i=int(b)-1;i>=int(a);i--)
#define per(i,b) gnr(i,0,b)
#define ALL(x) (x).begin(),(x).end()
#define RALL(x) (x).rbegin(),(x).rend()
#define IDX(vec, element_iter) distance((vec).begin(), element_iter)
#define print(x) cout<<(x)<<'\n'
#define print_vec(v) rep(i,v.size()){if(i!=0)cout<<" ";cout<<v[i];}cout<<'\n'
#define pe(x) cout<<(x)<<" "
#define DEBUG(x) cout<<#x<<": "<<x<<'\n'
#define DEBUG_VEC(v) cout<<#v<<":";rep(i,v.size())cout<<" "<<v[i];cout<<'\n'
#define pb push_back
#define mp make_pair
#define MOD 1000000007 //10^9+7
#define fi first
#define sc second
using ll=long long;
using pl=pair<ll,ll>;
using vl=vector<ll>;
using vvl=vector<vl>;
using vs=vector<string>;
template<typename T, typename U> inline void amin(T &x, U y) { if(y < x) x = y; }
template<typename T, typename U> inline void amax(T &x, U y) { if(x < y) x = y; }

void solve() {
    string s,t;
    cin >> s >> t;
    int lenS = s.size();
    int lenT = t.size();
    int ans = 1e9;
    rep(offset,lenS){
        if(offset > lenS-lenT) break;
        int cnt = 0;
        rep(i,lenT){
            if(s[offset+i] != t[i]) cnt++;
        }
        ans = min(ans, cnt);
    }
    print(ans);
}   

int main() {
    cin.tie(nullptr);
    ios_base::sync_with_stdio(false);
	cout<<fixed<<setprecision(20);
    //int q; cin >> q;
	//while (q--)
		solve();
    return 0;
}


Measured memory_bytes: 3648
N, P = map(int, input().split())
*A, = map(int, input().split())
even = 0
for a in A:
    if a % 2 == 0:
        even += 1
if even == N:
    print(2**N if P == 0 else 0)
else:
    print(2**(N-1))

Measured memory_bytes: 2940
#include <bits/stdc++.h>
using namespace std;
//型に気を付けよう
//a=0x61=97 '0'=0x30=48
#define rep(i,n) for(int i=0;i<n;i++)
typedef long long  ll;
typedef long double  ld;
typedef string str;
typedef pair<int,int> pairii;
typedef vector<int> veci;
const double pi=3.1415926535;
const ll  mod=1000000007;
//桁数指定　cout << fixed << setprecision(2)
int main() {
  ll x,k,d,an;
  cin>>x>>k>>d;
  an=abs(x);
  if(an/d>k){
    an-=d*k;
  }
  else{
    k-=an/d;
    an%=d;
    if(k%2)an=min(an+d,abs(an-d));
    else an=an;
  }
  cout<<an<<endl;
}

Measured memory_bytes: 3632
#include<iomanip>
#include<limits>
#include<thread>
#include<utility>
#include<iostream>
#include<string>
#include<algorithm>
#include<set>
#include<map>
#include<vector>
#include<stack>
#include<queue>
#include<cmath>
#include<numeric>
#include<cassert>
#include<random>
#include<chrono>
#include<unordered_set>
#include<unordered_map>
#include<fstream>
#include<list>
#include<functional>
#include<bitset>
#include<complex>
#include<tuple>
using namespace std;
typedef unsigned long long int ull;
typedef long long int ll;
typedef pair<ll,ll> pll;
typedef pair<int,int> pi;
typedef pair<double,double> pd;
typedef pair<double,ll> pdl;
#define F first
#define S second
const ll E=1e18+7;
const ll MOD=1000000007;





int main(){
    string s;
    cin>>s;
    ll cnt=0;
    for(int i=1;i<s.size();i++){
        if(s[i]!=s[i-1]){cnt++;}
    }
    cout<<cnt<<endl;
    
    
    
    return 0;
}


Measured memory_bytes: 512
import sys
input = sys.stdin.readline

def main():
    # a = int(input())
    # N, K = map(int, input().split())
    # a = list(map(int, input().split()))
    s = input().strip()
    t = input().strip()
    ans = 0
    for i in range(3):
        if s[i] == t[i]:
            ans += 1
    print(ans)
    # if :
    #     print("Yes")
    # else:
    #     print("No")

if __name__ == "__main__":
    main()

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

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

ll lcm(ll a, ll b)
{
    ll g = gcd(a, b);
    return a / g * b;
}

const string YES = "Possible";
const string NO = "Impossible";

void solve(long long A, long long B)
{
    if (A % 3 == 0 || B % 3 == 0 || (A + B) % 3 == 0)
    {
        cout << YES << endl;
    }
    else
    {
        cout << NO << endl;
    }
}

int main()
{
    long long A;
    scanf("%lld", &A);
    long long B;
    scanf("%lld", &B);
    solve(A, B);
    return 0;
}


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

int main()
{
  int N,H,W ;
  cin>>N>>H>>W ;
  int ans=0 ;
  for(int i=0;i<N;i++){
    int A,B ;
    cin>>A>>B ;
    if(A>=H&&B>=W) ans++ ;
  }
  
  cout<<ans<<endl ;
  
  return 0 ;
}

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


namespace AtC
{
    class Program
    {
        static void Main(string[] args)
        {
            var N = ReadInt();
            var A = ReadIntArray();

            int minusCount = 0;
            for (int i = 0; i < A.Length; i++)
                if (A[i] < 0)
                    minusCount++;

            long sum = 0;
            int min = int.MaxValue;
            for (int i = 0; i < A.Length; i++)
            {
                var abs = Math.Abs(A[i]);
                sum += abs;
                if (abs < min) min = abs;
            }

            sum -= min;

            sum += min * (minusCount % 2 == 0 ? 1 : -1);
            Out(sum);
        }

        static int[] ReadIntArray()
        {
            return Console.ReadLine().Split(' ').Select(int.Parse).ToArray();
        }

        static int ReadInt()
        {
            return int.Parse(Console.ReadLine());
        }

        static long[] ReadLongArray()
        {
            return Console.ReadLine().Split(' ').Select(long.Parse).ToArray();
        }

        static long ReadLong()
        {
            return long.Parse(Console.ReadLine());
        }

        static string ReadString()
        {
            return Console.ReadLine();
        }

        static void Out(object o)
        {
            Console.WriteLine(o);
        }
    }

    static class EnumerableExtension
    {
        public delegate void Function<in T>(T val);

        public static void ForEach<T>(this IEnumerable<T> enumerable, Function<T> function)
        {
            foreach (var x in enumerable)
            {
                function(x);
            }
        }
    }
}

Measured memory_bytes: 30044
fun main() = Thread(null, ::soundhound2018summerqualA, "(^o^)", 128 * 1024 * 1024).apply { start() }.join()

@OptIn(ExperimentalStdlibApi::class)
fun soundhound2018summerqualA() {
    val (a, b) = readLine()!!.split(" ").map { it.toInt() }

    val answer = when {
        a + b == 15 -> "+"
        a * b == 15 -> "*"
        else -> "x"
    }

    println(answer)
}


Measured memory_bytes: 36508
#include <iostream>
using namespace std;
int main()
{
    int k,s,z;
    cin>>k>>s;
    int c=0;
    for(int i=0; i<=k; i++)
    {
        for(int j=0; j<=k; j++){
            z=s-i-j;
        if(z>=0&&z<=k)
            c+=1;
        }
    }
    cout<<c;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
using namespace std;
int main() {
    int i,j,n,a,b,c,x;
    int flag=0;
    int count=0;
    cin>>a>>b>>c>>x;
for(i=0; i<=a; i++){
    for(j=0; j<=b; j++){
        for(n=0; n<=c; n++){
            if(i*500+j*100+n*50==x){++count;}
        }
    }
}
cout<<count;
    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define endl "\n"
#define fastio ios_base::sync_with_stdio(0);  cin.tie(0) ; cout.tie(0);
#define debug(x) cout << #x << " : " << x << endl;
#define pi 3.14159265359
#define pb push_back
#define eb emplace_back
#define mp make_pair
#define F first
#define S second
using ll = long long int;
using db = double;
typedef pair<ll,ll> pll;
typedef pair<int,int> pii;
typedef vector<ll> vl;
typedef vector<int> vi;
typedef vector<bool> vb;
const int MOD = 1e9+9;

void solve()
{
    int a;
     cin >> a;
     cout << ( a + a*a + a*a*a) << endl;
}

int main()
{

    fastio;

    // ll t;
    // cin >> t;
    // while(t--)
       solve();
    return 0;
}

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

int main()
{
    char c;
    cin>>c;

    if((c=='a') || (c=='e') || (c=='i') || (c=='o')|| (c=='u'))
    {
        cout<<"vowel";
    }
    else
    {
        cout<<"consonant";
    }


    return 0;
}


Measured memory_bytes: 256
import java.util.Scanner;

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

        String s, text[];
        text = new String[10000000];
        int count = 0;
        s = sc.next();

        int i = 0;
        while(true){
            text[i] = sc.next();

            if(text[i].equals("END_OF_TEXT")){
                break;
            }

            text[i] = text[i].toLowerCase();

            if(text[i].equals(s)){
                count++;
            }

            ++i;
        }
        System.out.println(count);
    }
}



Measured memory_bytes: 65436
import java.util.Arrays;
import java.util.Scanner;
import java.util.regex.Pattern;
import java.util.stream.IntStream;

public class Main {
    public static void main(String[] args) {
        Scanner stdin = new Scanner(System.in);
        int n = Integer.parseInt(stdin.nextLine());
        int[] l = Pattern.compile(" ").splitAsStream(stdin.nextLine()).mapToInt(Integer::parseInt).toArray();

        Arrays.sort(l);
        int ans = IntStream.range(0, l.length).filter(i -> i % 2 == 0).map(i -> l[i]).sum();
        System.out.println(ans);
    }
}


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

using ll = long long;

int main()
{
    ll A, B; cin >> A >> B;

    if (A == B)
    {
        cout << 1 << endl;
        return 0;
    }

    ll T = 1LL << 59;
    while ((A & T) == (B & T))
        T >>= 1;

    A &= 2*T - 1;
    B &= 2*T - 1;

    ll S = T;
    while (S != 1 && (B & (S >> 1)) == 0)
        S >>= 1;

    // [A, T) union [T, T+S) union [T+A, 2T)
    cout << (S > A ? (2*T-A) : (T+S - A) + (T-A)) << endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define DUMP(x)  cout << #x << " = " << (x) << endl;
#define FOR(i, m, n) for(int i = m; i < n; i++)
#define IFOR(i, m, n) for(int i = n - 1; i >= m; i-- )
#define REP(i, n) FOR(i,0,n)
#define IREP(i, n) IFOR(i,0,n)
#define FOREACH(x,a) for(auto& (x) : (a) )
#define ALL(v) (v).begin(), (v).end()
using namespace std;
typedef long long ll;
const ll INF = 1e18;
/* テンプレートここまで */

int main() {
  string s; cin >> s;
  REP(i,s.size()){
    if(i%2==0) cout << s[i];
  }
  cout << endl;
}

Measured memory_bytes: 512
program Project1;

{$APPTYPE CONSOLE}

uses
  SysUtils;
var
  h,w,i,j,count,x,y,sw,m,n,a,b,c:Integer;
  //a,b:array of string;
  o,e,pa:string;
  tf:Boolean;
begin
  try
    { TODO -oUser -cConsole Main : ここにコードを記述してください }
    Readln(o);
    Readln(e);

    pa:='';
    for i := 1 to (length(o)+length(e)-abs(length(o)-length(e))) div 2 do begin
      pa:=pa+o[i];
      pa:=pa+e[i];
    end;

    if length(o)>length(e) then
      pa:=pa+o[length(o)]
    else if length(o)<length(e) then
      pa:=pa+o[length(e)];

    Writeln(pa);
    Readln;
  except
    on E: Exception do
      Writeln(E.ClassName, ': ', E.Message);
  end;
end.


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main()
{
    ios::sync_with_stdio(false);
    std::cin.tie(nullptr);
    string s;
    cin >> s;
    int a = s[0] - '0';
    int b = s[1] - '0';
    int c = s[2] - '0';
    int d = s[3] - '0';

    if(a + b + c + d == 7)
        cout << a << '+' << b << '+' << c << '+' << d << "=7" << endl; 
    else if(a + b + c - d == 7)
        cout << a << '+' << b << '+' << c << '-' << d << "=7" << endl;
    else if(a + b - c + d == 7)
        cout << a << '+' << b << '-' << c << '+' << d << "=7" << endl;
    else if(a - b + c + d == 7)
        cout << a << '-' << b << '+' << c << '+' << d << "=7" << endl;
    else if(a + b - c - d == 7)
        cout << a << '+' << b << '-' << c << '-' << d << "=7" << endl;
    else if(a - b + c - d == 7)
        cout << a << '-' << b << '+' << c << '-' << d << "=7" << endl;
    else if(a - b - c + d == 7)
        cout << a << '-' << b << '-' << c << '+' << d << "=7" << endl;
    else 
        cout << a << '-' << b << '-' << c << '-' << d << "=7" << endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops") 
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp> 
#define int long long
#define fr(i,a,b) for(int i = a ; i <= b ; ++i)
#define rep(i, a, b) for(int i = a; i < (b); ++i)
#define trav(a, x) for(auto& a : x)
#define all(x) begin(x), end(x)
#define rall(x) (x).rbegin(), (x).rend()
#define sz(x) (int)(x).size()
#define pb push_back
#define fst first
#define snd second
using namespace __gnu_pbds;
using ordered_set =
 tree<int, null_type,less<int>,
 rb_tree_tag,tree_order_statistics_node_update>;
//find_by_order(k):returns iterator to kth element starting from 0
//order_of_key(k):returns count of elements strictly smaller than k
typedef long long ll;typedef pair<int, int> pii;
typedef vector<int> vi;typedef long double ld;
template<class T>
using min_heap = priority_queue<T,vector<T>,greater<T>>; 
template<typename T> T gcd(T a, T b){return(b?__gcd(a,b):a);}
template<typename T> T lcm(T a, T b){return(a*(b/gcd(a,b)));}
template<typename T> 
void remdup(vector<T>& v) {
	sort(all(v)); v.erase(unique(all(v)), v.end());
}
template<typename T> void re(vector<T> &v) {trav(i,v) cin >> i;}
void unsyncIO() { ios_base::sync_with_stdio(0); cin.tie(0); }
#ifdef np
#include "C:\Users\navodit\Desktop\mycodes\pr.h"
#else
#define trace(...)
#endif

#define MOD 1000000007  





void solve(){
	int a, b ;
	cin >> a >> b; 
	int g = gcd(a,b);
	map<int,int> pf;
	for(int i = 2 ; i*i<=g ;++i){
		while(g%i==0) pf[i]++, g/=i;
	}
	if(g!=1) pf[g]++;
	int ans = sz(pf) ;
	cout << ans + 1 << endl;
}

signed main() {
	unsyncIO();
	int tt =1 ;
	// cin >> tt;
	rep(i,0,tt) solve();













#ifdef np
	cout <<endl<<endl<< "Time elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " s.\n";
#endif
	return 0;
}


Measured memory_bytes: 3668
#include<bits/stdc++.h>
#include<cmath>
#define SZ(x) ((int)x.size())
#include<vector>
#include<set>
#define ll long long 
#define pb push_back
#include<string>
#include<cctype>
using namespace std;
	
int main()
{
	 ios_base::sync_with_stdio(false);
	cin.tie(0);
int a,b;
cin>>a>>b;
cout<<a*b<<endl;

}


Measured memory_bytes: 3652
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main(){
	int N;
	while(cin >> N){
		vector<int> a(N), b(N);
		for(auto& t : a) cin >> t;
		for(auto& t : b) cin >> t;
		int res = 0;
		for(int i=0;i<29;i++){
			vector<int> c = b;
			for(auto& t : c) t %= (1 << (i+1));
			sort(c.begin(), c.end());
			int cnt = 0;
			for(int j=0;j<N;j++){
				int sub = a[j] % (1 << (i+1));
				auto p1 = lower_bound(c.begin(), c.end(), (1<<i) - sub);
				auto p2 = lower_bound(c.begin(), c.end(), 2*(1<<i) - sub);
				auto p3 = lower_bound(c.begin(), c.end(), 3*(1<<i) - sub);
				cnt += distance(p1, p2) + distance(p3, c.end());
				cnt %= 2;
			}
			if(cnt%2) res |= (1 << i);
		}
		cout << res << endl;
	}
}


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

typedef pair<int,int> PAIR;
const int INF=100000000;
long long cnt[100001];
 
int main() {
    int n;
    long long k;
    cin>>n>>k;
    for (int i = 0; i < n; ++i){
        int a,b;
        cin>>a>>b;
        cnt[a]+=b;
    }

    for (int i = 1; i <= 100000; ++i){
        if(k<=cnt[i]){
            cout<<i<<endl;
            return 0;
        }else
            k-=cnt[i];
    }

}

Measured memory_bytes: 1024
# ??\?????????
N = int(input())
A = list(map(int, input().split()))


# ?????\?????????
def insertion_sort(A, N):

    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)

print(*A)
insertion_sort(A, N)

Measured memory_bytes: 8116
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>

using namespace std;

int main(){
  int a,b;
  cin >> a >> b;
  if(a <10 && b < 10){
    cout << a * b << endl;
  }
  else{
    cout << -1 << endl;
  }
}


Measured memory_bytes: 256
n = int(input())
a = list(map(int, input().split()))

a.sort(reverse=True)

point = a[0]
cnt = 0
k = 1
for i in range(1, n-1):
    point += a[k]
    cnt += 1
    if cnt == 2:
        cnt = 0
        k += 1

print(point)


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

int main() {
  string S, ns;
  cin >> S;
  int ng = 0;
  int prex = 0;
  size_t slen = S.length();
  for(int i=0;i<slen-1;++i) {
    if (S[i]=='A') {
      ns.push_back('A');
      prex = 0;
    } else if ((S[i] == 'B') && (S[i+1] == 'C')){
      ns.push_back('D');
      ++i;
      prex = 0;
    } else {
//      if (prex == 0) {
        ns.push_back('X');
        prex = 1;
//      }
    }
  }
//  cout << ns << endl;
  size_t nslen = ns.length();
  int dcnt = 0;
  int64_t t=0;
  for(int i=nslen-1;i>=0;--i) {
    if( ns[i]=='D') {
      ++dcnt;
    } else if (ns[i] == 'A') {
      t += dcnt;
    } else if (ns[i] == 'X') {
      dcnt=0;
    }
  }
  cout << t << endl;
      

    
  return 0;
}
  

Measured memory_bytes: 776