akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
int main(){
  int n;
  std::cin>>n;
  int i,j;
  int u[n],k;
  int a[n][n];
  //行列の初期化
  for(i=0; i<n; i++){
    for(j=0; j<n; j++){
      a[i][j]=0;
    }
  }
  
  for(i=0; i<n; i++){
    std::cin>>u[i];
    std::cin>>k;
    for(j=0; j<k; j++){
      int v;
      std::cin>>v;
      a[i][v-1]=1;
    }
  }
  for(i=0; i<n; i++){
    for(j=0; j<n-1; j++){
      std::cout<<a[i][j]<<" ";
    }
    std::cout<<a[i][n-1]<<"\n";
  }
}
      



Measured memory_bytes: 3096
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    ll n,w;
    cin>>n>>w;
    ll wei[n],v[n],dp[w+1]={0};
    for(ll i=0;i<n;++i)
        cin>>wei[i]>>v[i];
    for(ll i=0;i<n;++i)
    {
        for(ll j=w;j-wei[i]>=0;--j)
        {
            dp[j]=max(dp[j],v[i]+dp[j-wei[i]]);
        }
    }
    cout<<*max_element(dp,dp+w+1);
    return 0;
}

Measured memory_bytes: 1024
#include <iostream>
#include <vector>
#include <list>
#include <algorithm>
#include <string>
#include <stack>
#include <iomanip>
#include <numeric>
#include <queue>
#include <climits>
#include <complex>
#include <cmath>
#include <map>
using namespace std;
using ll = long long;
#define MOD 1000000007
#define INF 1LL << 59

int main()
{
    std::ios::sync_with_stdio(false);
    std::cin.tie(0);
    //cout << fixed << setprecision(3);

    int n;
    cin >> n;
    
    while (n--)
    {string s = "", t = "";
        while(s=="")std::getline(std::cin, s);
        t = s;
        bool found = false;
        for (int i = 3; i < 26; ++i)
        {
            s = t;
            if (i % 26 == 0 || 26 % i == 0)
                continue;

            for (int j = 1; j <= 100; ++j)
            {
                if (i % j == 0 || j % i == 0 || 26 % j == 0 || j % 26 == 0)
                    continue;

                for (int k = 0; k < (int)s.size(); ++k)
                {
                    if (s[k] >= 'a' && s[k] <= 'z')
                    {
                        s[k] = (char)('a' + (i * (s[k] - 'a') + j) % 26);
                    }
                }
                if (s.find("that") != string::npos || s.find("this") != string::npos)
                {
                    cout << s << endl;
                    found = true;
                    break;
                }
            }
            if (found)
                break;
        }
    }
    return 0;
}


Measured memory_bytes: 2964
n = int(input())
h = [int(x) for x in input().split()]

flag = True
level = h[0]

for i in range(n-1):
  if h[i] < h[i+1]:
    pass
  elif h[i] == h[i+1]:
    if level > h[i] - 1:
      pass
    else:
      h[i] -= 1
  else:
    if level > h[i] - 1:
      flag = False
      break
    else:
      h[i] -= 1
      if h[i] == h[i+1]:
        level = h[i]
      else:
        flag = False
        break

if flag:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 14252
#include<cstdio>
#include<cstring>
#include<algorithm>
#include<cstdlib>
#include<cmath>
#include<ctime>
#include<vector>
#include<queue>
#include<stack>
#include<bitset>
using namespace std;
namespace mine
{
	typedef long long ll;
	#define vc vector
	#define PB push_back
	#define pr pair<int,int>
	#define MP make_pair
	#define FR first
	#define SE second
	ll qread()
	{
		ll now=0,f=1;char c=getchar();
		while(c<'0' or c>'9') {if(c=='-')f=-1;c=getchar();}
		while('0'<=c and c<='9') now=now*10+c-'0',c=getchar();
		return now*f;
	}
	void write(ll num)
	{
		if(num<0) putchar('-'),num=-num;
		if(num>=10) write(num/10);
		putchar('0'+num%10);
	}
	void write1(ll num){write(num);putchar(' ');}
	void write2(ll num){write(num);putchar('\n');}
	void chmax(int &x,ll y){x=(x>y?x:y);}
	void chmin(int &x,ll y){x=(x<y?x:y);}
	const int MOD=998244353;
	ll qpower(ll x,ll e)
	{
		ll ans=1;
		while(e)
		{
			if(e&1) ans=ans*x%MOD;
			x=x*x%MOD;e>>=1; 
		} 
		return ans;
	}
	ll invm(ll x){return qpower(x,MOD-2);}
	const int N=1e6+10;

	char str[N];
	void main()
	{
		scanf("%s",str+1);int n=strlen(str+1);
		int cnt=0;bool lst=0,one=1;
		for(int i=1;i<=n;i++)
		{
			if(i==1) cnt++;
			else
			{
				 if(one and str[i-1]==str[i]) lst=1,one=0;
				 else
				 {
				 	cnt++;
				 	if(lst) lst=0;
				 	else one=1;
				 }
			} 
		} 
		write(cnt); 
	}
};
int main()
{
//	freopen("z.txt","r",stdin); 
	srand(time(0));
	mine::main();
}

Measured memory_bytes: 384
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <queue>
#include <stdlib.h>
#include <map>
#include <cmath>
#define MOD_P 1000000007
#define MOD_Q 998244353
#define PI 3.14159265358979
#define ll long long
using namespace std;

int main()
{
	string days[] = { "0", "SAT", "FRI", "THU", "WED", "TUE", "MON", "SUN" };
	string test;
	cin >> test;

	for (int i = 1; i < 8; i++) {
		if (test == days[i]) {
			printf("%d", i);
			break;
		}
	}


	return 0;
}



Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define forn(i,n) for(int i=0; i< (int)n; ++i)
#define for1(i,n) for(int i=1; i<= (int)n; ++i)
#define fore(i,l,r) for(int i=(int)l; i<= (int)r; ++i)
#define ford(i,n) for(int i=(int)(n) - 1; i>= 0; --i)
#define fored(i,r,l) for(int i=(int)r; i>= (int)l; --i)
#define pb push_back
#define el '\n'
#define d(x) cout<< #x<< " " << x<<el


using namespace std;

typedef long long ll;
typedef pair<int,int> ii;
const double PI = atan(1)*4;
const int MAXN = 1e5+20;
const int INF = 1<<30;
const double EPS = 1e-9;
ll dp[MAXN];

int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);
    cout<< setprecision(2)<< fixed;
    int n,k;
    cin>>n>>k;
    ll h[n];
    forn(i,n){
        cin>>h[i];
    }
    fill(dp,dp+n, INF);
    dp[0]=0;
    for1(i,n-1){
        for1(j, min(k,i)){
            dp[i]=min(dp[i-j]+abs(h[i]-h[i-j]),dp[i]);
        }
    }
    cout<<dp[n-1];
}


