akhauriyash/Code-Regression huggingface dataset:
#include<bits/stdc++.h>
using namespace std;
char a[7][7];
char b[7][7];
int n,m;int k;
void init(){
    	cin>>n>>m>>k;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			cin>>a[i][j];
		}
	}
}
void R(int x){
	for(int i=0;i<m;i++){
		b[x][i] = '.';
	}
}
void C(int x){
	for(int i=0;i<n;i++){
		b[i][x] = '.';
	}
}
void solve(int x,int y){
	for(int i=0;i<n;i++){
		if(x>>i&1){
			R(i);
		}
	}
	for(int j=0;j<m;j++){
		if(y>>j&1){
			C(j);
		}
	}
}
int cnt(){
	int ans =0;
	for(int i=0;i<n;i++){
		for(int j=0;j<m;j++){
			if(b[i][j] == '#') ans++;
		}
	}
	return ans;
}

void run(){
    int ans = 0;
	for(int i=0;i<(1<<n);i++){
		for(int j=0;j<(1<<m);j++){
			memcpy(b,a,sizeof(a));
			solve(i,j);
			if (cnt() == k) ans++;
		}
	}
	cout<<ans<<endl;
}
int main(){
    init();
    run();
	return 0;
}


Measured memory_bytes: 3592
#include <stdio.h>

int main(void) {
    int N, M;
    scanf("%d%d", &N, &M);

    int ans = 0;
    ans += N*(N - 1) / 2;
    ans += M*(M - 1) / 2;
    printf("%d\n", ans);

    return 0;
}

Measured memory_bytes: 1724
# include <cstdio>
# include <algorithm>
# include <cstring>
# include <cmath>
# include <climits>
# include <iostream>
# include <string>
# include <queue>
# include <vector>
# include <set>
# include <map>
# include <cstdlib>
# include <stack>
# include <ctime>
using namespace std;

# define Rep(i,a,b) for(int i=a;i<=b;i++)
# define _Rep(i,a,b) for(int i=a;i>=b;i--)
# define mct(a,b) memset(a,b,sizeof(a))
# define gc getchar()
typedef long long ll;
const int N=1e5+5;
const int inf=0x7fffffff;
const double eps=1e-7;
template <typename T> void read(T &x){
	x=0;int f=1;
	char c=getchar();
	for(;!isdigit(c);c=getchar())if(c=='-')f=-1;
	for(;isdigit(c);c=getchar())x=(x<<1)+(x<<3)+c-'0';
	x*=f;
}
int n,ans;
int a[N],b[N],c[N];
int main()
{
	read(n);
	Rep(i,1,n)read(a[i]);
	Rep(i,1,n)read(b[i]);
	Rep(i,1,n-1)read(c[i]);
	int last=-100;
	Rep(i,1,n){
		ans+=b[a[i]];
		if(a[i]==last+1)ans+=c[last];
		last=a[i];
	}
	printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 256
def between12(m):
    if 0 < m <= 12:
        return True
    else:
        return False

S = input()
left = int(S[0] + S[1])
right = int(S[2] + S[3])

if between12(left):
    if between12(right):
        print('AMBIGUOUS')
        exit()
    else:
        print('MMYY')
        exit()
else:
    if between12(right):
        print('YYMM')
        exit()

print('NA')

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

using namespace std;
int jul(int x)
{
    if(x>0)
        return x;
    else
        return -x;
}
int main() {
    int n, x, y, a[2100][2100]={}, i, j, b[2100]={}, t;
    scanf("%d %d %d", &n, &x, &y);
    for(i=1;i<=n;i++)
    {
        for(j=i+1;j<=n;j++)
        {
            a[i][j]=jul(j-i);
            t=1+jul(x-i)+jul(y-j);
            if(a[i][j]>t)
                a[i][j]=t;
        }
    }
    
    
    
    
    
    for(i=1;i<=n;i++)
    {
        for(j=i+1;j<=n;j++)
            b[a[i][j]]++;
    }
    
    
    for(i=1;i<=n-1;i++)
        printf("%d\n", b[i]);
    return 0;
}

Measured memory_bytes: 17536
import math
import os
import sys
from decimal import *
from fractions import gcd

if os.getenv("LOCAL"):
    sys.stdin = open("_in.txt", "r")

sys.setrecursionlimit(2147483647)
INF = float("inf")

A, B, C, D = list(map(int, sys.stdin.readline().split()))
A = Decimal(A)
B = Decimal(B)
C = Decimal(C)
D = Decimal(D)


def count(n):
    st = math.ceil(A / n)
    en = math.floor(B / n)
    return max(0, en - st + 1)


print(B - A + 1 - (count(C) + count(D) - count(C * D // gcd(C, D))))

#
# N = int(sys.stdin.readline())
# A, B = list(zip(*[map(int, sys.stdin.readline().split()) for _ in range(N)]))


Measured memory_bytes: 5076
#include <iostream>
using namespace std;
bool carry = false;
int main() {
  ios::sync_with_stdio(0);
  cin.tie(0);
  string S;
  cin >> S;
  int N = S.size();
  int ans = 0;
  int flag = 1;
  for (int i = 0; i < N-1; i++) {
    int n = S[i] - '0';
    if (n < 4) {
      if (flag == -1) {
        ans += n + 1;
      } else {
        ans += n;
      }
      flag = 1;
    }
    else if (n > 5) {
      if (flag == 1) {
        ans += 10 - n;
      }
      else {
        ans += 9 - n;
      }
      flag = -1;
    } else if(n == 4) {
      if (flag == -1) {
        flag = 0;
        ans += 5;
      }
      else {
        flag = 1;
        ans += 4;
      }
    } else if (n == 5) {
      if (flag == 1) {
        flag = 0;
        ans += 5;
      } else {
        flag = -1;
        ans += 4;
      }
    }
  }
  int last = S[N - 1] - '0';
  if(last <= 4) {
    if(flag == -1) {
      ans += last + 1;
    } else {
      ans += last;
    }
  } else if (last == 5) {
    ans += 5;
  } else {
    if(flag == 1) {
      ans += 11 - last;
    } else {
      ans += 10 - last;
    }
  }
  printf("%d\n", ans);
  return 0;
}


Measured memory_bytes: 1948
a,b,c=gets.split.map(&:to_i)
flag=true
list=[]
1.upto(101) do |i|
    mod=(b*i+c)%a
    if mod==0
        break;
    elsif !list.include?(mod)
        list.push(mod)
    else
        flag=false
        break;
    end
end

puts flag==true ? 'YES':'NO'

Measured memory_bytes: 3836
#include<bits/stdc++.h>
using namespace std;
#define Yes(n) cout << ((n) ? "YES" : "NO") << endl
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(V) (V).begin(),(V).end()
#define SORT(V) sort(ALL(V))

//vector<string> split(string,string);

//template<typename T>
//void swap(T*,T*);

int main()
{
    string s,t,r;
    cin >> s >> t >> r;
    if(s[s.size() - 1] == t[0] && t[t.size() - 1] == r[0])
        Yes(true);
    else
    {
        Yes(false);
    }
    
}

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

int main(){
 int W, H, x, y, r;
 cin >> W >> H >> x >> y >> r;
 if(x + r <= W && y + r <= H && x - r >= 0 && y - r >= 0) cout << "Yes\n";
 else cout << "No\n";
  return 0;
}

Measured memory_bytes: 3092
import sys
from collections import Counter

import numba as nb
import numpy as np

input = sys.stdin.readline


@nb.njit("i8(i8[:],i8[:])", cache=True)
def solve(keys, values):
    MAX_A = 10 ** 6
    divisible = [False] * (MAX_A + 1)
    ans = 0
    for k, v in zip(keys, values):
        if v == 1 and not divisible[k]:
            ans += 1
        for i in range(k, MAX_A + 1, k):
            divisible[i] = True
    return ans


def main():
    N = int(input())
    A = list(map(int, input().split()))

    A.sort()
    c = Counter(A)
    keys = np.array(tuple(c.keys()), dtype=np.int64)
    values = np.array(tuple(c.values()), dtype=np.int64)

    ans = solve(keys, values)
    print(ans)


if __name__ == "__main__":
    main()


Measured memory_bytes: 132020
#include <bits/stdc++.h>
#define pb push_back
#define mp make_pair
#define ff first
#define ss second
#define sz size()
#define all(a) a.begin(), a.end()
#define allr(a) a.rbegin(), a.rend()
#define mod 1000000007
#define _for(it, a) \
  for (__typeof(a.begin()) it = a.begin(); it != a.end(); ++it)

using namespace std;

int N;

int main() {
  cin >> N;
  long long a[100005];
  for (int n = 0; n < N; ++n) scanf("%lld", &a[n]);
  long long res = 0;
  for (int n = 0; n < N;) {
    if (a[n] == 0)
      ++n;
    else {
      int m = n;
      long long c = 0;
      while (m < N && a[m] != 0) {
        c += a[m];
        ++m;
      }
      res += c / 2;
      n = m;
    }
  }
  cout << res << endl;
  return 0;
}

// Built using Sublime-CHelper plug-in (beta)


Measured memory_bytes: 1024
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using pii=pair<int,int>;
#define For(i,a,b) for(int i=a;i<=b;i++)
#define F first
#define S second
#define all(x) x.begin(),x.end()
#define sz(x) ((ll)x.size())
#define MOD (ll)(998244353)
#define INF (2e9)
#define EPS (1e-6)
#ifdef LOCAL_TEST
#define debug(...) do{\
	cerr<<__PRETTY_FUNCTION__<<" - "<<__LINE__<<\
	" : ("#__VA_ARGS__<<") = ";\
	_OUT(__VA_ARGS__);\
}while(0)
template<typename T>void _OUT(T x){cerr<<x<<endl;}
template<typename T,typename...I>void _OUT(T x,I ...tail){cerr<<x<<", ";_OUT(tail...);}
#else
#define debug(...)
#endif

void INIT(){
#ifdef LOCAL_TEST
	freopen("D:\\input.in","r",stdin);
	freopen("D:\\output.out","w",stdout);
	freopen("D:\\error.out","w",stderr);
#endif
	ios::sync_with_stdio(false);
	cin.tie(0);
}

ll gcd(ll a,ll b) { return b==0?a:gcd(b,a%b); }
ll lcm(ll a,ll b) { return a/gcd(a,b)*b; }
ll fpow(ll b,ll p){
	b%=MOD;
	ll ans=1;
	while(p>0){
		if(p&1) ans=(ans*b)%MOD;
		p/=2;
		b=(b*b)%MOD;
	}
	return ans;
}

int32_t main() {
	INIT();
	//code...
	int h,w,K; cin>>h>>w>>K;
	vector<string> v(h);
	for(auto &i:v) cin>>i;
	int ans=INF;
	For(cut,1<<(h-1),(1<<h)-1){
		int cnt=0;
		For(i,0,h-2) if(cut&(1<<i)) cnt++;
		//debug(cut,cnt);
		vector<int> rem(cnt+1),now(cnt+1);
		bool ac=true,upd=false;
		For(i,0,w-1){
			upd=false;
			for(auto &it:now) it=0;
			int k=0;
			For(j,0,h-1){
				now[k]+=v[j][i]-'0';
				if(cut&(1<<j)){
					if(now[k]>K){
						ac=false;
						debug(cut,j);
						break;
					}
					if(now[k]+rem[k]>K){
						upd=true;
					}
					k++;
				}
			}
			if(!ac) break;
			if(upd){
				//debug(i);
				//for(auto &it:rem) cerr<<it<<" "; cerr<<"\n";
				For(it,0,sz(rem)-1) rem[it]=now[it];
				cnt++;
				//for(auto &it:rem) cerr<<it<<" "; cerr<<"\n";
			}
			else{
				For(it,0,sz(rem)-1) rem[it]+=now[it];
			}
		}
		//debug(cnt,ans);
		if(ac) ans=min(ans,cnt);
		//cerr<<"\n";
	}
	cout<<ans<<"\n";
	return 0;
}


Measured memory_bytes: 3600
import collections

n = int(input())
s = collections.Counter([input() for _ in range(n)])
m = int(input())
t = collections.Counter([input() for _ in range(m)])

s.subtract(t)

if s.most_common()[0][1] > 0:
  ans = s.most_common()[0][1]
else:
  ans = 0
print(ans)

Measured memory_bytes: 3316
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define Mod  1000000007
ll fast(ll n,ll a,ll M)
{
    if(n==0)
        return 1;
    else if(n==1)
        return a;
    else
    {
        ll res=fast(n/2,a,M);
        if(n%2==0)
        {
            return ((res%M)*(res%M))%M;
        }
        else
        {
            return (((((res%M)*a)%M)*res)%M);
        }
    }
}
int main()
{
   ll n;
   cin>>n;
   string S;
   cin>>S;
   ll ans=0;
   ll i,j,k;

   map<char,ll> cnt;
   cnt['R']=0;
   cnt['G']=1;
   cnt['B']=2;
   map<ll,vector<ll> > vec;
   ll pref[n][3];
   memset(pref,0,sizeof(pref));
   for(i=0;i<n;i++)
   {
       pref[i][cnt[S[i]]]++;
   }
   for(i=1;i<n;i++)
   {
       for(j=0;j<3;j++)
       {
           pref[i][j]+=pref[i-1][j];
       }
   }
   for(i=0;i<n;i++)
   {
       for(j=1;j<=i-1;j++)
       {
           if(S[i]!=S[j])
           {
               ll d;
               for(k=0;k<3;k++)
               {
                   if(k!=cnt[S[i]]&&k!=cnt[S[j]])
                   {

                      d=k;
                      break;
                   }
               }

               if(vec[d].size()!=0)
               {
                ans+=pref[j-1][d];
               ll lo=0,hi=vec[d].size()-1;
               ll mid,ind=-1,e=2*j-i;
               while(lo<=hi)
               {
                   mid=(lo+hi)/2;
                   if(vec[d][mid]==e)
                   {
                       ind=1;
                       break;
                   }
                   else if(vec[d][mid]<e)
                   {
                       lo=mid+1;
                   }
                   else
                   {
                       hi=mid-1;
                   }
               }
               if(ind==1)
               {
                   ans--;
               }
               }
           }
       }
       vec[cnt[S[i]]].push_back(i);
   }
   cout<<ans;
}


Measured memory_bytes: 3728
#include <iostream>
#include <sstream>
int n,m,sum;
bool f;

void calc(int x,int A[]){
  if(sum!=m){
    for(int j=x;j<n;j++){
      if(sum+A[j]<=m){
	sum+=A[j];
	if(sum==m){
	  f=true;
	}
	if(j+1<n){
	  calc(j+1,A);
	}
	sum-=A[j];
      }
    }
  }
}


int main () {
  int q;
  std::cin>>n;
  int A[n];
  for(int i=0;i<n;i++){
    std::cin>>A[i];
  }

  std::cin>>q;
  for(int i=0;i<q;i++){
    std::cin>>m;
    sum=0;
    f=false;
    calc(0,A);
    if(f){
      std::cout<<"yes\n";
    }else{
      std::cout<<"no\n";
    }
  }

  return 0;
}


Measured memory_bytes: 3084
#include <iostream>
#include <algorithm>
#include <cmath>
#include <vector>
#include <stack>
#include <queue>
#include <map>
#include <unordered_map>
#include <cmath>
#include <numeric>
#include <iomanip>
#include <set>
#include <string.h>

using namespace std;

typedef long long ll;

#define REP(i,n) for(ll (i)=0;(i)<(n);(i)++)
#define REP3(i,st,en) for(ll (i)=(st);(i)<(en);(i)++)

using P = pair<ll, ll>;
const int MOD = 1e9+7;
const ll INF = 1e+14;
const double PI = 3.14159265349;

// Extended Print Func
template<class T> std::ostream& operator<<(std::ostream& os, const std::vector<T>& input){
    os << "[ ";
    REP(i, input.size()){
        os << input[i];
        if (i < input.size()-1) { os << " "; }
    }
    os << " ]";
    return os;
}
void print() { std::cout << "\n"; }
template<class T, class... A> void print(const T& first, const A&... rest) { std::cout << first << " "; print(rest...); }
template<class... A> void print(const A&... rest) { print(rest...); }



int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  ll N;
  cin >> N;
  cout << ((N%2==0) ? N/2 : N/2+1) << "\n";
  return 0;
}


Measured memory_bytes: 256
import java.util.*;
  
public class Main {
    Scanner sc = new Scanner(System.in);
  
    public static void main(String[] args) {
        new Main(); 
    }
  
    public Main() {
        new aoj1194().doIt();
    }
    class aoj1194{
    	int po_h[] = new int[21];
    	int ne_h[] = new int[21];
    	void clear(){
    		for(int i = 0;i < 21;i++){
    			po_h[i] = 0;
    			ne_h[i] = 0;
    		}
    	}
    	void bar(int n){
    		for(int i = 0;i < n;i++){
    			int xl = sc.nextInt();
    			int xr = sc.nextInt();
    			int h = sc.nextInt();
    			if(xr <= 0){
    				for(int j = -xr;j < -xl;j++){
    					ne_h[j] = Math.max(ne_h[j], h);
    				}
    			}else if(xl >= 0){
    				for(int j = xl;j < xr;j++){
    					po_h[j] = Math.max(po_h[j], h);
    				}
    			}else{
    				for(int j = 0;j < -xl;j++){
    					ne_h[j] = Math.max(ne_h[j], h);
    				}
    				for(int j = 0;j < xr;j++){
    					po_h[j] = Math.max(po_h[j], h);
    				}
    			}
    		}
    	}
    	void check(){
    		for(int i = 0;i < 21;i++){
    			System.out.print(ne_h[i]);
    		}
    		System.out.println();
    		for(int i = 0;i < 21;i++){
    			System.out.print(po_h[i]);
    		}
    		System.out.println();
    		System.out.println();
    	}
    	double ans(int r){
    		double result = 10000;
    		for(int i = 0;i < r;i++){
    			double line = Math.min(ne_h[i], po_h[i]);
    			double high = (double)r - Math.sqrt((double)(r * r - i*i));
    			line = line + high;
    			result = Math.min(result, line);
//    			System.out.println(i+"??????:"+result+" "+high+" "+line);
    		}
    		return result;
    	}
    	void doIt(){
     		while(true){
     			int r = sc.nextInt();
     			int n = sc.nextInt();
     			if(r + n == 0)break;
     			clear();
     			bar(n);
//     			check();
     			System.out.printf("%.4f\n",ans(r));
     		}
    	}
    }
}

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

typedef long long ll;
#define MOD1 1000000007
#define MOD2 1000000009
#define FOR(a,b) for(int i=a;i<b;i++)
#define nl "\n"

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(NULL);
  ll d, t, s;
  cin >> d >> t >> s;
  if (t * s >= d)
    cout << "Yes";
  else
    cout << "No";
  return 0;
}



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

using namespace std;

#define reps(i,f,n) for(int i=f;i<int(n);i++)
#define rep(i,n) reps(i,0,n)


typedef long long ll;

int n,s;

bool input(){
         cin>>n>>s;
	 return n!=0;
}

const int N = 101;
const int M = 10;
const int K = 1001;

ll memo[N+10][M][K];

ll saiki(int st, int rn, int rs){
  
  if(memo[st][rn][rs]!=-1)return memo[st][rn][rs];

  if(rn==0){
    if(rs==0)return 1;
    return 0;
  }

  ll ret = 0;
  reps(i,st,N){
    if(rs-i<0)break;
    ret += saiki(i+1, rn-1, rs-i);
  }

  //  printf("st=%d rn=%d rs=%d ret=%d\n",st,rn,rs,ret);

  return memo[st][rn][rs] = ret;
}


ll  solve(){
  rep(i,N+10)rep(j,M)rep(k,K)memo[i][j][k]=-1;

  return saiki(0, n, s);
}

int main(){
  while(input()){
    cout<<solve()<<endl;
  }
}

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

int sift(int l, int r);

int main(){
	
	int n, a, i, j, ret, max, m_id, max2;
	int *A;
	
	max=m_id=max2=0;
		
	ret=scanf("%d", &n);
	
	if( ret == EOF ) {
    
    return 1;
		
  	}
	
	A=(int *)malloc(sizeof(int)*n);
	
	if(A == NULL){return 1;}
	
	for(i=0; i < n; i++){
		
		ret=scanf("%d", A+i);
		
		if( ret == EOF ) {
    
	    return 1;
			
	  	}
		
	}
	
	for(i=0; i < n; i++){
		if(max < *(A+i)){
			
			max=*(A+i);
			m_id=i;
			
		}
		
	}
	
	for(i=0; i < n; i++){
		
		if(max2 < *(A+i) && m_id != i){
			
			max2=*(A+i);
			
		}
		
	}
	
	
	for(i=0; i < n; i++){
		
		if(m_id != i){printf("%d\n", max);}
		else{printf("%d\n", max2);}

	}
	
	free(A);
	
	return 0; 
	
}




Measured memory_bytes: 2304
#include <bits/stdc++.h>
#define pb push_back
#define SZ(x) ((int)(x.size()))
#define FOR(i,s,n) for (ll i = (s); (i) < (n); ++i)
#define FORD(i,s,l) for (ll i = (s); (i) >= l; --i)
#define F first
#define S second
#define TC int __tc; cin >> __tc; FOR(case_num,1,__tc+1)
#define TEST(x,i) ((x)&(1ll<<(i)))
#define SET(x,i) ((x)|(1ll<<(i)))
#define FLIP(x,i) ((x)^(1ll<<(i)))
#define CLEAR(x,i) ((x)&~(1ll<<(i)))

const double pi = 4 * atan(1);
using namespace std;
typedef long long ll;

const ll MOD = 1000000007;
const int MAXN = 200005;

int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	
	string s;
	cin >> s;
	
	vector<int> num;
	for (auto c : s){
		num.pb(c-'0');
	}
	
	ll t = 0;
	for(int i = 0; i < (1<<(num.size()-1)); i++){
		ll c = 0;
		int b = SET(i,num.size()-1);
		for (int j = 0; j < num.size(); j++){
			c=c*10+num[j];
			if (TEST(b,j)){
				t+=c;
				c = 0;
			}
		}
	}
	cout << t << "\n";

}


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