Measured memory_bytes: 1792
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <string>
#include <vector>
#include <numeric>
#include <algorithm>
#include <utility>
#include <sstream>
#include <iterator>

using namespace std;
// #define int long long
#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)


int main(int argc, const char * argv[]) {

    int X,A;
    cin >> X >> A ;


    if (X < A){
      cout << 0 << endl;
    }else{
      cout << 10 << endl;
    }

    return 0;
}

Measured memory_bytes: 888
#include <bits/stdc++.h>
#ifdef HIRO
#define d(f_, ...) printf((f_), ##__VA_ARGS__)
#else
#define d(f_, ...)
#endif

using namespace std;
typedef long long ll;
typedef long double ld;
typedef pair<int, int> pii;
typedef vector<int> vi;
typedef vector<long long> vll;
typedef queue<int> qi;
typedef queue< pair<int, int> > qp;
#define mp make_pair
#define pi 3.14159265358979323846
#define MAX max_element
#define MIN min_element
#define all(v) v.begin(), v.end()
#define gt(T) greater<T>()
#define sum(v) accumulate(v.begin(), v.end(), 0)
#define uni(v) do{ \
  sort(v.begin(), v.end()); \
  decltype(v)::iterator result = unique(v.begin(), v.end()); \
  v.erase(result, v.end()); \
}while(0)
#define fi(init, n) for(int i = init; i < n; ++i)
#define fj(init, n) for(int j = init; j < n; ++j)
#define fk(init, n) for(int k = init; k < n; ++k)
#define zero(x) memset(x, 0, sizeof(x))
#define negative(x) memset(x, ~0, sizeof(x))
const ll MOD = 1e9 + 7;
const int INF = 1e9;
const int di[] = { 0, 1, 0, -1 };
const int dj[] = { 1, 0, -1, 0 };

template<typename T>
T gcd(T a, T b) {
	return b ? gcd(b, a % b) : a;
}
template<typename T>
T lcm(T a, T b) {
	return a * b / gcd(a, b);
}
template<typename T>
int finder(vector<T> vec, T number) {
	auto itr = find(vec.begin(), vec.end(), number);
	size_t index = distance(vec.begin(), itr);
	if (index != vec.size()) return 1;
	else return 0;
}
ll frac(ll n){
	if (n == 0) return 1;
	return (n * frac(n - 1)) % MOD;
}

int main(int argc, char** argv) {
#ifdef HIRO
  string quiz(argv[1]);
  string id(argv[2]);
  string filename("input/" + quiz + "/" + id + ".txt");
  ifstream fin(filename);
  if (fin.peek() == ifstream::traits_type::eof()) {
    cout << "No input.";
    return 0;
  }
  ifstream cin(filename);
  std::cin.rdbuf(cin.rdbuf());
#endif
  ll ans = 0;
  // ll n;
  // cin >> n;
  // ll n, m;
  // cin >> n >> m;
  ll n, m, k;
  cin >> n >> m >> k;
  if(m==0){
    cout << "0\n";
    return 0;
  }
  ll a, b;
  a = n / (m+k);
  b = n % (m+k);
  ans = a*m + (b>m?m:b);
  cout << ans << endl;
  return 0;
}



Measured memory_bytes: 256
n, k = map(int, input().split())
if k % 2 == 0:
    d1 = n // (k // 2)
    d2 = n // k
    ans = d2 ** 3 + (d1 - d2) ** 3
else:
    d = n // k
    ans = d ** 3
print(ans)


Measured memory_bytes: 3064
#include <bits/stdc++.h> 
 
#define INF (1<<31)//INT_MAX/2
#define MOD 1000000007
 
using ll  = long long;
using ull = unsigned long long;
 