const int MAXN = 100005;

int N, A[MAXN], B[MAXN];

int main(){
	scanf("%d", &N);
	for(int i = 0; i < N; i++)
		scanf("%d", &A[i]);
	for(int i = 0; i < N; i++)
		scanf("%d", &B[i]);
		
	vector < pair <int, int> > v;
	for(int i = 0; i < N; i++)
		v.push_back(make_pair(B[i], A[i]));
	sort(v.begin(), v.end());
	
	for(int i = 0; i < N; i++){
		A[i] = v[i].second;
		B[i] = v[i].first;
	}
	
	set < pair <int, int> > w;
	for(int i = 0; i < N; i++)
		w.insert(make_pair(A[i], i));
		
	set <int> s;
	
	int cnt = 0;
	for(int i = 0; i < N; i++){
		while(!w.empty() && w.begin()->first <= B[i]){
			s.insert(w.begin()->second);
			w.erase(w.begin());
		}
		
		if(A[i] <= B[i]){
			s.erase(i);
			continue;
		}
		
		if(s.empty()){
			printf("No\n");
			return 0;
		}
		
		w.erase(make_pair(A[i], i));
		w.insert(make_pair(A[i], *prev(s.end())));
		
		swap(A[i], A[*prev(s.end())]);
		
		s.erase(prev(s.end()));
		
		cnt++;
	}
	
	if(cnt <= N - 2)printf("Yes\n");
	else printf("No\n");
	
	return 0;
}


Measured memory_bytes: 6516
c = []
c.append([int(i) for i in input().split()])
c.append([int(i) for i in input().split()])
c.append([int(i) for i in input().split()])

for i in range(2):
    a0 = c[i][0] - c[i+1][0]
    a1 = c[i][1] - c[i+1][1]
    a2 = c[i][2] - c[i+1][2]
    if a0 != a1 or a1 != a2:
        print("No")
        exit()

for i in range(2):
    a0 = c[0][i] - c[0][i+1]
    a1 = c[1][i] - c[1][i+1]
    a2 = c[2][i] - c[2][i+1]
    if a0 != a1 or a1 != a2:
        print("No")
        exit()
print("Yes")


Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <vector>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <algorithm>
#include <cstdio>
#include <utility>
#include <string>
#include <cmath>
#include <cstdlib>
#include <cstring>

using namespace std;

typedef uint64_t u64;
typedef int64_t s64;
typedef uint32_t u32;
typedef int32_t s32;
typedef vector<s32> vs32;
typedef vector<u32> vu32;
typedef vector<s64> vs64;
typedef vector<u64> vu64;

const double PI=3.14159265358979323846;

#define MAX(x, y) ((x) < (y) ? (y) : (x))
#define MIN(x, y) ((x) > (y) ? (y) : (x))

#define rep(i, N) for(int i = 0; i < N; ++i)

#define CEIL(x, y) (((x) + (y) - 1) / (y))
#define MOD 1000000007ULL


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

    int a, b, c;
    cin >> a >> b >> c;

    cout << (a + b + c >= 22 ? "bust" : "win") << "\n";
    return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include <string>