int main(int argc, char *argv[])
{
    std::string N;
    std::cin >> N;

    if (N[0] == N[1] && N[1] == N[2]) {
        std::cout << "Yes" << std::endl;
    } else if (N[1] == N[2] && N[2] == N[3]) {
        std::cout << "Yes" << std::endl;
    } else if (N[0] == N[1] && N[1] == N[2] && N[2] == N[3]) {
        std::cout << "Yes" << std::endl;
    } else {
        std::cout << "No"  << std::endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define ll long long
using ull = unsigned long long;
using namespace std;
const int INF = 1e10;
const int MOD = 1e9 + 7;
#define dump(x)                             \
    if (dbg) {                              \
        cout << #x << " = " << (x) << endl; \
    }
#define FOR(i, a, b) for (int i = (a); i < (b); ++i)
#define FORR(i, a, b) for (int i = (a); i <= (b); ++i)
#define pb push_back
#define mp make_pair
#define lb lower_bound
#define ub upper_bound
#define all(v) (v).begin(), (v).end()
#define SZ(x) ((int)(x).size())
#define P pair<int, int>
#define V vector<int>
#define S set<int>
#define itn int
bool dbg = false;
int N, K, A[202020], F[202020];
itn c(int x) {
    int ans = 0;
    FOR(i, 0, N) {
        if (A[i] * F[i] > x) {
            int a = x / F[i];
            ans += A[i] - a;
        }
    }
    return ans;
}
void solve() {
    sort(A, A + N);
    sort(F, F + N, greater<int>());
    int MAX = 0;
    FOR(i, 0, N) {
        MAX = max(MAX, A[i] * F[i]);
    }
    int ok = MAX;
    int ng = -1;
    while (abs(ok - ng) > 1) {
        int mid = (ok + ng) / 2;
        if (c(mid) <= K) {
            ok = mid;
        } else {
            ng = mid;
        }
    }
    cout << ok << endl;
}

signed main() {
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    cin >> N >> K;
    FOR(i, 0, N)
    cin >> A[i];
    FOR(i, 0, N)
    cin >> F[i];
    solve();
    return 0;
}


Measured memory_bytes: 3456
#include <bits/stdc++.h>
using namespace std;
//Author: Ezio Sam
/* Shorthands */
#define ll long long
#define pb push_back 
#define mp make_pair
#define sp ": "
#define cs "Case "
#define fi first
#define sn second 
#define po(x) x*x
/* STL */
#define vi vector<int>v
#define pii pair<int,int>
#define pll pair<ll,ll>
#define mem(a,n) memset(a, n, sizeof(a));
#define all(x) x.begin(),x.end()
#define sz(x)  (int)x.size()
#define mx(v)  *max_element(v.begin(),v.end())
#define mxa(a) *max_element(a, a.size())
#define r(a) reverse(a.begin(),a.end())
/* loops */
#define fr(i,n)   for(__typeof(n) i=0;i<(n);i++)
#define fn(i,n)   for(__typeof(n)i=1;i<=(n);i++)
#define fa(i,a,n) for(__typeof(a)i=(a);i<=(b);i++)
/*Special*/
#define Ezio ios::sync_with_stdio(0),cin.tie(NULL),cout.tie(NULL);
#define db(something)   cerr<<#something<<" - "<<something<<"\n";         
int main()
{
  
   Ezio
   /*Variables*/
   /*Code*/
   ll a, b;
   cin>>a>>b;
   cout<<a*b<<endl;
   return 0;
}
    

Measured memory_bytes: 3624
n = gets.chomp.to_i
alist = gets.chomp.split.collect{ |item| item.to_i}
blist = gets.chomp.split.collect{ |item| item.to_i}

max = 0

if blist[0] >=  alist[0]
  max += alist[0]
  blist[0] -= alist[0]
  alist[0] = 0
else#blist[0] < alist[0]
  max += blist[0]
  alist[0] -= blist[0]
  blist[0] = 0
end

1.upto(n) do |i|
  if blist[i-1] >= alist[i]
    max += alist[i]
    blist[i-1] -= alist[i]
    alist[i] = 0
    next
  else
    max += blist[i-1]
    alist[i] -= blist[i-1]
    blist[i-1] = 0
  end
  break if (i==n)
  if blist[i] >= alist[i]
    max += alist[i]
    blist[i] -= alist[i]
    alist[i] = 0
  else
    max += blist[i]
    alist[i] -= blist[i]
    blist[i] = 0
  end
end

puts max


Measured memory_bytes: 17564
# -*- coding: utf-8 -*-
import math
N=input()
A=[ 2 for _ in range(N+1)]
A[0]=0
A[1]=1

for cur in range(2,N+1):
    for i in range(cur*2,N+1,cur):
        A[i]+=1

ans=0
for i in range(1,N+1):
    ans+=i*A[i]
print ans


Measured memory_bytes: 156476
MOD = 10 ** 9 + 7

N, K = map(int, input().split())
A_list = list(map(int, input().split()))
A_list.sort()

def calc_inverse(n, law):
	if n == 1:
		return 1
	
	pre_r = law
	pre_x = 0
	pre_y = 1
	cur_r = n
	cur_x = 1
	cur_y = 0
	
	while True:
		d = pre_r // cur_r
		r = pre_r % cur_r
		
		nxt_r = r
		nxt_x = pre_x - d * cur_x
		nxt_y = pre_y - d * cur_y
		
		if nxt_r == 1:
			ret = nxt_x
			while ret < 0:
				ret += law;
			return ret;
		elif nxt_r == 0:
			return None
		
		pre_r = cur_r;
		pre_x = cur_x;
		pre_y = cur_y;
		cur_r = nxt_r;
		cur_x = nxt_x;
		cur_y = nxt_y;

p_table = [1]
inv_p_table = [1]
p = 1
for i in range(1, N + 1):
	p = (p * i) % MOD
	p_table.append(p)
	inv_p_table.append(calc_inverse(p, MOD))

def c(n, k):
	return (p_table[n] * inv_p_table[n - k] % MOD) * inv_p_table[k] % MOD

total = 0
for i in range(N):
	a = A_list[i]
	n = N - (i + 1)
	if n >= K - 1:
		total = (total - a * c(n, K - 1)) % MOD
	n = i
	if n >= K - 1:
		total = (total + a * c(n, K - 1)) % MOD

print(total)


Measured memory_bytes: 15924
import java.util.*;

class Main{

    void solve(){
        Scanner sc = new Scanner(System.in);
        
        int max = (int)Math.pow(2, 15) + 2;
        int[][] dp = new int[max][5];
        dp[0][0] = 1;
        for(int k=1; k*k<max; k++){
            for(int i=1; i<max; i++){
                for(int j=1; j<=4; j++){
                    if(i-k*k<0) continue;
                    dp[i][j] += dp[i-k*k][j-1];
                }
            }
        }

        while(true){
            int n = sc.nextInt();
            if(n==0) break;
        
            int sum = 0;
            for(int i=1; i<=4; i++) sum += dp[n][i];
            System.out.println(sum);
        }
    }

    public static void main(String[] args){
        new Main().solve();
    }
}

Measured memory_bytes: 23184
class Node:
    def __init__(self,key,left,right,parent):
        self.key = key
        self.left = left
        self.right = right
        self.p = parent

    def __repr__(self):
        #return str(self.key) + "[" + str(self.p)+"]"
        return str(self.key)

def insert(T, z):
    y = None
    x = T 
    while x != None:
        y = x
        if z.key < x.key:
            x = x.left
        else:
            x = x.right
    z.p = y
    #print(x,y,z)
    if y == None:
        #print("Y==None")
        T = z
        print(T)
    elif z.key<y.key:
        #print("z.key<y.key")
        y.left = z
    else:
        #print("z.key<y.key")
        y.right = z

def find(T, k, show):
    x = T 
    while x != None:
        if k == x.key:
            if show:
                print('yes')
            return x
        if k < x.key:
            x = x.left
        else:
            x = x.right
    print('no')
    

def getScu(x):
    if x.right == None:
        y = x.p
        while x == y.right and y != None:
            x = y
            y = x.p
        return y
    x = x.right
    while x != None:
        y = x
        x = x.left
    return y




def delete(T,x):
    #print(x.key, id(x))
    if x.left == x.right == None:
        #print("x.left == x.right == None")
        if x.p.key < x.key:
            x.p.right = None
        else:
            x.p.left = None

    elif x.left == None:
        #print("x.left == None")
        y = x.right
        x.key = y.key
        x.right = y.right
        x.left = y.left
        #print(x.key, id(x))
    elif x.right == None:
        #print("x.right == None")
        y = x.left
        x.key = y.key
        x.right = y.right
        x.left = y.left
        #print(x.key, id(x))
    else:
        y = getScu(x)
        delete(T, y)
        x.key = y.key



    

def printPreorder(x):
    if x == None:
        return
    printPreorder(x.left)
    print(end=' ')
    print(x,end='')
    printPreorder(x.right)

def printMidorder(x):
    if x == None:
        return
    print(end=' ')
    print(x,end='')
    printMidorder(x.left)
    printMidorder(x.right)

def printal(x):
    printPreorder(x)
    print()
    printMidorder(x)
    print()


N = int(input())
Q = input().split()
T = Node(int(Q[1]),None,None,None)
for i in range(N-1):
    Q = input().split()
    if Q[0] == "print":
        printal(T)
        continue
    elif Q[0] == "find":
        find(T,int(Q[1]),True)
        continue
    elif Q[0] == "delete":
        delete(T,find(T, int(Q[1]), False))
        continue
    insert(T,Node(int(Q[1]),None,None,None))


Measured memory_bytes: 85360
// Problem : A - Sorted Arrays
// Contest : AtCoder - AtCoder Grand Contest 013
// URL : https://atcoder.jp/contests/agc013/tasks/agc013_a
// Memory Limit : 256 MB
// Time Limit : 2000 ms
// Powered by CP Editor (https://github.com/cpeditor/cpeditor)

#include<bits/stdc++.h>
using namespace std; 
#define ll long long int
#define pb push_back
#define mp make_pair
#define pll pair<ll,ll>
#define INF LLONG_MAX
#define PI acos(-1)
const ll MOD = 1e9 + 7;
#define fir first
#define sec second
#define all(x) x.begin(),x.end()
#define mem(a,b) memset(a,b,sizeof(a))
#define rep(c,a,b) for(ll c=a;c<b;c++)
#define IOS ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL);
#define min_heap priority_queue<pll,vector<pll>,greater<pll> >
ll dx4[]={-1,1,0,0};
ll dy4[]={0,0,-1,1};
ll dx8[]={-1,-1,-1,0,1,1,1,0};
ll dy8[]={-1,0,1,1,1,0,-1,-1};
bool isvalid(ll x,ll y,ll n,ll m)
{
    return (x>=0 and y>=0 and x<n and y<m);
}
ll isprime[1000];
vector<ll> prime;
void sievetoprime(ll n)
{
    mem(isprime,true);
    for(ll p=2;p*p<=n;p++)
    {
        if(isprime[p]==true)
        {
            for(ll i=p*p;i<=n;i+=p)
                isprime[i]=false;
        }
    }
}
ll lcm(ll a,ll b)
{
    return (a/__gcd(a,b))*b;
}
void solve()
{
    ll n;
    cin>>n;
    vector<ll> a;
    rep(i,0,n)
    {
    	ll x;
    	cin>>x;
    	if(a.size()==0)
    		a.pb(x);
    	if(a.back()!=x)
    		a.pb(x);
    }
    ll size=1,ans=1,isincr=0;
    rep(i,1,a.size())
    {
    	if(i==1)
    	{
    		size=2;
    		if(a[i]>a[i-1])
    		{
    			isincr=1;
    		}
    		//cout<<size<<" "<<isincr<<"\n";
    		continue;
    	}
    	if(isincr)
    	{
    		if(a[i]>a[i-1])
    			size++;
    		else
    		{
    			ans++;
    			i++;
    			if(i>=n)
    				break;
    			size=2;
    			isincr=0;
    			if(a[i]>a[i-1])
	    			isincr=1;
    		}
    	}
    	else
    	{
    		if(a[i]<a[i-1])
    			size++;
    		else
    		{
    			ans++;
    			i++;
    			if(i>=n)
    				break;
    			size=2;
    			isincr=0;
    			if(a[i]>a[i-1])
	    			isincr=1;
    		}
    	}
    }
    cout<<ans;
}
int main()
{
    ll inpoup = 0;
    if(inpoup==1)
    {
        #ifndef ONLINE_JUDGE
            freopen("input.txt","r",stdin);
            freopen("output.txt","w",stdout);
        #endif
    }
    IOS
    ll t;
    t=1;
    //cin>>t;
    while(t--)
    {
        solve();
    }
}

Measured memory_bytes: 1400
package main

import (
	"bufio"
	"fmt"
	"math"
	"os"
	"sort"
	"strconv"
)

var sc = bufio.NewScanner(os.Stdin)
var out = bufio.NewWriter(os.Stdout)

func main() {
	/*/TODO:!!!!!!!テスト用!!!!!!!!!
	sc = bufio.NewScanner(strings.NewReader(`

				`))
	//TODO:!!!!!!!テスト用!!!!!!!!!*/

	buf := make([]byte, 1024*1024)
	sc.Buffer(buf, bufio.MaxScanTokenSize)
	sc.Split(bufio.ScanWords)
	defer out.Flush() // !!!!caution!!!! you must use Fprint(out, ) not Print()
	/* --- code --- */
	//fmt.Fprintln(out, "[DEBUG]", time.Now())

	n := nextInt()

	xl := make([]XL, n)

	for i := 0; i < n; i++ {
		xl[i].x = nextInt()
		xl[i].l = nextInt()
	}
	sort.Sort(XSort(xl))

	ans := 0

	p := xl[0].x - xl[0].l - 1

	for i := 0; i < len(xl); i++ {
		if p <= xl[i].x-xl[i].l {
			p = xl[i].x + xl[i].l
			ans++
		}
	}

	//	fmt.Fprintln(out, "[DEBUG]]", a)
	fmt.Fprintln(out, ans)
}

type XL struct {
	x int
	l int
}

type XSort []XL

func (a XSort) Len() int           { return len(a) }
func (a XSort) Swap(i, j int)      { a[i], a[j] = a[j], a[i] }
func (a XSort) Less(i, j int) bool { return a[i].x+a[i].l < a[j].x+a[j].l }

//------------------------------------------------------------------------------

// -*-*-*-*-*-*-*-*-
// * I/O utilities *
// -*-*-*-*-*-*-*-*-

func next() string {
	sc.Scan()
	return sc.Text()
}

func nextInt() int {
	a, _ := strconv.Atoi(next())
	return a
}

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

func nextInts(n int) []int {
	ret := make([]int, n)
	for i := 0; i < n; i++ {
		ret[i] = nextInt()
	}
	return ret
}
func nextFloats(n int) []float64 {
	ret := make([]float64, n)
	for i := 0; i < n; i++ {
		ret[i] = nextFloat64()
	}
	return ret
}
func nextStrings(n int) []string {
	ret := make([]string, n)
	for i := 0; i < n; i++ {
		ret[i] = next()
	}
	return ret
}

func chars(s string) []string {
	ret := make([]string, len([]rune(s)))
	for i, v := range []rune(s) {
		ret[i] = string(v)
	}
	return ret
}

func absInt(x int) int {
	return int(math.Abs(float64(x)))
}
func minInt(x, y int) int {
	if x < y {
		return x
	}
	return y
}
func maxInt(x, y int) int {
	if x > y {
		return x
	}
	return y
}


Measured memory_bytes: 5248
from math import sqrt,ceil
S=int(input())

s=ceil(sqrt(S))
adit=pow(s,2)-S
a=0
b=0
#n = int(ceil(sqrt(adit)))
n=ceil(sqrt(adit))
#print(n)
primes = set(range(2, n+1))
for i in range(2, int(n**0.5+1)):
    primes.difference_update(range(i*2, n+1, i))
primes=list(primes)
primes.sort(reverse=True)
primes.append(1)
#print(primes,adit)
for i in primes:
    if adit%i==0:
        a=i
        b=adit//i
        break

#print(s,a,b)
#print(s*s-a*b)
if n==0:
    print(0,0,s,0,0,s)
else:
    print(0,0,a,s,s,b)

Measured memory_bytes: 43884
def read_input():
    a, b, x = map(int, input().split())
    return a, b, x

def submit():
    # nをmで割った商の切り上げ
    def divide_ceil(n, m):
        if n % m == 0:
            return n // m
        return n // m + 1

    # nをmで割った商の切捨て
    def divide_floor(n, m):
        return n // m

    a, b, x = read_input()

    a_coef = divide_ceil(a, x)
    b_coef = divide_floor(b, x)

    print(b_coef - a_coef + 1)


if __name__ == '__main__':
    submit()


Measured memory_bytes: 38384
using System;
using System.Collections.Generic;
using System.Text;

class Program
{

    public void Proc()
    {
        this.Num = int.Parse(Console.ReadLine());
        this.NumS = VMAX;

        string[] inpt = Console.ReadLine().Split(' ');
        for(int i=0; i<this.Num;i++) {
            this.ArrA[i] = int.Parse(inpt[i]);
            this.NumS = Math.Min(this.NumS, this.ArrA[i]);
        }
        int ans = this.Solve();
        Console.WriteLine(ans);
    }

    private const int MAX = 1000;
    private const int VMAX = 10000;

    private int[] ArrA = new int[MAX];
    private int[] ArrB = new int[MAX];
    private int[] ArrT = new int[VMAX + 1];
    private int Num = 0;
    private int NumS = 0;

    private int Solve()
    {
        int ans = 0;

        bool[] arrV = new bool[MAX];
        this.ArrB = new int[this.Num];
        for(int i=0; i<this.Num; i++) {
            this.ArrB[i] = this.ArrA[i];
            arrV[i] = false;
        }
        Array.Sort(this.ArrB);
        for(int i=0; i<this.Num; i++) {
            this.ArrT[this.ArrB[i]] = i;
        }
        for(int i=0; i<this.Num; i++) {
            if(arrV[i]) {
                continue;
            }
            int cur = i;
            int S = 0;
            int m = VMAX;
            int an = 0;
            while(true) {
                arrV[cur] = true;
                an++;
                int v = this.ArrA[cur];
                m = Math.Min(m, v);
                S += v;
                cur = this.ArrT[v];
                if (arrV[cur])
                {
                    break;
                }
            }
            ans += Math.Min(S + (an - 2) * m, m + S + (an + 1) * this.NumS);
        }
        return ans;
    }


    static void Main(string[] args)
    {
        Program prg = new Program();
        prg.Proc();
    }
}

Measured memory_bytes: 9472
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>

#define FOR(i, a, b) for(int i = (a); i < (b); i++)
#define rep(i, n) FOR(i, 0, n)

using namespace std;

int main(){
	int n;
	cin >> n;
	int res = 0;
	while(n--){
		char p;
		int k = 1, x;
		cin >> p >> x;
		if(p == ')') k*= -1;
		res += x*k;
		if(res < 0) break;
	}
	cout << (res==0?"YES":"NO") << endl;

	return 0;
}

Measured memory_bytes: 1160
N = int(input())
s = {}
t_get = 0
for i in range(N):
    tmp = input()
    if (tmp in s.keys()) == False:
        s[tmp] = 1
    else:
        s[tmp] += 1

M = int(input())
for i in range(M):
    tmp = input()
    if(tmp in s.keys()) == False:
        s[tmp] = -1
    else:
        s[tmp] -= 1

for value in s.values():
    if value > t_get:
        t_get = value
print(t_get)


Measured memory_bytes: 3064
#include <bits/stdc++.h>
    using namespace std;
 
    #define fast ios_base::sync_with_stdio(false),cin.tie(NULL),cout.tie(NULL)
    #define mod 1000000007
    #define qmod 998244353
    #define M 1000001
    #define endl "\n"
    #define all(a) (a).begin(),(a).end()
    #define rep(i,a,b) for(int i=a;i<b;++i)
    #define repr(i,a,b) for(int i=a;i>=b;--i)
    #define F first
    #define S second
    #define pb push_back
    #define mp make_pair

    typedef long long ll;
    typedef pair<int,int> pii;
    typedef vector<int> vi;
    typedef vector<string> vs;
    typedef vector<pii> vii;
    typedef vector<vi> vvi; 

    int main(){
        
    /*#ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin); 
    freopen("output.txt","w",stdout);   
    #endif */ 
 
        fast;
        int x,y,a,b,c;
        cin>>x>>y>>a>>b>>c;
        vi p,q,r;
        rep(i,0,a) {int t;cin>>t; p.pb(t);}
        rep(i,0,b) {int t;cin>>t; q.pb(t);}
        rep(i,0,c) {int t;cin>>t; r.pb(t);}
        sort(all(p),greater<int>());
        sort(all(q),greater<int>());
        sort(all(r),greater<int>());
        vi A;
        ll ans=0;
        rep(i,0,x) A.pb(p[i]);
        rep(i,0,y) A.pb(q[i]);
        rep(i,0,c) A.pb(r[i]);
        sort(all(A),greater<int>());
        rep(i,0,x+y) ans+=A[i];
        cout<<ans<<endl;
        return 0;  
    } 


Measured memory_bytes: 3572
n = gets.to_i
cities = []
n.times { cities << gets.split.map(&:to_i) }
def distance(x1, y1, x2, y2)
  Math.sqrt((x1 - x2) ** 2 + (y1 - y2) ** 2)
end

array = []
cities.combination(2).each do |(x1, y1), (x2, y2)|
  array << distance(x1, y1, x2, y2)
end

sum = array.inject(:+)
avg = sum / array.size
puts avg * (n - 1)


Measured memory_bytes: 1788
#include <iostream>
#include <cstdlib>
#include <vector>
#include <algorithm>
#include <cstring>
#include <iomanip>
#include <cmath>
#include <tuple>
#include <map>
#include <unordered_map>
using namespace std;
typedef long long ll;

int main(int argc, char *argv[])
{
    int n, i;
	cin >> n;
	vector<char> slime(n);
	char tmp;

	for (i = 0; i < n; i++)
		cin >> slime[i];

	auto itr = unique(slime.begin(), slime.end());
	slime.erase(itr, slime.end());

	cout << slime.size() << endl;	 

	return 0;
}


Measured memory_bytes: 384
n = int(input())
s = input()
r = s.count('R')
g = s.count('G')
b = s.count('B')
ans = r*g*b
for i in range(n-2):
    for j in range(i+1, n-1):
        k = 2*j - i
        if k >= n:
            break 
        if s[i]!=s[j] and s[k]!= s[i] and s[j]!=s[k]:
            ans -= 1
print(ans)


Measured memory_bytes: 73436
/*"for if God is with them who can be against them."
   it's beter to die struggling than to abandon the effort where there is still
   a chance of accomlishing something more..NEVER GIVE UP.
   */

/* "IF THERE IS NO WAY OUT LOOK AT THE BOTTOM". */
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef pair<int, int> pii;
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);
#define F first
#define S second
#define PB push_back
#define MP make_pair
#define endl '\n'
#define REP(i,a,b) for(int i=a;i<=b;i++)
#define all(a) a.begin(),a.end()
#define watch(x) cout << (#x) << " is " << (x) << endl
void solve() {
	string s;
	cin >> s;
	int n = s.size();
	ll ans = 0, k = 9;
	for (int i = 0; i < n; i++) {
		ans += (s[i] - '0');
	}
	if (ans % k == 0) {
		cout << "Yes";
	}
	else
		cout << "No";
}

int main() {
#ifndef ONLINE_JUDGE
	freopen("input1.txt", "r", stdin);
	freopen("output1.txt", "w", stdout);
#endif
	IOS;
	int t = 1;
	//cin >> t;
	while (t--) {
		solve();
	}
#ifndef ONLINE_JUDGE
	cout << "\nTime Elapsed: " << 1.0 * clock() / CLOCKS_PER_SEC << " sec\n";
#endif
	return 0;
	/*TRY AGAIN, NO MATTER HOW MANY TIMES YOU FAILED ALWAYS TRY ONCE MORE*/
}

Measured memory_bytes: 3780
#!usr/bin/env python3
from collections import defaultdict, deque, Counter, OrderedDict
import collections, heapq, itertools, bisect
import math, fractions
import sys, copy

def LI(): return [int(x) for x in sys.stdin.readline().split()]
def LI1(): return [int(x) - 1 for x in sys.stdin.readline().split()]
def I(): return int(sys.stdin.readline().rstrip())
def LS(): return [list(x) for x in sys.stdin.readline().split()]
def S(): return list(sys.stdin.readline().rstrip())
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def LSR(n): return [LS() for i in range(n)]

sys.setrecursionlimit(1000000)
dire = [[1, 0], [0, 1], [-1, 0], [0, -1]]
dire8 = [[1, 0], [1, 1], [0, 1], [-1, 1], [-1, 0], [-1, -1], [0, -1], [1, -1]]
MOD = 1000000007

def main():
    H, W, K = LI()
    maze = SR(H)
    ans = 0
    for h in range(H+1):
        for w in range(W+1):
            for painted_row in itertools.combinations(range(H), h):
                for painted_col in itertools.combinations(range(W), w):
                    black = 0
                    for i in range(H):
                        for j in range(W):
                            if (i not in painted_row) and (j not in painted_col) and maze[i][j] == "#":
                                black += 1
                    if black == K:
                        ans += 1

    print(ans)


if __name__ == '__main__':
    main()

Measured memory_bytes: 79144
import std;

alias sread = () => readln.chomp();
alias lread = () => readln.chomp.to!long();
alias aryread(T = long) = () => readln.split.to!(T[]);
//aryread!string();
//auto PS = new Tuple!(long,string)[](M);
//x[]=1;でlong[]全要素1に初期化
void main()
{
    auto n = lread();
    auto a = aryread();
    // writeln(a);
    long cnt = 1;
    foreach (i; 0 .. n)
    {
        if (a[i] == cnt)
        {
            // writeln(a[i], ' ', i);
            cnt += 1;
        }
        else
        {
            continue;
        }
    }
    if (cnt == 1)
    {
        writeln(-1);
        return;
    }
    else
    {
        writeln(a.length - cnt + 1);
    }

}

void scan(L...)(ref L A)
{
    auto l = readln.split;
    foreach (i, T; L)
    {
        A[i] = l[i].to!T;
    }
}

void arywrite(T)(T a)
{
    a.map!text.join(' ').writeln;
}


Measured memory_bytes: 12496
import sys
from math import factorial


def cmb(n, r, mod):
    if ( r<0 or r>n ):
        return 0
    r = min(r, n-r)
    return g1[n] * g2[r] * g2[n-r] % mod

mod = 10**9 + 7
x, y = map(int, sys.stdin.readline().split())

if (x + y)%3 != 0:
    print(0)
    sys.exit()
if y < x/2 and y > 2*x:
    print(0)
    sys.exit()

count1 = int((y-2*x)/(-3))
count2 = int((x-2*y)/(-3))

sum = count1 + count2

N = 10**4
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

for i in range( 2, sum + 1 ):
    g1.append( ( g1[-1] * i ) % mod )
    inverse.append( ( -inverse[mod % i] * (mod//i) ) % mod )
    g2.append( (g2[-1] * inverse[-1]) % mod )

a = cmb(sum,count1,mod)

print(a)


Measured memory_bytes: 82452
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef vector<long long> vll;
typedef vector<pair<int,int>> vp;
typedef pair<int,int> pii;
#define INF (int)(1e9)
#define MAXX 1.1529215e+18
#define inf 999999
#define EPS (1e-7)
#define rep(i,n) for(int i=0; i<(int)(n);i++)
#define REP(i,n) for(int i=1;i<=(int)(n);i++)
#define FOR(i,k,n) for(int i=(k);i<(int)(n);i++)
#define ALL(a)  a.begin(),a.end()
#define RALL(a) a.begin(),a.end(),greater<int>()
#define ROT(a) a.begin(),a.begin()+1,a.end()
#define RROT(a) a.begin(),a.end()-1,a.end()
#define PB push_back
#define MP make_pair
#define PI acos(-1.0)
#define sz(a) a.size()
const ll MOD = 1e9+7;
const int MAX = 10000000;
template<typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { if (a < b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a, T b) { if (b == 0) return a; return gcd(b, a % b); }
//cout << 'H' << endl;
//next_permutation(ALL(p));
//typedef priority_queue<int> pque;//これは大きい順
//typedef priority_queue<int, vector<int>, greater<int>> pque;//これは小さい順
//factorizeは、素因数分解用の関数

int main(){
	int n;
	cin >> n;
	std::vector<int> a(n);
	rep(i,n) cin >> a[i];


	int max_i = 0;
	int second_i = 1;
	FOR(i,1,n) {
		if(a[i] >= a[max_i]){
			second_i = max_i;
			max_i = i;
		}else if(a[i] >= a[second_i]){
			second_i = i;
		}
	}

	rep(i,n) {
		if(i != max_i){
			cout << a[max_i] << endl;
		}else{
			cout << a[second_i] << endl;
		}
	}

  return 0;
}


Measured memory_bytes: 2432
#include <stdio.h>
int main() {
	char s[7];
	int cnt = 0;
	scanf("%s", s);
	for (int i = 0; i < 6; i++) {
		if (s[i] == '1') {
			cnt++;
		}
	}
	printf("%d\n", cnt);
	return 0;
}

Measured memory_bytes: 128
N, M = map(int, input().split())
a = [int(input()) for _ in range(M)]
dp = [0]*(N+1)
dp[0] = 1
for i in a:
  dp[i] = -1
for i in range(1, N+1):
  if dp[i] == -1:
    dp[i] = 0
    continue
  if i > 1:
    dp[i] = (dp[i-1] + dp[i-2]) % 1000000007
  else:
    dp[i] = dp[0] % 1000000007
print(dp[N])

Measured memory_bytes: 7824
#include<bits/stdc++.h>
using namespace std;
typedef long long LL;
typedef vector<int> vi;
typedef vector<vi> vii;
#define fi first
#define se second
#define pb push_back
#define forn(i,n) for(int i=0;i<(n);i++)
#define for1(i,n) for(int i=1;i<=n;i++)
#define forr(i,n) for(int i=n;i>=0;i--)
#define all(x) x.begin(), x.end()
#define sz(x) ((int)x.size())
const int MAXN = 1e5 +5;

void fio(){
  ios::sync_with_stdio(0);
  cin.tie(0);
  cout.tie(0);
}

int main(){
  fio();
  LL a,b,c; cin>>a>>b>>c;
  LL k; cin>>k;
  while(b <= a) {
  	b *= 2;
  	k--;
  }
  while(c <= b){
  	c *= 2;
  	k--;
  }
  if(k >=0 ){
  	cout<<"Yes"<<endl;
  }
  else cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 3608
from collections import defaultdict


def main():
    d = {"A": (1, 3, 5, 7, 8, 10, 12), "B": (4, 6, 9, 11), "C": (0, 2)}
    x, y = map(int, input().split())
    a, b = None, None
    for k, v in d.items():
        if x in v:
            a = k
        if y in v:
            b = k
    print("Yes" if a == b else "No")


if __name__ == '__main__':
    main()


Measured memory_bytes: 3316
def calc(a, op, b):
	if op == "+":
		return a + b
	else:
		return a - b
s = input()
A, B, C, D = [int(c) for c in s]
ops = ["+", "-"]
ans = ""
for op1 in ops:
	for op2 in ops:
		for op3 in ops:
			if calc(calc(calc(A, op1, B), op2, C), op3, D) == 7:
				ans = str(A) + op1 + str(B) + op2 + str(C) + op3 + str(D) + "=7"

print(ans)


Measured memory_bytes: 3064
#include <stdio.h>

int main(void)
{
	int n, i, j;
	int num[5000];
	int sum, big;
	
	while (1){
		scanf("%d", &n);
		
		if (n == 0){
			break;
		}
		
		for (i = 0; i < n; i++){
			scanf("%d", &num[i]);
		}
		
		big = num[0];
		
		for (i = 0; i < n; i++){
			sum = 0;
			for (j = i; j < n; j++){
				sum += num[j];
				if (sum > big){
					big = sum;
				}
			}
		}
		printf("%d\n", big);
	}
	
	
	return (0);
}

Measured memory_bytes: 612
import java.util.*;

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

        if (price % 1000 == 0){
          Integer count_bill = (price / 1000);
          change = ((count_bill * 1000) - price); 
        }
        else{
          Integer count_bill = (price / 1000) + 1;
          change = ((count_bill * 1000) - price); 
        }
        
        System.out.println(change);
    }
}

Measured memory_bytes: 35676
import java.io.*;
import java.util.*;
import java.lang.*;

public class Main {
    public static FScanner sc;
    public static PrintWriter out;
    public static void main(String[] args) {
        sc=new FScanner();
        out=new PrintWriter(new BufferedOutputStream(System.out));

        int a = sc.nextInt();
        int b = sc.nextInt();
        int oneSocket = 1;
        int ans = 0;
        while(oneSocket < b){
            oneSocket += a - 1;
            ans++;
        }
        System.out.println(ans);



        out.close();

    }

    public static class FScanner {
    BufferedReader br;
    StringTokenizer st;

    public FScanner() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

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

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

const int MAX_N = 1e5 + 5;
const int MAX_L = 20; // ~ Log N
const long long MOD = 1e9 + 7;
const long long INF = 1e9 + 7;

typedef long long ll;
typedef vector<int> vi;
typedef pair<int,int> ii;
typedef vector<ii> vii;
typedef vector<vi> vvi;

void solve() {
	
    string s;
    cin >> s;

    cerr << 4 % 9 << endl;
    
    ll sum = 0;
    for(auto &c:s)sum += c-'0';

    sum%9 == 0 ? cout << "Yes" : cout << "No";
}
int main() {
    
    ios_base::sync_with_stdio(false);cin.tie(NULL); 
    #ifndef ONLINE_JUDGE
        freopen("input.txt", "r", stdin);
        freopen("output.txt", "w", stdout);
        freopen("error.txt","w",stderr);
    #endif



    solve();
    
   

     cerr<<"\ntime taken : "<<(float)clock()/CLOCKS_PER_SEC<<" secs"<<endl; 
   return 0; 
}

Measured memory_bytes: 4016
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n)  for(long long i=0;i<(long long)(n);i++)
#define REP(i,k,n) for(long long i=k;i<(long long)(n);i++)
#define all(a) a.begin(),a.end()
#define eb emplace_back
#define pb push_back
#define lb(v,k) (lower_bound(all(v),k)-v.begin())
#define chmin(x,y) if(x>y)x=y
#define chmax(x,y) if(x<y)x=y
typedef long long ll;
typedef pair<ll,ll> P;
typedef tuple<ll,ll,ll> PP;
typedef priority_queue<ll> PQ;
typedef priority_queue<ll,vector<ll>,greater<ll>> SPQ;
using vi=vector<ll>;
using vvi=vector<vector<ll>>;
using vc=vector<char>;
using vvc=vector<vector<char>>;
const ll inf=100100100100;
const int Inf=1001001001;
const int mod=1000000007;
int main(){
    int n,m,c,ans=0;cin>>n>>m>>c;
    vi v(m);
    rep(i,m)cin>>v[i];
    rep(i,n){
        ll sum=0;
        rep(j,m){
            int a;cin>>a;
            sum+=a*v[j];
        }
        if(sum+c>0)ans++;
    }
    cout<<ans<<endl;
}

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

int main() {

	while(1){
		double a=0.0,sum=0.0,sumv=0.0;
		double aa[1002];
		cin>>a;
		if(a==0)return 0;
		for (int i = 0; i < a; ++i) {
			cin>>aa[i];
			sum+=aa[i];
		}
		for (int i = 0; i < a; ++i) {
					sumv+=(aa[i]-sum/a)*(aa[i]-sum/a);
		}
		printf("%.10f\n",sqrt(sumv/a));
	}
}

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

int main(){
	int h, w; cin >> h >> w;
	int count[26] = {};
	for(int i = 0; i < h * w; ++i){
		char a; cin >> a;
		++count[a - 'a'];
	}
	int po = (h / 2) * (w / 2);
	int pi = ((h & 1) ? w / 2 : 0) + ((w & 1) ? h / 2 : 0);
	for(int i = 0; i < 26; ++i){
		if(count[i] / 4 < po){
			po -= count[i] / 4;
			count[i] %=  4;
		}else{
			count[i] -= po * 4;
			po = 0;
			break;
		}
	}
	for(int i = 0; i < 26; ++i)pi -= count[i] / 2;
	if(pi <= 0  && !po) cout << "Yes\n";
	else cout << "No\n";
	return 0;
}

Measured memory_bytes: 256
//
// Created on 2020/04/15.
//


#include <iostream> // cout, endl, cin
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
#include <math.h>
#include <ios>
#include <iomanip>
#include <numeric>

#define all(x) (x).begin(),(x).end()
typedef long long ll;
using namespace std;
const long long LINF =1e18;
const int INF = 1e9;


int main() {
    string ans = "Yes";
    int n;
    cin>>n;

    vector<int>h(n);
    for (int i = 0; i < n; ++i) {
        cin>>h[i];
    }
    if(n==1){
        cout<<ans<<endl;
        return 0;
    }
    for (int j = n-1; j > 0; --j) {
        if(h[j-1] - h[j] == 1){
            h[j-1]--;
            if(h[j-1] < 1){
                ans="No";
                break;
            }
        }else if(h[j-1] - h[j] > 1){
            ans = "No";
            break;
        }else{
            continue;
        }
    }

    cout<<ans<<endl;
    return 0;
}


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

using namespace std;
int a[2000];
vector<int> b;

int main() {
    
    int i,j,k,n,cnt=0,sum=0;
    cin>>n;
    for(i=0;i<n;i++){
        cin>>a[i];
        b.push_back(a[i]);
        
    }
    //countT(b);
    sort(b.begin(),b.end());
    for(i=0;i<n;i++){
        for(j=i+1;j<n;j++){
            int x=b[i];
            int y=b[j];
          
            int id=lower_bound(b.begin(),b.end(),x+y)-b.begin();
          
            sum+=(id-j-1);
    
            
            
        }
    }
    
    cout<<sum;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <iostream>
#include<math.h>
using namespace std;
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
int main()
{
    int64_t N, T;
    cin >> N >> T;
    int64_t start_time = 0;
    int64_t oyu_time = T;
    vector<int64_t>pushs(N);
    for (int64_t i=0; i<N; i++) {
        cin >> pushs.at(i);
    }

    for (int64_t i=0; i<N; i++) {
        int64_t push_time = pushs[i];
        int64_t sa = push_time - start_time;
        if (T > sa) {
            oyu_time += sa;
        } else {
            oyu_time += T;
        }

        start_time = push_time;
    }

    cout << oyu_time << endl;
    return 0;
}

Measured memory_bytes: 4764
import collections

N = int(input())
s = [input() for i in range(N)]
M = int(input())
t = [input() for i in range(M)]

count_s = collections.Counter(s)
count_t = collections.Counter(t)
ans = 0
for key in count_s:
    point = count_s[key]
    if key in count_t.keys():
         point -= count_t[key]
    
    if ans < point:
        ans = point
print(ans)

Measured memory_bytes: 3444
import sys

i = 0
for line in sys.stdin:
    n,x = line.split()
    n = int(n)
    x = int(x)

    if n == 0 and x == 0: break
    c = 0
    for i in range(1, n+1):
        for j in range(i+1, n+1):
            ij = i + j
            for k in range(j+1, n+1):
                if ij+k == x:
                    c +=1
    print c    

Measured memory_bytes: 4232
//
// starry sky tree
//
// verified:
//   AOJ Course Range Query - RMQ and RAQ
//     http://judge.u-aizu.ac.jp/onlinejudge/description.jsp?id=DSL_2_H&lang=jp
//


/*
    // Construction
    SegTree(n, unity_monoid, unity_lazy)
      ex: starry sky tree (区間加算、区間min取得)


    // Initialization
    init(n): サイズ n に初期化
    set(a, v): a 番目の値を v にセットする
    build(): set した値を元にセグメントツリー全体を構築する、O(n)
    

    // Queries
    update(a, b, v): 区間 [a, b) に v を加算, O(log n)
    get(a, b): 区間 [a, b) の最小値を返す, O(log n)
*/


#include <iostream>
#include <vector>
#include <functional>
using namespace std;


template<class Monoid, class Lazy> struct StarrySky {
    const Monoid INF;
    const Lazy ZERO;
    int SIZE;
    vector<pair<Monoid, int> > dat;
    vector<Lazy> lazy;
    
    StarrySky(int n, const Monoid &inf, const Lazy &zero) : INF(inf), ZERO(zero) {
        init(n);
    }
    void init(int n) {
        SIZE = 1;
        while (SIZE < n) SIZE <<= 1;
        dat.assign(SIZE * 2, {INF, -1});
        lazy.assign(SIZE * 2, ZERO);
    }
    
    /* set, a is 0-indexed */
    void set(int a, const Monoid &v) { dat[a + SIZE] = {v, a}; }
    void build() {
        for (int k = SIZE - 1; k > 0; --k)
            dat[k] = min(dat[k*2], dat[k*2+1]);
    }
    
    /* update [a, b) */
    inline void evaluate(int k) {
        if (lazy[k] == ZERO) return;
        if (k < SIZE) lazy[k*2] += lazy[k], lazy[k*2+1] += lazy[k];
        dat[k].first += lazy[k];
        lazy[k] = ZERO;
    }
    inline void update(int a, int b, const Monoid &v, int k, int l, int r) {
        evaluate(k);
        if (a <= l && r <= b) lazy[k] += v, evaluate(k);
        else if (a < r && l < b) {
            update(a, b, v, k*2, l, (l+r)>>1), update(a, b, v, k*2+1, (l+r)>>1, r);
            dat[k] = min(dat[k*2], dat[k*2+1]);
        }
    }
    inline void update(int a, int b, const Monoid &v) { update(a, b, v, 1, 0, SIZE); }
    
    /* get [a, b) */
    inline pair<Monoid,int> get(int a, int b, int k, int l, int r) {
        evaluate(k);
        if (a <= l && r <= b)
            return dat[k];
        else if (a < r && l < b)
            return min(get(a, b, k*2, l, (l+r)>>1), get(a, b, k*2+1, (l+r)>>1, r));
        else
            return {INF, -1};
    }
    inline pair<Monoid,int> get(int a, int b) { return get(a, b, 1, 0, SIZE); }
    inline Monoid operator [] (int a) { return get(a, a+1).first; }
    
    /* debug */
    void print() {
        for (int i = 0; i < SIZE; ++i) { cout << (*this)[i]; if (i != SIZE) cout << ","; }
        cout << endl;
    }
};



int main() {
    int N, Q; scanf("%d %d", &N, &Q);
    StarrySky<long long, long long> sk(N, (1LL<<60), 0);

    // 0 で初期化
    for (int i = 0; i < N; ++i) sk.set(i, 0);
    sk.build();

    // 各クエリ
    for (int q = 0; q < Q; ++q) {
        int type, a, b; scanf("%d %d %d", &type, &a, &b);
        if (type == 0) {
            long long v; scanf("%lld", &v);
            sk.update(a, b+1, v);
        }
        else {
            cout << sk.get(a, b+1).first << endl;
        }
    }
}



Measured memory_bytes: 8916
import java.util.Scanner;

public class Main {
	void run() {
		// 入力
		Scanner scan = new Scanner(System.in);
		int a = scan.nextInt();
		int b = scan.nextInt();
		
		int mod;
		do {
			mod = a%b;
			a = b;
			b = mod;
		} while(mod != 0);
		// 出力
		System.out.println(a);
	}
	
	public static void main(String[] args) {
		new Main().run();
	}
}


Measured memory_bytes: 26336