#include<bits/stdc++.h>
#define ll long long int
#define ld long double
#define pb push_back
#define endl "\n"
#define mp make_pair
#define sz(v) (int)(v.size())
#define len(s) (int)(s.length())
#define M (ll)(1e9+7)
#define all(v) v.begin(),v.end()
#define fr(a,b,c) for(ll i=a;i<=b;i+=c)
#define inarr(arr,n); for(ll i=0;i<n;i++) cin >> arr[i];
#define outarr(arr,n); for(ll i=0;i<n;i++) cout<<arr[i]<<" ";
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
const ll inf = 9e18;
const ld pi = 2*acos(0.0); 
using namespace std;
ll power(ll a,ll n) 
{
    if(n==0){
        return 1;
    }
    ll p=power(a,n/2) % M;
    p = (p * p) % M;
    if (n%2==1)
    {
        p=(p*a)%M;
    }
    return p;
}
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
}
const int N=1e6;
vector <ll> sieve(N,0); 
void si() 
{
    sieve[1]=1;
    for(int i=2;i<N;i++){
        if(sieve[i]==0){
            for(int j=i;j<N;j+=i){
                sieve[j]=i;
            }
        }
    }
}
int main(){
    ios;
    ll n;
    cin>>n;
    ll tot=power(10,n)%M;
    ll minus=(2*power(9,n)%M-power(8,n)%M+M)%M;
    ll ans=(tot-minus+M)%M;
    cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 10988
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef string str;
 
int main(){
  int a; cin >> a;
  int ans;
  if(a%2 == 0){
      ans = a/2-1;
  }else{
      ans = a/2;
  }
  cout << ans << endl;
  return 0;
}

Measured memory_bytes: 256
#include<iostream>
#include<cmath>
#include<algorithm>
#include<vector>
using namespace std;
#define REP(i,b,n) for(int i=b;i<n;i++)
#define rep(i,n)   REP(i,0,n)
#define num first
#define ch  second

enum{S=0,C=1,H=2,D=3};

class card{
public:
  pair<int,char> d[5];

  bool isflush(){
    REP(i,1,5)if (d[0].ch != d[i].ch)return false;
    return true;
  }
  
  bool isspecialst(){
    if (d[0].num==1 && 
	d[1].num==10&&
	d[2].num==11&&
	d[3].num==12&&
	d[4].num==13)return true;
    return false;
  }
  bool isstraight(){
    if (d[0].num+1==d[1].num &&
	d[0].num+2==d[2].num&&
	d[0].num+3==d[3].num&&
	d[0].num+4==d[4].num)return true;
    return isspecialst();
  }
  
  bool islsf(){
    if (isspecialst()&&isflush())return true;
    return false;
  }
  
  bool issf(){
    if (isflush()&&isstraight())return true;
    return false;
  }
  
  //four,three,two,one
  bool isnum(int num){
    rep(i,5){
      int cnt=0;
      rep(j,5)if (d[i].num==d[j].num)cnt++;
      if (cnt == num)return true;
    }
    return false;
  }
  
  bool istwo(){
    if (d[0].num==d[1].num && d[2].num==d[3].num)return true;
    if (d[0].num==d[1].num && d[3].num==d[4].num)return true;
    if (d[1].num==d[2].num && d[3].num==d[4].num)return true;
    return false;
  }
  

  bool isfullhouse(){
    if (d[0].num==d[1].num &&
	d[2].num==d[3].num &&
	d[2].num==d[4].num)return true;
    if (d[0].num==d[1].num &&
	d[0].num==d[2].num &&
	d[3].num==d[4].num)return true;
    return false;
  }
  int judge(int *rate){
    sort(d,d+5);
    if (islsf()){
      return rate[9];
    }
    if (issf())return rate[8];
    if (isnum(4))return rate[7];
    if (isfullhouse())return rate[6];
    if (isflush())return rate[5];
    if (isstraight())return rate[4];
    if (isnum(3))return rate[3];
    if (istwo())return rate[2];
    if (isnum(2))return rate[1];
    return rate[0];
  }

};




main(){
  string tmp="A23456789TJQK";
  int yaku[255];
  for(int i=0;i<tmp.size();i++){
    yaku[tmp[i]]=i+1;
  }
  
  int tc=0;
  int rate[10];
  int table[4][14];
  int n;
  while(cin>>n){
    if(tc++)cout << endl;

    rep(i,4){
      REP(j,1,14)cin>>table[i][j];
    }

    rate[0]=0;
    for(int i=1;i<10;i++){
      cin>>rate[i];
    }

    card in;
    rep(i,n){
      int score=0;
      rep(j,5){
	char a,b;
	cin>>a>>b;
	in.d[j].num=yaku[a];
	int ac=0;
	if (b=='S')ac=S;
	if (b=='C')ac=C;
	if (b=='H')ac=H;
	if (b=='D')ac=D;
	in.d[j].ch=b;
	//	cout << ac <<" " << yaku[a] << endl;
	score+=table[ac][yaku[a]];
      }
      //      cout <<" score is " << score << " " << in.judge(rate) << endl;
      cout << score*in.judge(rate)<<endl;
    }
  }
  return false;
}

Measured memory_bytes: 924
module Main where

import           Control.Monad
import           Debug.Trace
import qualified Data.Vector                   as V
import qualified Data.Vector.Mutable           as VM
import qualified Data.Vector.Unboxed           as VU
import qualified Data.Vector.Unboxed.Mutable   as VUM
import           Data.List
import qualified Data.ByteString               as BS
import qualified Data.ByteString.Char8         as BSC8
import           Data.Char
import           Data.Maybe
import           Data.Ord
import qualified Data.Array                    as A
import qualified Data.Array.Unboxed            as AU
import qualified Data.Array.IO                 as AIO



getvuil :: IO (VU.Vector Int)
getvuil = VU.unfoldr (BSC8.readInt . BSC8.dropWhile isSpace) <$> BSC8.getLine
readi :: BSC8.ByteString -> Int
readi = fst . fromJust . BSC8.readInt
readil :: BSC8.ByteString -> [Int]
readil = map readi . BSC8.words
geti :: IO Int
geti = readi <$> BSC8.getLine
getil :: IO [Int]
getil = readil <$> BSC8.getLine

getNis :: Int -> IO [(Int, BSC8.ByteString)]
getNis 0 = return []
getisl n = do
    [aFst, aSnd] <- BSC8.words <$> BSC8.getLine
    next         <- (getisl (n - 1))
    return ((readi aFst, aSnd) : next)

il2ss :: [Int] -> String
il2ss = unwords . map show

il2sn :: [Int] -> String
il2sn = unlines . map show

main :: IO ()
main = do
    aS <- getLine
    let
        ret = if ((aS !! 0 == aS !! 1) && (aS !! 1 == aS !! 2))
            then "No"
            else "Yes"
    putStrLn ret




Measured memory_bytes: 508
' Imports System.Collections.Generic
' Imports System.Text.RegularExpressions

Class Main
    Public Shared Sub Main()
        Dim N As Integer
        N = Console.ReadLine()
        If {2, 4, 5, 7, 9}.Contains(N Mod 10) Then
            Console.WriteLine("hon")
            Return
        ElseIf {0, 1, 6, 8}.Contains(N Mod 10) Then
            Console.WriteLine("pon")
            Return
        Else
            Console.WriteLine("bon")
            Return
        End If
        Return
    End Sub
End Class


Measured memory_bytes: 28676
# coding=utf-8


def gcd(n1, n2):
    if n1 < n2:
        n1, n2 = n2, n1

    if n1 == n2 or n2 == 0:
        return n1
    n1, n2 = n2, (n1 % n2)
    return gcd(n1, n2)


def make_divisor_list(number):
    divisor_list = []
    if number == 1:
        return [1]

    for i in range(1, number//2 + 1):
        if number % i == 0:
            divisor_list.append(i)
    divisor_list.append(number)
    return divisor_list


if __name__ == '__main__':
    N = int(input())
    number_list = list(map(int, input().split()))
    if N == 2:
        GCD = gcd(number_list[0], number_list[1])
    else:
        GCD = gcd(gcd(number_list[0], number_list[1]), number_list[2])
    [print(element) for element in make_divisor_list(GCD)]



Measured memory_bytes: 5608
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
const int INF = 1e9;
const ll LINF = 1e18;
inline ll gcd(ll a, ll b) { return b ? gcd(b, a%b) : a; }
inline ll lcm(ll a, ll b) { return a / gcd(a, b)*b; }
template<class S,class T> ostream& operator << (ostream& out,const pair<S,T>& o){ out << "(" << o.first << "," << o.second << ")"; return out; }
template<class T> ostream& operator << (ostream& out,const vector<T>& V){ for(int i = 0; i < V.size(); i++){ out << V[i]; if(i!=V.size()-1) out << " ";} return out; }
template<class T> ostream& operator << (ostream& out,const vector<vector<T> >& Mat){ for(int i = 0; i < Mat.size(); i++) { if(i != 0) out << endl; out << Mat[i];} return out; }
template<class S,class T> ostream& operator << (ostream& out,const map<S,T>& mp){ out << "{ "; for(auto it = mp.begin(); it != mp.end(); it++){ out << it->first << ":" << it->second; if(mp.size()-1 != distance(mp.begin(),it)) out << ", "; } out << " }"; return out; }
template<typename T>vector<T> make_v(size_t a){return vector<T>(a);}
template<typename T,typename... Ts>auto make_v(size_t a,Ts... ts){return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));}
template<typename T,typename V> typename enable_if<is_class<T>::value==0>::type fill_v(T &t,const V &v){t=v;}
template<typename T,typename V> typename enable_if<is_class<T>::value!=0>::type fill_v(T &t,const V &v){for(auto &e:t) fill_v(e,v);}
/*
 <url:https://atcoder.jp/contests/abc160/tasks/abc160_b>
 問題文============================================================
 B - Golden Coins
 =================================================================
 解説=============================================================
 ================================================================
 */

template<class Type>
Type solve(Type res = Type()){
    ll X; cin >> X;
    res = X/500*1000 + (X%500)/5*5;
    return res;
}
int main(void) {
    cin.tie(0); ios_base::sync_with_stdio(false);
    // solve(0);
    cout << fixed << setprecision(15) << solve<ll>() << endl;
    return 0;
}


Measured memory_bytes: 256
N = int(input())
AC = 0
WA = 0
TLE = 0
RE = 0
for i in range(N):
    S = input()
    if S == 'AC':
        AC = AC + 1
    elif S == 'WA':
        WA = WA + 1
    elif S == 'TLE':
        TLE = TLE + 1
    else:
        RE = RE + 1

print('AC x ' + str(AC))
print('WA x ' + str(WA))
print('TLE x ' + str(TLE))
print('RE x ' + str(RE))


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

using E = System.Linq.Enumerable;

public class Program
{
    public static void Main()
    {
        var n = int.Parse(Console.ReadLine());

        var count = new int[n + 1];
        for (int i = 1; i * i <= n; ++i)
        {
            var t = i * i;
            for (int j = t > n ? n : 1; j * j <= n; ++j)
            {
                var s = j * j + i * j;
                t += s;
                for (int k = t > n ? n : 1; k * k <= n; ++k)
                {
                    var r = k * k + j * k + k * i;
                    t += r;
                    if (t <= n)
                    {
                        ++count[t];
                    }
                    t -= r;
                }
                t -= s;
            }
        }

        Console.WriteLine(string.Join(Environment.NewLine, count.Skip(1)));
    }
}


Measured memory_bytes: 28588
import java.util.*; import java.io.*; import java.math.*;
public class Main{
	static void solve(){//Here is the main function
		ArrayList<Long> one = nextLongArray();
		long a = one.get(0);
		long b = one.get(1);
		long c = one.get(2);
		long R = c - a - b;
		long L = 4 * a * b;
		if(R <= 0){
			myerr("?");
			myout("No");
			return;
		}
		if(L < R * R){
			myout("Yes");
		}else{
			myout("No");
		}
	}
	//Method addition frame start



	//Method addition frame end

	//Don't have to see. start------------------------------------------
	static class InputIterator{
		ArrayList<String> inputLine = new ArrayList<String>(1024);
		int index = 0; int max; String read;
		InputIterator(){
			BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
			try{
				while((read = br.readLine()) != null){
					inputLine.add(read);
				}
			}catch(IOException e){}
			max = inputLine.size();
		}
		boolean hasNext(){return (index < max);}
		String next(){
			if(hasNext()){
				return inputLine.get(index++);
			}else{
				throw new IndexOutOfBoundsException("There is no more input");
			}
		}
	}
	static HashMap<Integer, String> CONVSTR = new HashMap<Integer, String>();
	static InputIterator ii = new InputIterator();//This class cannot be used in reactive problem.
	static PrintWriter out = new PrintWriter(System.out);
	static void flush(){out.flush();}
	static void myout(Object t){out.println(t);}
	static void myerr(Object t){System.err.print("debug:");System.err.println(t);}
	static String next(){return ii.next();}
	static boolean hasNext(){return ii.hasNext();}
	static int nextInt(){return Integer.parseInt(next());}
	static long nextLong(){return Long.parseLong(next());}
	static double nextDouble(){return Double.parseDouble(next());}
	static ArrayList<String> nextStrArray(){return myconv(next(), 8);}
	static ArrayList<String> nextCharArray(){return myconv(next(), 0);}
	static ArrayList<Integer> nextIntArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Integer> ret = new ArrayList<Integer>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Integer.parseInt(input.get(i)));
		}
		return ret;
	}
	static ArrayList<Long> nextLongArray(){
		ArrayList<String> input = nextStrArray(); ArrayList<Long> ret = new ArrayList<Long>(input.size());
		for(int i = 0; i < input.size(); i++){
			ret.add(Long.parseLong(input.get(i)));
		}
		return ret;
	}
	@SuppressWarnings("unchecked")
	static String myconv(Object list, int no){//only join
		String joinString = CONVSTR.get(no);
		if(list instanceof String[]){
			return String.join(joinString, (String[])list);
		}else if(list instanceof ArrayList){
			return String.join(joinString, (ArrayList)list);
		}else{
			throw new ClassCastException("Don't join");
		}
	}
	static ArrayList<String> myconv(String str, int no){//only split
		String splitString = CONVSTR.get(no);
		return new ArrayList<String>(Arrays.asList(str.split(splitString)));
	}
	public static void main(String[] args){
		CONVSTR.put(8, " "); CONVSTR.put(9, "\n"); CONVSTR.put(0, "");
		solve();flush();
	}
	//Don't have to see. end------------------------------------------
}


Measured memory_bytes: 32976
#include <iostream>
#include <iomanip>
#include <algorithm>
#include <numeric>
#include <cmath>
#include <vector>
#include <list>
#include <stack>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <tuple>
using namespace std;

int main(){

    int x, y; cin >> x >> y;

    if(0 <= x){
        if(0 < y){
            if(x < y){
                cout << y - x << endl;
            }
            else{
                cout << x - y + 2 << endl;
            }
        }
        else{
            if(abs(x) <= abs(y)){
                cout << abs(y) - abs(x) + 1 << endl;
            }
            else{
                cout << abs(x) - abs(y) + 1 << endl;
            }
        }
    }
    else{
        if(0 < y){
            if(abs(x) <= abs(y)){
                cout << abs(y) - abs(x) + 1 << endl;
            }
            else{
                cout << abs(x) - abs(y) + 1 << endl;
            }
        }
        else{
            if(x < y){
                cout << y - x << endl;
            }
            else{
                cout << x - y + 2 << endl;
            }
        }
    }

    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include<queue>
#include <sstream>
#include <set>
typedef  long long ll;
const int dx[8]={1,0,-1,0,1,-1,-1,1};
const int dy[8]={0,1,0,-1,1,1,-1,-1};
const int dr[4] = {-1, 0, 1, 0};
const int dc[4] = { 0, 1, 0,-1};
const int INF = 1e9;
#define FOR(i, a, n) for(int i = (int)(a); i < (int)(n); ++i)
#define REP(i, n) FOR(i, 0, n)
#define SORT(a) sort(a.begin(),a.end())
#define REVERSE(a) reverse(a.begin(),a.end())
int guki (int a){
    if(a%2==0) return 0;
    else return 1;
}
using namespace std;
int main(){
    int N,M,ans=0;
    cin >> N >> M;

    map<int ,int> mp;

    REP(i,N){
        int k,x;
        cin >> k;
        REP(j,k){
            cin >> x;
            mp[x]++;
        }
    }


    for(auto x:mp){
        if(x.second == N) ans ++;
    }

    cout << ans << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <iomanip>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <stack>
#include <queue>
#include <functional>
#include <limits.h>
#include <set>
#include <map>
#include <tuple>
using namespace std;



#define ll long long
#define ull unsigned long long
#define rep(i,N) for (ll i=0;i<N;i++)
#define loop(i,N,M) for(ll i=N;i<M;i++)
#define MAX(v) *max_element(v.begin(),v.end())
#define MIN(v) *min_element(v.begin(),v.end())
#define SORTL2S(type,v) sort(v.begin(),v.end(),greater<type>())
#define SORTS2L(type,v) sort(v.begin(),v.end())
#define SORTMF(v,func) sort(v.begin(),v.end(),func)

ll debugFlag = false;
template<typename T> void debug(T&);
template<typename T> void debug(T&, bool);
template<typename T> void debug(vector<T>&);
template<typename T> void debug(vector<T>&, bool);
template<typename T, typename U> void debug(pair<T, U>&);
template<typename T, typename U> void debug(pair<T, U>&, bool);

template<typename T>
void debug(T& obj) {
	debug(obj, true);
}

template<typename T>
void debug(T& obj, bool lnFlag) {
	if (!debugFlag) return;
	cout << obj;
	if (lnFlag) cout << endl;
}

template<typename T>
void debug(vector<T>& obj) {
	debug(obj, true);
}

template<typename T>
void debug(vector<T>& obj, bool lnFlag) {
	if (!debugFlag) return;
	cout << "[";
	rep(i, obj.size()) {
		if (i != 0) cout << ",";
		debug(obj[i], false);
	}
	cout << "]";
	if (lnFlag) cout << endl;
}

template<typename T, typename U>
void debug(pair<T, U>& obj) {
	debug(obj, true);
}

template<typename T, typename U>
void debug(pair<T, U>& obj, bool lnFlag) {
	if (!debugFlag) return;
	cout << "(";
	debug(obj.first, false);
	cout << ",";
	debug(obj.second, false);
	cout << ")";
	if (lnFlag) cout << endl;
}

bool isPrime(ll num) {

	bool flag = true;
	for (int i = 2; i <= sqrt(num); i++) {
		if (num%i == 0) {
			flag = false;
			break;
		}
	}

	return flag;
}


void solve() {

	int N;
	cin >> N;

	cout << N * N*N;

}


int main(int argc, char* argv[]) {
	if (argc == 2 && string(argv[1]) == "debug") debugFlag = true;
	solve();
	return 0;
}


Measured memory_bytes: 888
#include<bits/stdc++.h>
using namespace std;
#define F first
#define S second
#define IO ios::sync_with_stdio(false);cin.tie(0);cout.tie(0)
typedef long long LL;
typedef unsigned long long ULL;
typedef long double LD;
const LL LINF = 0x3f3f3f3f3f3f3f3f; 
const int INF = 0x3f3f3f3f;
const double eps = 1e-6;
const int mod = 1e9+7;
const ULL P = 131;
const int N = 2e5+7;


int main()
{
	int n,d;
	cin>>n>>d;
	int ans=0;
	for(int i=1;i<=n;i++){
		double x,y;
		cin>>x>>y;
		if(sqrt(x*x+y*y)<=(double)d) ans++;
	}
	cout<<ans<<"\n";
	return 0;
}

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

using namespace std;

int main()
{
    int n;
    
    while (scanf("%d", &n) && n){
        char prev[3] = "xy";
        char now[3];
        int ans = 0;
        
        for (int i = 0; i < n; i++){
            scanf("%s", now);
            if (now[0] != prev[0] && now[1] == prev[1]) ans++;
            strcpy(prev, now);
        }
        printf("%d\n", ans);
    }
    
    return (0);
}

Measured memory_bytes: 1200
/*@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@
Code author: Saurabh Singhal
Code copy karne vaale tera muh kaala
@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@*/

#include<bits/stdc++.h>
#define mp(a,b) make_pair(a,b)
#define pb push_back
#define ppb pop_back

using namespace std;
typedef long long int ll;
typedef vector<int> vi_t;
typedef vector<ll> vll_t;
int t=1;
vll_t a,b;
bool allzero(vector<int>&v){
	//cout<<"all"<<0<<endl;
	bool flag=true;
	for(int i=0;i<v.size();i++){
		if(v[i]!=0){
			flag=false;
			break;
		}
	}
	return flag;
}
int find(vector<int>&v){
	int mi=INT_MAX;
	for(int i=0;i<v.size();i++){
		if(v[i]!=0){
			mi=min(mi,v[i]);
		}
	}
	return mi;
}
int  main(){
	// #ifndef ONLINE_JUDGE
 //    // for getting input from input.txt
 //    freopen("input.txt", "r", stdin);
 //    // for writing output to output.txt
 //    freopen("output.txt", "w", stdout);
	// #endif
	int n;
	cin>>n;
	vector<int>v(n);
	for(int i=0;i<n;i++){
		cin>>v[i];
	}
	int ans=0;
	//cout<<allzero(v)<<" "<<find(v)<<endl;
	bool flag=true;
	while(!allzero(v)){
		int mi=find(v);
		//cout<<mi<<" ";
		int pre=0,count=0;
		for(int i=0;i<n;i++){
			if(pre==0&&v[i]!=0){
				count++;
			}
			pre=v[i];
			if(v[i]!=0){
				v[i]=v[i]-mi;
			}
		}
		ans+=count*mi;
		//flag=false;
		//cout<<"count="<<count<<"ans="<<ans<<"mi="<<mi<<endl;
		// for(int i=0;i<n;i++){
		// 	cout<<v[i]<<" ";
		// }
		// cout<<endl;
	}
	cout<<ans<<endl;
}

Measured memory_bytes: 256
//   AtCoder Beginner Contest 072 B-OddString

#include<stdio.h>

int main(void)
{

    char s[100005];
    int i;

    scanf("%s", s);

    for(i=0;s[i] != '\0' ;i++)
        if(i%2==0)
            printf("%c", s[i]);
    printf("\n");

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#pragma GCC optimize("O0")
typedef long long int ll;
typedef long double ld;
const ll mod = 1e9+7;
const ll INF = 1e18;
#define rep(i,n) for (ll i = 0; i < (n); ++i)
#define Rep(i,a,n) for (ll i = (a); i < (n); ++i)
#define All(a) (a).begin(),(a).end()
#define Pi acos(-1)
using Graph = vector<vector<ll>>;
using V = vector<ll>;
using P = pair<ll,ll>;

class mint {
public:
    long long x;
    constexpr mint(long long x=0) : x((x%mod+mod)%mod) {}
    constexpr mint operator-() const { 
      return mint(-x);
    }
    constexpr mint& operator+=(const mint& a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }
    constexpr mint& operator-=(const mint& a) {
        if ((x += mod-a.x) >= mod) x -= mod;
        return *this;
    }
    constexpr mint& operator*=(const mint& a) {
        (x *= a.x) %= mod;
        return *this;
    }
    constexpr mint operator+(const mint& a) const {
        mint res(*this);
        return res+=a;
    }
    constexpr mint operator-(const mint& a) const {
        mint res(*this);
        return res-=a;
    }
    constexpr mint operator*(const mint& a) const {
        mint res(*this);
        return res*=a;
    }
    constexpr mint pow(long long t) const {
        if (!t) return 1;
        mint a = pow(t>>1);
        a *= a;
        if (t&1) a *= *this;
        return a;
    }

    // for prime mod
    constexpr mint inv() const {
        return pow(mod-2);
    }
    constexpr mint& operator/=(const mint& a) {
        return (*this) *= a.inv();
    }
    constexpr mint operator/(const mint& a) const {
        mint res(*this);
        return res/=a;
    }
};
ostream& operator<<(ostream& os, const mint& m){
    os << m.x;
    return os;
}

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

int main() {
  cin.tie(0);
  ios_base::sync_with_stdio(false);
  cout << setprecision(15) << fixed;
  chrono::system_clock::time_point start,end;
  start = chrono::system_clock::now();

  ll n;
  cin >> n;
  mint ans = 0;
  ans += modpow(10,n,mod) - 2*modpow(9,n,mod) + modpow(8,n,mod);
  cout << ans << '\n';

  end = chrono::system_clock::now();
  auto elapsed = chrono::duration_cast< chrono::milliseconds >(end - start).count();
  cerr << elapsed << "ms" << '\n';
}


Measured memory_bytes: 3656
#include<bits/stdc++.h>	
#define int long long int
#define pb push_back
#define endl "\n"
#define F first
#define S second 
#define mod 1000000007     
using namespace std;

main()
{	
	ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	int n, a, b;
	cin >> n >>a >> b;
	int mul = n / (a + b);
	if(a == 0){
		cout << 0;
		return 0;
	}
	cout << mul * a + min(a, n % (a + b));
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
using namespace std::chrono;
#define idfc ios_base::sync_with_stdio(false),cin.tie(nullptr),cout.tie(nullptr)
//:/
#define pb push_back
#define mp make_pair
#define nt _ll128
#define ld double
long double PI =3.14159265;
using ll = long long;

const ll modo=1e9+7;
const ll ms=2e5+5;
const ll inf=1e17;



int main(){
    idfc;

    string s;
    cin>>s;


    if(s[s.length()-1]!='s')
    {
        s+='s';
    }
    else{
        s+="es";
    }
    cout<<s;

    return 0;
}

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


int main() {
    int a,b;
    cin >> a >> b;
    if(a >= b*2)cout << a-b*2 << endl;
    else cout << 0 << endl;
    return 0;
}

/*
やっほい！
　　　　　　　やほほい！
　　　　+　　 　*
　　　 ∧∧　　. ∧∞∧　*
*　ヽ(=´ω｀)人(´ω｀*)ﾉ
　.～（ O x.） （ 　 O)～　+
。*　 　∪　　　　∪
*/

Measured memory_bytes: 256
#include<bits/stdc++.h> 
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define pb push_back
#define int long long
#define swap(x,y) (x^=y^=x^=y)

#define debug1(a) cerr<<#a<<" = "<<(a)<<endl;
#define debug2(a,b) cerr<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<endl;
#define debug3(a,b,c) cerr<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<endl;
#define debug4(a,b,c,d) cerr<<#a<<" = "<<(a)<<", "<<#b<<" = "<<(b)<<", "<<#c<<" = "<<(c)<<", "<<#d<<" = "<<(d)<<endl;

using namespace std;
 
#define mod 1000000007
long long modexpo(long long x, long long p){
    int res = 1;x = x%mod;
    while(p){
        if(p%2)res = res * x;
        p >>= 1;
        x = x*x % mod;
        res %= mod;
    }
    return res;
}
 
// int max(int a,int b){return (a>b?a:b);} 
// int min(int a,int b){return (a<b?a:b);}


struct compare{
    bool operator() (const pair<int,int> a, const pair<int,int> b) const{
        return a.first < b.first;
    }
};

int32_t main(){
    IOS
    int cur = 0;
    int n;
    cin >> n;
    vector<pair<int,int>> v;
    for(int i = 0; i < n; i++){
        int a,b;
        cin >> a >> b;
        v.pb({b,a});
    }
    sort(v.begin(), v.end());
    for(int i = 0; i < n; i++){
        if(cur+v[i].second <= v[i].first){
            cur += v[i].second;
        }
        else{
            cout << "No" << endl;
            exit(0);
        }
    }
    cout << "Yes" << endl;
} 

Measured memory_bytes: 7428
#include<stdio.h>

int main()
{
	int i;
	char a[100];
	for (i = 0; i < 3; i++)
	{
		scanf("%c", &a[i]);
	}
	if (a[1] == a[2] &&a[1]==a[0])
	{
		printf("No");
	}
	else
		printf("Yes");
}

Measured memory_bytes: 128
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.io.IOException;
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.io.InputStream;

/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 *
 * @author EDGE
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        FastReader in = new FastReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskA solver = new TaskA();
        solver.solve(1, in, out);
        out.close();
    }

    static class TaskA {
        public void solve(int testNumber, FastReader in, PrintWriter out) {
            String[] s = in.nextLine().trim().split("\\s+");
            out.println(s[1] + s[0]);
        }

    }

    static class FastReader {
        BufferedReader br;

        public FastReader(InputStream inputStream) {
            br = new BufferedReader(new
                    InputStreamReader(inputStream));
        }

        public String nextLine() {
            String str = "";
            try {
                str = br.readLine();
            } catch (IOException e) {
                e.printStackTrace();
            }
            return str;
        }

    }
}



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

int main(){
	int N, Y;
	cin >> N >> Y;
	int ans_i = -1, ans_j = -1, ans_k = -1;
	for (int i=0; i<=N; ++i){ //一万円
		for (int j=0; j<=N-i; ++j){ //五千円
			int sum = 10000*i + 5000*j + 1000*(N-i-j);
			if(Y == sum){
				ans_i = i;
				ans_j = j;
				ans_k = N-i-j;
			}
		}
	}
	cout << ans_i <<" "<< ans_j <<" "<< ans_k << endl;
}

Measured memory_bytes: 256
n, m, k = gets.split.map(&:to_i)
a = ['dummy'] + (1..n).map { gets.to_i }
t = [0]
(1..n).each do |i|
    min = Float::INFINITY
    max = -min
    opt = Float::INFINITY
    i.downto(1) do |j|
        break if i - j + 1 > m
        min = a[j] if a[j] < min
        max = a[j] if a[j] > max
        x = t[j-1] + k + (max - min) * (i - j + 1)
        opt = x if x < opt
    end
    t[i] = opt
end
p t[-1]


Measured memory_bytes: 9472