akhauriyash/Code-Regression huggingface dataset:
N = int(raw_input())
s = list(raw_input())
t = list(raw_input())

length = N*2

i = 1
MAX = 0
while i <= N:
   
    cs =  t[0:i]
    ct = s[N-i:N]
    #print cs , ct
    
    
    #print cs,ct,i
    if cs == ct:
        MAX = i 
    else:
        next
    i+=1

print N*2-MAX

Measured memory_bytes: 2568
#include<iostream>
#include<vector>

using namespace std;

int main() {
	
	int n;
	cin >> n;
	
	int choice;
	int temp;	
	vector<int> vs;
	vs.clear();
	
	for(int i=0;i<n;i++) {
		
		cin >> choice;
		switch(choice) {
			case 0:
				cin >> temp;
				vs.push_back(temp);
				break;
			case 1:
				cin >> temp;
				cout << vs[temp] << "\n";
				break;
			case 2:
				vs.pop_back();
				break;
		}
	}
	
	return 0;
}


Measured memory_bytes: 3924
<?php
$str = trim(fgets(STDIN));
$l = strlen($str);
for($i = 0; $i < $l-1; $i++){
  if($str[$i] == $str[$i+1]){
    echo $i+1," ",$i+2,"\n";
    exit;
  }
}
for($i = 0; $i < $l-2; $i++){
  if($str[$i] == $str[$i+2]){
    echo $i+1," ",$i+3,"\n";
    exit;
  }
}

echo "-1 -1\n";

Measured memory_bytes: 4604
int_list = sorted(list(map(int,input().split()))) #標準入力してリスト化して小さい順に並べる
int_list.reverse() #リストの順番を逆にする
l = [str(a) for a in int_list] #リストのタイプをstr化する
s = ' '.join(l) #リストを連結する
print(s) #出力


Measured memory_bytes: 5600
#include<bits/stdc++.h>
#define lld long long int
#define vec vector<lld>
using namespace std;
int main(){
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    cout.tie(NULL);
    //code :-
lld n,i,b,sum=0;
cin>>n>>b;
lld a[n];
for(i=0;i<n;i++)cin>>a[i];
sort(a,a+n);
for(i=0;i<b;i++){
    sum+=a[i];
}
cout<<sum<<endl;
return 0;
}



Measured memory_bytes: 3640
#include <cstdio>
#include <iostream>
#include <string>
#include <sstream>
#include <stack>
#include <algorithm>
#include <cmath>
#include <queue>
#include <map>
#include <set>
#include <cstdlib>
#include <bitset>
#include <tuple>
#include <assert.h>
#include <deque>
#include <bitset>
#include <iomanip>
#include <limits>
#include <chrono>
#include <random>
#include <array>
#include <unordered_map>
#include <functional>
#include <complex>
#include <numeric>
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

constexpr long long MAX = 5100000;
constexpr long long INF = 1LL << 60;
constexpr int inf = 1 << 28;
constexpr long long mod = 1000000007LL;
//constexpr long long mod = 998244353LL;

using namespace std;
typedef unsigned long long ull;
typedef long long ll;

int main()
{
	/*
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	*/
	ll n; scanf("%lld", &n);
	vector<ll> a(n); for (int i = 0; i < n; i++) scanf("%lld", &a[i]);
	vector<ll> v;
	for (ll len = 1; len <= 5; len++) {
		for (int i = 0; i <= n - len; i++) {
			ll tmp = 0;
			for (int j = 0; j < len; j++) {
				tmp = tmp * 10 + a[i + j];
			}
			v.push_back(tmp);
		}
	}
	sort(v.begin(), v.end());
	v.erase(unique(v.begin(), v.end()), v.end());
	for (int i = 0; i <= 100000; i++) {
		if (!binary_search(v.begin(), v.end(), i)) {
			cout << i << endl;
			return 0;
		}
	}
	return 0;

}



Measured memory_bytes: 3348
#include<iostream>
#include<iomanip>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<functional>
#include<map>
#include<cstdlib>
#include<complex>
#include<numeric>
#include<set>
#include<deque>
#include<queue>

using namespace std;
using Int = long long;
Int INF = 1LL << 60;
const Int MOD = 1000000000 + 7;

int main() {

	cin.tie(nullptr);
	ios::sync_with_stdio(false);

	Int n, a, b;
	cin >> n >> a >> b;

	if (a*n<b) {
		cout << a*n << "\n";
	}
	else {
		cout << b << "\n";
	}

}


Measured memory_bytes: 256
using System;

namespace _0512
{
    class Program
    {
        static void Main(string[] args)
        {
            string s = Console.ReadLine();
            for (int i = 0; i < s.Length; i++)
            {
                if (s[i] == 'A')
                {
                    Console.Write("X");
                }
                if (s[i] == 'B')
                {
                    Console.Write("Y");
                }
                if (s[i] == 'C')
                {
                    Console.Write("Z");
                }
                if (s[i] == 'D')
                {
                    Console.Write("A");
                }
                if (s[i] == 'E')
                {
                    Console.Write("B");
                }
                if (s[i] == 'F')
                {
                    Console.Write("C");
                }
                if (s[i] == 'G')
                {
                    Console.Write("D");
                }
                if (s[i] == 'H')
                {
                    Console.Write("E");
                }
                if (s[i] == 'I')
                {
                    Console.Write("F");
                }
                if (s[i] == 'J')
                {
                    Console.Write("G");
                }
                if (s[i] == 'K')
                {
                    Console.Write("H");
                }
                if (s[i] == 'L')
                {
                    Console.Write("I");
                }
                if (s[i] == 'M')
                {
                    Console.Write("J");
                }
                if (s[i] == 'N')
                {
                    Console.Write("K");
                }
                if (s[i] == 'O')
                {
                    Console.Write("L");
                }
                if (s[i] == 'P')
                {
                    Console.Write("M");
                }
                if (s[i] == 'Q')
                {
                    Console.Write("N");
                }
                if (s[i] == 'R')
                {
                    Console.Write("O");
                }
                if (s[i] == 'S')
                {
                    Console.Write("P");
                }
                if (s[i] == 'T')
                {
                    Console.Write("Q");
                }
                if (s[i] == 'U')
                {
                    Console.Write("R");
                }
                if (s[i] == 'V')
                {
                    Console.Write("S");
                }
                if (s[i] == 'W')
                {
                    Console.Write("T");
                }
                if (s[i] == 'X')
                {
                    Console.Write("U");
                }
                if (s[i] == 'Y')
                {
                    Console.Write("V");
                }
                if (s[i] == 'Z')
                {
                    Console.Write("W");
                }
            }
            Console.WriteLine();
        }
    }
}

Measured memory_bytes: 8820
S=lambda:input()
I=lambda:int(input())
L=lambda:list(map(int,input().split()))
LS=lambda:list(map(str,input().split()))

n=I()
zoro=0
for i in range(n):
    d1,d2=L()
    if d1==d2:
        zoro+=1
    else:
        zoro=0
    if zoro>=3:
        print('Yes')
        exit()
print('No')

Measured memory_bytes: 9184
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
template<class T> inline bool chmax(T& a,T b){if(a<b){a=b;return true;}return false;}
template<class T> inline bool chmin(T& a,T b){if(a>b){a=b;return true;}return false;}
const ll INF = 1LL<<60;
const ll M = pow(10,9)+7;
/*template*/


int main()
{
  ll a[32]={1, 1, 1, 2, 1, 2, 1, 5, 2, 2, 1, 5, 1, 2, 1, 14, 1, 5, 1, 5, 2, 2, 1, 15, 2, 2, 5, 4, 1, 4, 1, 51};
  ll k;cin>>k;
  cout<<a[k-1]<<endl;
  return 0;
}


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

bool binarySearch(int A[], int n, int key)
{
    int left = 0;
    int right = n;
    int mid;

    while (left <= right) {
        mid = (left + right) / 2;
        if (key == A[mid]) {
            return true;
        } else if (key > A[mid]) {
            left = mid + 1;
        } else {
            right = mid - 1;
        }
    }

    return false;
}

int main()
{
    int n, q, t;
    int A[100000];
    int sum = 0;

    scanf("%d", &n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &A[i]);
    }

    scanf("%d", &q);
    for (int i = 0; i < q; i++) {
        scanf("%d", &t);
        if (binarySearch(A, n, t)) {
            sum++;
        }
    }

    printf("%d\n", sum);
    return 0;
}


Measured memory_bytes: 2120
import fractions
A, B, C, D = map(int, input().split())
X = abs(C-A)
Y = abs(D-B)
if X == 0 or Y == 0:
  print(0)
else:
  #(0,0),(X,Y)間にある格子点の数をまず数えます
  g = fractions.gcd(X, Y)
  print(X+Y-g)

Measured memory_bytes: 5432
#[allow(unused_macros, dead_code)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes
                .by_ref()
                .map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}
#[allow(unused_macros, dead_code)]
macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr, ) => {};
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
    ($next:expr, mut $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}
#[allow(unused_macros, dead_code)]
macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => {
        ( $(read_value!($next, $t)),* )
    };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, bytes) => {
        read_value!($next, String).into_bytes()
    };
    ($next:expr, usize1) => {
        read_value!($next, usize) - 1
    };
    ($next:expr, $t:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

fn main() {
    input! {
        n: usize,
        m: usize,
    }

    let mut ans = vec![];
    let mut M = m;
    let mut s = 1;
    loop {
        ans.push((s, s + M));
        s += 1;
        if M <= 2 {
            break;
        }
        M -= 2;
    }
    M = m - 1;
    s = 2 + m;
    if (M > 0) {
        loop {
            ans.push((s, s + M));
            s += 1;
            if M <= 2 {
                break;
            }
            M -= 2;
        }
    }
    for (a, b) in ans {
        println!("{} {}", a, b);
    }
}


Measured memory_bytes: 3248
w, h, n = map(int, input().split())
area = []
for i in range(h):
    temp = [0] * w
    area.append(temp)
for i in range(n):
    x, y, a = map(int, input().split())
    if a == 1:
        for j in range(x):
            for k in range(h):
                area[k][j] = 1
    elif a == 2:
        for j in range(x, w):
            for k in range(h):
                area[k][j] = 1
    elif a == 3:
        for j in range(w):
            for k in range(y):
                area[k][j] = 1
    else:
        for j in range(w):
            for k in range(y, h):
                area[k][j] = 1
count = 0
for i in range(w):
    for j in range(h):
        if area[j][i] == 0:
            count += 1
print(count)

Measured memory_bytes: 3064
def solve(k, x, y):
    if k % 2 == 0 and (x + y) % 2 == 1:
        print(-1)
        return

    ans = []
    abx, aby = abs(x), abs(y)
    mh = abx + aby
    xx, yy = 0, 0

    if mh % k == 0:
        d = (mh - 1) // k + 1
        for _ in range(d - 1):
            dx, dy = abs(abx - xx), abs(aby - yy)
            if dx > 0:
                if dx >= k:
                    xx += k
                else:
                    xx += dx
                    yy += k - dx
            else:
                yy += k
            ans.append((xx, yy))
        ans.append((abx, aby))
        print_ans(ans, x, y)
        return

    d = (mh - 1) // k + 1

    if k % 2 == 1 and mh % 2 != max(2, d) % 2:
        if abx > aby:
            xx += min(k, abx)
            yy += k - min(k, abx)
        else:
            yy += min(k, aby)
            xx += k - min(k, aby)
        ans.append((xx, yy))

    for _ in range(d - 2):
        dx, dy = abs(abx - xx), abs(aby - yy)
        if dx > dy:
            if abx > xx:
                xx += k
            else:
                xx -= k
        else:
            if aby > yy:
                yy += k
            else:
                yy -= k
        ans.append((xx, yy))

    dx, dy = abs(abx - xx), abs(aby - yy)
    mhh = (dx + dy) // 2
    if dx > dy:
        if abx > xx:
            xx += mhh
        else:
            xx -= mhh
        if aby > yy:
            yy -= k - mhh
        else:
            yy += k - mhh
    else:
        if aby > yy:
            yy += mhh
        else:
            yy -= mhh
        if abx > xx:
            xx -= k - mhh
        else:
            xx += k - mhh
    ans.append((xx, yy))
    ans.append((abx, aby))

    print_ans(ans, x, y)


def print_ans(ans, x, y):
    print(len(ans))
    for dx, dy in ans:
        if x < 0:
            dx = -dx
        if y < 0:
            dy = -dy
        print(dx, dy)


k = int(input())
x, y = list(map(int, input().split()))
solve(k, x, y)


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

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

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

  int c[] = { 300000, 200000, 100000, 0 };
  cout << c[min(x, 3)] + c[min(y, 3)] + (!x && !y ? 400000 : 0) << endl;

  return (0);
}


Measured memory_bytes: 3648
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <algorithm>
#include <cfloat>
#include <complex>
#include <functional>
#include <iostream>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <vector>

using namespace std;

typedef long long ll;
typedef unsigned long long ull;
typedef pair<ll, ll> P;

int main() {
  ll N;

  cin >> N;

  vector<vector<ll> > F(N, vector<ll>(10, 0));
  vector<vector<ll> > P(N, vector<ll>(11, 0));

  for (ll i = 0; i < N; i++) {
    for (ll j = 0; j < 10; j++) {
      cin >> F[i][j];
    }
  }

  for (ll i = 0; i < N; i++) {
    for (ll j = 0; j < 11; j++) {
      cin >> P[i][j];
    }
  }

  ll ans = LONG_LONG_MIN;
  for (ll j = 1; j <= 1023; j++) {
    ll ans_j = 0;
    for (ll i = 0; i < N; i++) {
      ll cnt_i = 0;
      for (ll k = 0; k < 10; k++) {
        ll j_kth = (j >> k) & 1LL;
        if (F[i][k] == 1 && j_kth == 1) cnt_i++;
      }  // k
      ans_j += P[i][cnt_i];
    }  // i
    if (ans < ans_j) ans = ans_j;
  }  // j

  cout << ans << endl;

  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>

int main(void) {
  int a,b;
  scanf("%d",&a);
  b = a%10;
  if (b == 3) {
    printf("bon");
  } else if(b == 0 || b == 1 || b == 6 || b == 8) {
    printf("pon");
  } else {
    printf("hon");
  }
  return 0;
}

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

public class Main {
  public static void main(String[] args) throws IOException {
    BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    int a = Integer.parseInt(in.readLine());
    int b = Integer.parseInt(in.readLine());
    int c = Integer.parseInt(in.readLine());
    int d = Integer.parseInt(in.readLine());
    int train = Math.min(a,b);
    int bus = Math.min(c,d);
    System.out.println(train + bus);
  }
}

Measured memory_bytes: 32624
#include <bits/stdc++.h>
  
using namespace std;
  
#define rep(i,n) REP(i,0,n)
#define REP(i,s,e) for(int i=(s); i<(int)(e); i++)
#define repr(i, n) REPR(i, n, 0)
#define REPR(i, s, e) for(int i=(int)(s-1); i>=(int)(e); i--)
#define pb push_back
#define all(r) r.begin(),r.end()
#define rall(r) r.rbegin(),r.rend()
#define fi first
#define se second
  
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
 
const int INF = 1e9;
const ll MOD = 1e9 + 7;
double EPS = 1e-8;

// #define DEBUG_MODE
#ifdef DEBUG_MODE
#define dump(x) cout << #x << " : " << x << endl
#define LINE cout << "line : " << __LINE__ << endl
#define dumpV(v) cout << #v << " : ["; for(auto& t : v) cout << t << ", "; cout<<"]" << endl
#define STOP assert(false)
#else
#define dump(x) ;
#define LINE     ;
#define dumpV(v);
#define STOP     ;
#endif
#define mp make_pair

namespace std{
  template<class S,class T>
  ostream &operator <<(ostream& out,const pair<S,T>& a){
    out<<'('<<a.fi<<", "<<a.se<<')';
    return out;
  }
}


ll dp[62][2];

int main(){
    ll n, k;
    cin >> n >> k;
    vl a(n);
    rep(i, n) cin >> a[i];
    vl cnt(62);
    rep(i, 62) {
        rep(j, n) if((a[j]&(1LL<<i))) cnt[i]++;
    }
    ll ans = 0LL;
    int maxKBit = 0;
    rep(i, 62) if(k&(1LL<<i)) maxKBit = i;
    REP(i, maxKBit+1, 62) ans += cnt[i]*(1LL<<i);
    dump(mp(maxKBit, ans));
    dumpV(cnt);

    {   
        if(k != 0)
            dp[maxKBit][1] = (n-cnt[maxKBit]) * (1LL<<maxKBit); // maxKBit bit => 1
        dp[maxKBit][0] = (cnt[maxKBit]) * (1LL<<maxKBit);   // maxKBit bit => 0
    }
    repr(i, maxKBit) {
        ll mask = 1LL<<i;
        if(k&mask) {
            dp[i][1] = max(dp[i][1], dp[i+1][1] + (n-cnt[i]) * mask); // i bit => 1
            dp[i][0] = max(dp[i][0], dp[i+1][1] + (cnt[i]) * mask);   // i bit => 0
        }
        else {
            dp[i][1] = max(dp[i][1], dp[i+1][1] + (cnt[i]) * mask); // i bit => 0
        }
        dp[i][0] = max(dp[i][0], dp[i+1][0] + max(cnt[i], n - cnt[i]) * mask);
    }
    cout << ans + max(dp[0][0], dp[0][1]) << endl;
    return 0;
}

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

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  cout << fixed << setprecision(10);
  cerr << fixed << setprecision(10);

  int n;
  double t, a;
  cin >> n >> t >> a;
  int ans = 0;
  double absa = 10000.0;
  for (int i = 0; i < n; ++i) {
    double h;
    cin >> h;
    h = abs(a - (t - (h * 0.006)));
    // cerr << h << '\n';
    if (absa > h) {
      absa = h;
      ans = i + 1;
    }
  }

  cout << ans << '\n';

  return 0;
}


Measured memory_bytes: 3748
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mp make_pair
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define x first
#define y second

#define f(i,a,b) for(ll i=a;i<b;i++)
#define rof(i,a,b) for(ll i=a;i>b;i--)
//cf dont use unordered map. use simply map<... , ... > m;
ll mod=1e9+7;
ll power_mod(ll x,ll n,ll m) // x^n %mod // O(Log Power n)
{ll ans=1;
while(n!=0)
{
    if(n&1==1)
    {
        ans=(ans%m * x%m)%m;
    }
    x=(x%m * x%m)%m;
    n=n>>1;
}
    return ans;
}

ll factorial[200001];
// factorial[0]=1;
//f(i,1,200001) factorial[i]=(i%mod * factorial[i-1]%mod)%mod;

ll ncr_mod(ll n,ll r)
{
ll ans=0;
ll up=n;
for(ll i=n-1;i>=n-r+1;i--)
{
    up=(up%mod * i%mod )%mod;
}

ll down=power_mod(factorial[r],mod-2,mod);
ans=((up%mod)*(down%mod))%mod;

return ans;
}


void solve()
{ll mod=1e9+7;
    ll n,a,b;cin>>n>>a>>b;
    factorial[0]=1;
f(i,1,200001) factorial[i]=(i%mod * factorial[i-1]%mod)%mod;

   ll ans=(power_mod(2,n,mod)%mod-1-ncr_mod(n,a)%mod+mod)%mod;
   ans=(ans%mod-ncr_mod(n,b)%mod+mod)%mod;
   
      cout<<ans;
}


int main()
{

ios_base::sync_with_stdio(false);
    cin.tie(NULL);

    ll t=1;
 //   cin>>t;
    while(t--)
    {
     solve();
    }
}

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

using VS = vector<string>;    using LL = long long;
using VI = vector<int>;       using VVI = vector<VI>;
using PII = pair<int, int>;   using PLL = pair<LL, LL>;
using VL = vector<LL>;        using VVL = vector<VL>;

#define ALL(a)  begin((a)),end((a))
#define RALL(a) (a).rbegin(), (a).rend()
#define SZ(a) int((a).size())
#define SORT(c) sort(ALL((c)))
#define RSORT(c) sort(RALL((c)))
#define UNIQ(c) (c).erase(unique(ALL((c))), end((c)))
#define FOR(i, s, e) for (int(i) = (s); (i) < (e); (i)++)
#define FORR(i, s, e) for (int(i) = (s); (i) > (e); (i)--)
//#pragma GCC optimize ("-O3") 
#ifdef YANG33
#include "mydebug.hpp"
#else
#define DD(x) 
#endif
const int INF = 1e9;                          const LL LINF = 1e16;
const LL MOD = 1000000007;                    const double PI = acos(-1.0);
int DX[8] = { 0, 0, 1, -1, 1, 1, -1, -1 };    int DY[8] = { 1, -1, 0, 0, 1, -1, 1, -1 };

/* -----  2019/03/21  Problem: ABC 059 C / Link: http://abc059.contest.atcoder.jp/tasks/abc059_c  ----- */


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

	LL N;
	cin >> N;
	vector<LL> a(N);
	for (int i = 0; i < N; ++i) {
		cin >> a[i];
	}

	auto f = [&](bool mode) {
		LL ret = 0;
		LL sum = 0;
		FOR(i, 0, N) {
			if (mode) {// to +
				LL diff = sum + a[i];
				if (diff <= 0) {
					ret += abs(diff) + 1;
					diff = 1;
				}
				sum = diff;
			}
			else {
				LL diff = sum + a[i];
				if (diff >= 0) {
					ret += abs(diff) + 1;
					diff = -1;
				}
				sum = diff;
			}
			mode = !mode;
		}

		return ret;
	};
	LL ans = min(f(0), f(1));



	cout << (ans) << "\n";

	return 0;
}


Measured memory_bytes: 1024
#include<stdio.h>
 
int main (void) {
int i,j,k;
int n,x;
int count;
 
while (1) {
scanf("%d %d", &n, &x);
if (n+x == 0) break;
 
count = 0;
for (i = 1; i <= n-2; i++)
for (j = i+1; j <= n-1; j++)
for (k = j+1; k <= n; k++)
if(i+j+k == x) count++;
 
printf("%d\n", count);
}
 
return (0);
}

Measured memory_bytes: 600
#include <iostream>
#include <algorithm>
#include <math.h>
using namespace std;

long long n, eye, med, ans = 0;
long long mylist[200001];

int main() {
    cin>>n;
    for(int i = 1; i <= n; i++)
    {
        cin>>eye;
        mylist[i] = eye - i;
    }
    sort(mylist+1, mylist+n+1);
    med = mylist[(n+1)/2];
    for(int i = 1; i <= n; i++)
        ans += abs(mylist[i] - med);
    cout<<ans;
}

Measured memory_bytes: 1792
#include<bits/stdc++.h>
using namespace std ;
 
int main(){
  string s ; cin >> s ;
  int n = s.size() ;
  int num ;
  int cnt = 0 ;
  if(n%2==0)
    num = n/2 ;
  else
    num = n/2+1 ;
  for(int i=0;i<num;i++){
    if(s.at(i)!=s.at(n-1-i))
      cnt++ ;
  }
  cout << cnt << endl ;
}

Measured memory_bytes: 256
/*
 * main.c
 *
 *  Created on: 2019/03/24
 *      Author: family
 */

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

int checkATGC(char c)
{
    int ret = 0;
    switch(c) {
    case 'A':
    case 'T':
    case 'G':
    case 'C':
        ret = 1;
        break;
    default:
        ret = 0;
        break;
    }
    return ret;
}

int main()
{
    char S[10];
    int i = 0, j = 0;;
    int len = 0;
    int result = 0;
    int ans = 0;
    int max_ans = 0;
    scanf("%s",S);
    len = strlen(S);

    for(i = 0; i < len; i++) {
        ans = 0;
        j = i;
        while(j < len) {
            result = checkATGC(S[j]);
            if(result == 1) {
                ans++;
            } else {
                break;
            }
            j++;
        }
        if(max_ans < ans) {
            max_ans = ans;
        }
    }
    printf("%d\n",max_ans);
    return 0;
}


Measured memory_bytes: 128
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cfloat>
#include <climits>
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <ctime>
#include <fstream>
#include <functional>
#include <iomanip>
#include <iostream>
#include <list>
#include <map>
#include <memory>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>

// c++11
#include <array>
#include <tuple>
#include <unordered_map>
#include <unordered_set>

#define mp make_pair
#define mt make_tuple
#define rep(i, n) for (int i = 0; i < (n); i++)

using namespace std;

using ll = long long;
using ull = unsigned long long;
using pii = pair<int, int>;

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

const int dx[] = {1, 0, -1, 0}, dy[] = {0, -1, 0, 1};
int H, W, D, Q;
const int MAX_HW = 301;
pii indices[MAX_HW * MAX_HW];
bool visited[MAX_HW * MAX_HW];
ll sum[MAX_HW * MAX_HW];
void dfs(int pos, ll cost)
{
    if (visited[pos])
    {
        return;
    }
    sum[pos] = cost;
    visited[pos] = true;
    pii p = indices[pos];
    int dst = pos + D;
    if (dst < H * W)
    {
        pii q = indices[dst];
        int tmp = abs(p.first - q.first) + abs(p.second - q.second);
        dfs(dst, cost + tmp);
    }
}
int main()
{
    cin >> H >> W >> D;
    for (int i = 0; i < H; i++)
    {
        for (int j = 0; j < W; j++)
        {
            int a;
            cin >> a;
            a--;
            indices[a] = mp(i, j);
        }
    }
    for (int i = 0; i < H * W; i++)
    {
        if (!visited[i])
        {
            dfs(i, 0);
        }
    }

    cin >> Q;
    for (int i = 0; i < Q; i++)
    {
        int l, r;
        cin >> l >> r;
        l--, r--;
        if (l == r)
        {
            cout << 0 << endl;
            continue;
        }
        ll res = sum[r] - sum[l];
        cout << res << endl;
    }
    return 0;
}


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

int main(){
    using namespace std;
    unsigned long H, W, M;
    cin >> H >> W >> M;
    vector<unsigned long> cH(H), cW(W);
    unordered_set<unsigned long> c;
    for(unsigned long i{0}, h, w; i < M; ++i){
        cin >> h >> w;
        ++cH[--h];
        ++cW[--w];
        c.insert(w + h * W);
    }
    vector<unsigned long> idxH(H), idxW(W);
    iota(begin(idxH), end(idxH), 0UL);
    iota(begin(idxW), end(idxW), 0UL);
    sort(begin(idxH), end(idxH), [&cH](auto i, auto j){return cH[i] > cH[j];});
    sort(begin(idxW), end(idxW), [&cW](auto i, auto j){return cW[i] > cW[j];});
    unsigned long ans{0};
    for(const auto& i : idxH){
        if(cH[i] + cW[idxW[0]] <= ans)break;
        for(const auto& j : idxW){
            if(cH[i] + cW[j] <= ans)break;
            ans = cH[i] + cW[j] - c.count(j + i * W);
        }
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 25976
#include <stdio.h>

int main(void){

  int dice[6];
  int q;
  int qu[2];
  int an[24] = { 0 };
  int diceo[5] = {1, 2, 4, 3, 1};
  int dicet[5] = {5, 2, 0, 3, 5};
  int diceth[5] = {1, 5, 4, 0, 1};
  int dicef[5] = {1, 0, 4, 5, 1};
  int dicefi[5] = {0, 2, 5, 3, 0};
  int dices[5] = {4, 2, 1, 3, 4};
  int i, ii, iii;

  for(i = 0; i < 6; i++){
    scanf("%d", &dice[i]);
  }

  scanf("%d", &q);

  for(i = 0; i < q; i++){
    scanf("%d%d", &qu[0], &qu[1]);
    for(ii = 0; ii < 6; ii++){
      if(qu[0] == dice[ii]){
	for(iii = 0; iii < 4; iii++){
	  if((ii == 0) && (qu[1] == dice[diceo[iii]])) an[i] = dice[diceo[iii+1]];
	  if((ii == 1) && (qu[1] == dice[dicet[iii]])) an[i] = dice[dicet[iii+1]];
	  if((ii == 2) && (qu[1] == dice[diceth[iii]])) an[i] = dice[diceth[iii+1]];
	  if((ii == 3) && (qu[1] == dice[dicef[iii]])) an[i] = dice[dicef[iii+1]];
	  if((ii == 4) && (qu[1] == dice[dicefi[iii]])) an[i] = dice[dicefi[iii+1]];
	  if((ii == 5) && (qu[1] == dice[dices[iii]])) an[i] = dice[dices[iii+1]];
	}
      }
      if (an[i] != 0) break;
    }
  }
  for(i = 0; i < q; i++){
    printf("%d\n", an[i]);
  }
  return 0;
}

Measured memory_bytes: 596
#include<iostream>
#include<string>
#include<vector>
#include<algorithm>
#include<bits/stdc++.h>
#include<cmath>
#include<bitset>
#define ll long long
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define FFOR(i,a,b) for(int i=(a);i<=(b);++i)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n)  FFOR(i,0,n)
#define SORT(V) sort((V).begin(),(V).end())
#define REVERSE(V) reverse((V).begin(),(V).end())
#define INF ((1LL<<62)-(1LL<<31))
#define MOD 1000000007
using namespace std;

int main(){
  ll N;
  cin>>N;
  
  cout<<N*(N-1)/2<<endl;
}

Measured memory_bytes: 256
use proconio::input;

fn main() {
    input!{
        n: String,
    }

    let nv = n.as_bytes().to_vec();

    let mut s = 0;
    for c in nv.iter() {
        let i = c - b'0';
        s += i;
        s %= 9;
    }
    println!("{}", if s == 0 { "Yes" } else { "No"} );
}


Measured memory_bytes: 2688
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using static System.Console;
using static System.Math;

namespace Atcoder
{
    class Program
    {
        static StreamWriter sw = new StreamWriter(OpenStandardOutput()) { AutoFlush = false };
        static void Main(string[] args)
        {
            try
            {
                SetOut(sw);
                Solve.Answer();
                Out.Flush();
            }
            catch (Exception ex)
            {
                WriteLine(ex.ToString());
            }
        }
    }

    public class Solve
    {
        public static void Answer()
        {
            var N = IO.RInt;
            var dic = new Dictionary<char, int>();
            for (int i = 0; i < 26; i++)
            {
                dic[(char)('a' + i)] = 10000;
            }
            for (int i = 0; i < N; i++)
            {
                var s = ReadLine();
                var i_dic = new Dictionary<char, int>();
                for (int j = 0; j < s.Length; j++)
                {
                    if (!i_dic.ContainsKey(s[j]))
                        i_dic[s[j]] = 1;
                    else
                        i_dic[s[j]]++;
                }
                for (int j = 0; j < 26; j++)
                {
                    if (!i_dic.ContainsKey((char)('a' + j)))
                        dic[(char)('a' + j)] = 0;
                    else
                        dic[(char)('a' + j)] = Min(dic[(char)('a' + j)], i_dic[(char)('a' + j)]);
                }

            }
            string ans = "";
            foreach (var item in dic)
            {
                ans += new string(Enumerable.Repeat(item.Key, item.Value).ToArray());
            }
            WriteLine(ans);
        }


    }

    public class IO
    {
        #region Input
        public static int RInt => int.Parse(ReadLine());
        public static long RLong => long.Parse(ReadLine());
        public static double RDouble => double.Parse(ReadLine());

        public static string[] RSString => ReadLine().Split();
        public static int[] RSInt => ReadLine().Split().Select(s => int.Parse(s)).ToArray();
        public static long[] RSLong => ReadLine().Split().Select(s => long.Parse(s)).ToArray();
        public static double[] RSDouble => ReadLine().Split().Select(s => double.Parse(s)).ToArray();
        #endregion

        #region Output
        public static void OutJoinSpace<T>(IEnumerable<T> list) => WriteLine(string.Join(" ", list));
        public static void WriteLineYes_or_No(bool flag) => WriteLine(flag ? "Yes" : "No");
        public static void WriteLineYES_or_NO(bool flag) => WriteLine(flag ? "YES" : "NO");
        #endregion
    }

    public class Mod
    {
        #region
        private readonly static long M = 1000000007;

        public static long Add(long a, long b) => (a * b) % M;
        public static long Sub(long a, long b) => (a - b) % M >= 0 ? (a - b) % M : (a - b) % M + M;
        public static long Multi(long a, long b) => (a * b) % M;
        #endregion
    }
}

Measured memory_bytes: 19120
use std::collections::HashMap;
struct global {
    memo: std::collections::HashMap<u64, u64>,
}

impl global {
    fn solve(&mut self, n: u64, a: u64, b: u64, c: u64, d: u64) -> u64 {
        if let Some(&v) = self.memo.get(&n) {
            return v;
        }

        if n <= 1 {
            return d * n;
        }

        let &ans = [
            n.saturating_mul(d),
            self.solve(n / 2, a, b, c, d) + n % 2 * d + a,
            self.solve((n + 1) / 2, a, b, c, d) + (2 - n % 2) % 2 * d + a,
            self.solve(n / 3, a, b, c, d) + n % 3 * d + b,
            self.solve((n + 2) / 3, a, b, c, d) + (3 - n % 3) % 3 * d + b,
            self.solve(n / 5, a, b, c, d) + n % 5 * d + c,
            self.solve((n + 4) / 5, a, b, c, d) + (5 - n % 5) % 5 * d + c,
        ]
        .iter()
        .min()
        .unwrap();
        self.memo.insert(n, ans);
        return ans;
    }
}

fn main() {
    input! {
        t: usize,
        case: [(u64, u64, u64, u64, u64);t]
    }

    for (n, a, b, c, d) in case {
        println!(
            "{}",
            global {
                memo: HashMap::new()
            }
            .solve(n, a, b, c, d)
        );
    }
}

#[macro_export(local_inner_maccros)]
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
    ($($r:tt)*) => {
        let mut s = {
            use std::io::Read;
            let mut s = String::new();
            std::io::stdin().read_to_string(&mut s).unwrap();
            s
        };
        let mut iter = s.split_whitespace();
        input_inner!{iter, $($r)*}
    };
}

#[macro_export(lcal_inner_macros)]
macro_rules! input_inner {
    ($iter:expr) => {};
    ($iter:expr, ) => {};

    ($iter:expr, $var:ident : $t:tt $($r:tt)*) => {
        let mut $var = read_value!($iter, $t);
        input_inner!{$iter $($r)*}
    };
}

#[macro_export(lcal_inner_macros)]
macro_rules! read_value {
    ($iter:expr, ( $($t:tt),* )) => {
        ( $(read_value!($iter, $t)),* )
    };

    ($iter:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()
    };

    ($iter:expr, chars) => {
        read_value!($iter, String).chars().collect::<Vec<char>>()
    };

    ($iter:expr, usize1) => {
        read_value!($iter, usize) - 1
    };

    ($iter:expr, $t:ty) => {
        $iter.next().unwrap().parse::<$t>().expect("Parse error")
    };
}


Measured memory_bytes: 2616
#include<iostream>
#include<algorithm>
#include<string>
#include<vector>
#include<cmath>
#include<map>
#include<iomanip>
#include<queue>
#include<stack>
#include<time.h>
#define rep(i,n)for(int i=0;i<n;i++)
#define int long long
#define ggr getchar();getchar();return 0;
#define prique priority_queue
constexpr auto mod = 1000000007;
#define inf 1e15
#define key 1e9
using namespace std;
typedef pair<int, int>P;
void yes() { cout << "Yay!" << endl; }
void no() { cout << ":(" << endl; }
template<class T> inline void chmax(T& a, T b) {
	a = std::max(a, b);
}
template<class T> inline void chmin(T& a, T b) {
	a = std::min(a, b);
}

//combination(Nが小さい時はこれを使う)
const int MAX = 300000;
int fac[MAX], finv[MAX], inv[MAX];
void COMinit() {
	fac[0] = fac[1] = 1;
	finv[0] = finv[1] = 1;
	inv[1] = 1;
	for (int i = 2; i < MAX; i++) {
		fac[i] = fac[i - 1] * i % mod;
		inv[i] = mod - inv[mod % i] * (mod / i) % mod;
		finv[i] = finv[i - 1] * inv[i] % mod;
	}
}
int COMB(int n, int k) {
	if (n < k) return 0;
	if (n < 0 || k < 0) return 0;
	return fac[n] * (finv[k] * finv[n - k] % mod) % mod;
}

bool prime(int n) {
	int cnt = 0;
	for (int i = 1; i <= sqrt(n); i++) {
		if (n % i == 0)cnt++;
	}
	if (cnt != 1)return false;
	else return n != 1;
}
int gcd(int x, int y) {
	if (y == 0)return x;
	return gcd(y, x % y);
}
int lcm(int x, int y) {
	return x / gcd(x, y) * y;
}

//繰り返し二乗法（Nが大きい時の場合のcombination)
int mod_pow(int x, int y, int m) {
	int res = 1;
	while (y) {
		if (y & 1) {
			res = res * x % m;
		}
		x = x * x % m;
		y >>= 1;
	}
	return res;
}
int kai(int x, int y) {
	int res = 1;
	for (int i = x - y + 1; i <= x; i++) {
		res *= (i % mod); res %= mod;
	}
	return res;
}
int comb(int x, int y) {
	if (y > x)return 0;
	return kai(x, y) * mod_pow(kai(y, y), mod - 2, mod) % mod;
}
//UnionFind
class UnionFind {
protected:
	int* par, * rank, * size;
public:
	UnionFind(unsigned int size) {
		par = new int[size];
		rank = new int[size];
		this->size = new int[size];
		rep(i, size) {
			par[i] = i;
			rank[i] = 0;
			this->size[i] = 1;
		}
	}
	int find(int n) {
		if (par[n] == n)return n;
		return par[n] = find(par[n]);
	}
	void unite(int n, int m) {
		n = find(n);
		m = find(m);
		if (n == m)return;
		if (rank[n] < rank[m]) {
			par[n] = m;
			size[m] += size[n];
		}
		else {
			par[m] = n;
			size[n] += size[m];
			if (rank[n] == rank[m])rank[n]++;
		}
	}
	bool same(int n, int m) {
		return find(n) == find(m);
	}
	int getsize(int n) {
		return size[find(n)];
	}
};
int dight_sum(int n) {
	int sum = 0;
	rep(i, 20)sum += (n % (int)pow(10, i + 1)) / (pow(10, i));
	return sum;
}
signed main() {
	int n;
	cin >> n;
	for (int i = 1; i <= 3500; i++) {
		for (int j = 1; j <= 3500; j++) {
			int p = lcm(lcm(i, j), n);
			int q = 4 * p / n;
			int r = p / i + p / j;
			if (q != r && p % (q - r) == 0 && 1 <= p / (q - r)) {
				cout << i << " " << j << " " << p / (q - r) << endl;
				ggr
			}
		}
	}
	ggr
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <string>
#include <cmath>
using namespace std;
int main() {
    int n , m,ans=0;
    cin >> n >> m;
    int a[m];
    for (int i = 0; i < m; i++)
    {
        cin>>a[i];
        ans+=a[i];
    }
    if(n<ans){
        ans = -1;
    }else{
        ans = n-ans;
    }
    cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3512
#include <bits/stdc++.h>
using namespace std;
typedef long long int ll;
#define rep( i, n, m ) for(int i = ( n ); i < ( m ); i++)
#define rep_d( i, n, m ) for(int i = ( n ) - 1; i >= ( m ); i--)
#define sort_asc( X ) sort(( X ).begin(), ( X ).end())
#define sort_desc( X ) sort(( X ).begin(), ( X ).end(), greater <>())

template <class T> bool chmax( T& a, T b );
template <class T> bool chmin( T& a, T b );
int* eratosthenes( int N );
bool bit_search( int pattern, int N );
template <class T> void cumulative_sum( T array, size_t N );

const ll INF = 1LL << 60;
const int k_mod = 1e9 + 7;

typedef struct {
	vector <int> to;
	int cost;
} edge;
typedef struct {
	bool a;
	bool b;
} P;
int main( void ){
	int N; cin >> N;
	vector <int> vec( N );
	bool is_not_multi5 = false;
	rep( i, 0, N ){
		cin >> vec[ i ];
		if (vec[ i ] % 10 != 0)
			is_not_multi5 = true;
	}
	if (!is_not_multi5){
		cout << "0\n" << endl;
		return 0;
	}
	int sum = accumulate( vec.begin(), vec.end(), 0 );
	if (sum % 10 != 0){
		cout << sum << endl;
		return 0;
	}
	sort_asc( vec );
	for(auto v:vec){
		if(( sum - v ) % 10 != 0){
			cout << sum - v << endl;
			return 0;
		}
	}
}

int* eratosthenes( int N ){
	int* prime_array = new int[ N + 1 ];
	int lim = N;
	prime_array[ 0 ] = 0;
	prime_array[ 1 ] = 0;
	rep( i, 2, N + 1 ){
		prime_array[ i ] = 1;
	}
	rep( i, 2, lim ){
		if (prime_array[ i ] == 0)
			continue;
		lim = N / i;
		for(int j = i * 2; j < N + 1; j += i){
			prime_array[ j ] = 0;
		}
	}
	return prime_array;
}
template <class T> void cumulative_sum( T array, size_t N ) {
	rep( i, 1, N + 1 ){
		array[ i ] += array[ i - 1 ];
	}
}
template <class T> bool chmax( T& a, T b ) {
	if (a < b){
		a = b; return true;
	}
	return false;
}
template <class T> bool chmin( T& a, T b ) {
	if (a > b){
		a = b; return true;
	}
	return false;
}
bool bit_search( int pattern, int N ){
	int cnt = 0;
	rep( bit, 0, N ){
		if (pattern & ( 1 << bit )){
			cnt++;
		}
	}
	return true;
}


Measured memory_bytes: 256
#include <iostream>
#include <sstream>
#include <cstdio>
#include <cstdlib>
#include <cmath>
#include <ctime>
#include <cstring>
#include <string>
#include <vector>
#include <stack>
#include <queue>
#include <deque>
#include <map>
#include <set>
#include <bitset>
#include <numeric>
#include <utility>
#include <iomanip>
#include <algorithm>
#include <functional>
using namespace std;

#define COUT(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << endl
#define EACH(i, s) for (__typeof__((s).begin()) i = (s).begin(); i != (s).end(); ++i)

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<class T1, class T2> ostream& operator << (ostream &s, pair<T1,T2> P)
{ return s << '<' << P.first << ", " << P.second << '>'; }
template<class T> ostream& operator << (ostream &s, vector<T> P)
{ for (int i = 0; i < P.size(); ++i) { if (i > 0) { s << " "; } s << P[i]; } return s; }
template<class T> ostream& operator << (ostream &s, vector<vector<T> > P)
{ for (int i = 0; i < P.size(); ++i) { s << endl << P[i]; } return s << endl; }
template<class T1, class T2> ostream& operator << (ostream &s, map<T1,T2> P)
{ EACH(it, P) { s << "<" << it->first << "->" << it->second << "> "; } return s << endl; }


string str;

long long solve() {
    long long res = 0;
    int n = str.size();
    for (int bit = 0; bit < 1<<(n-1); ++bit) {
        long long tmp = 0;
        string sub = "";
        sub += str[0];
        for (int i = 0; i < n-1; ++i) {
            if (bit & (1<<i)) {
                long long add;
                istringstream iss(sub);
                iss >> add;
                tmp += add;
                sub = "";
                sub += str[i+1];
            }
            else {
                sub += str[i+1];
            }
        }
        if (sub != "") {
            istringstream iss(sub);
            long long add;
            iss >> add;
            tmp += add;
        }
        //cout << bitset<10>(bit) << ": " << tmp << endl;
        res += tmp;
    }
    return res;
}

int main() {
    while (cin >> str) {
        cout << solve() << endl;
    }
}




Measured memory_bytes: 256
#include <bits/stdc++.h>
#define fi first
#define se second
#define pb push_back

using namespace std;
typedef long long ll;

const int MAXN = 1000*1000 + 7;
const int SS = 1<<20;
const int MOD = 1000*1000*1000 + 7;

int tab[MAXN];
int n;

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

	int T;
	//cin >> T;
	T = 1;
	while(T--)
	{
		string s;
		cin >> s;
		if(s.back() == 's')
			cout << s << "es\n";
		else
			cout << s << "s\n";
	}
	return 0;
}


Measured memory_bytes: 3660
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	static final PrintStream out = System.out;
	static final Scanner sc = new Scanner(System.in);
	static final long Mod = 1000_000_007L;
	int N,H;

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

	void solve() {
		H = nextInt();
		N = nextInt();
		int[] A = nextIntArray(N);

		long sum = 0;
		for(int a : A) {
			sum += a;
		}

		String res = "No";
		if(sum >= H)res = "Yes";

		out.println(res);
	}

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

	public int[] nextIntArray(int n) {
		int[] a = new int[n];
		for (int i = 0; i < n; i++)a[i] = nextInt();
		return a;
	}
	public long[] nextLongArray(int n) {
		long[] a = new long[n];
		for (int i = 0; i < n; i++)a[i] = nextLong();
		return a;
	}
	public int nextInt() {
		return Integer.parseInt(next());
	}
	public long nextLong() {
		return Long.parseLong(next());
	}
	public String next() {
		return sc.next();
	}

	long gcd(long m,long n) {
		if (m<n) return gcd(n,m);
		if (n==0)return m;
		return gcd(n,m%n);
	}

	long lcm(long m, long n) {
	        return m * n / gcd(m, n);
	}

	private final int[] sizeTable = {
	        9, 99, 999, 9999, 99999, 999999, 9999999, 99999999, 999999999, Integer.MAX_VALUE
	};

	public int stringSize(int x) {
	    for (int i = 0;; i++)
	        if (x <= sizeTable[i])
	            return i + 1;
	}
}

Measured memory_bytes: 47352
#include <bits/stdc++.h>
using namespace std;
int main(){
    int n,k;
    cin >> n >> k;
    vector<int> sunuke(n, 0);
    for(int i=0;i<k;i++){
        int d;
        cin >> d;
        for(int j =0; j< d; j++){
            int a;
            cin >> a ;
            sunuke[--a]++;
        }
    }
    int ans = 0;
    for(auto e: sunuke){
        if(e == 0) ans ++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 3528
s=input()
n=len(s)
ans=0
for bit in range(2**(n-1)):
  t=0
  t_str=s[0]
  for j in range(n-1):
    if (bit&(1<<j)):
      t+=int(t_str)
      t_str=s[j+1]
    else:
      t_str+=s[j+1]
  t+=int(t_str)
  ans+=t
print(ans)

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

struct s{
  double tmp;
  int h;
  int num;
};

int main()
{
  s point[1000];
  int N, T, A, target;
  double min = 1000.0;

  cin >> N;
  cin >> T >> A;
  for(int i = 0; i < N; i++){
    cin >> point[i].h;
    point[i].num = i + 1;
    point[i].tmp = T - point[i].h * 0.006;
    if(min > abs(point[i].tmp - A)){
      min = abs(point[i].tmp - A);
      target = i;
    }
  }
  cout << point[target].num << endl;
}


Measured memory_bytes: 256
#include<cstdio>
#include<algorithm>

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

using namespace std;

const int INF=1<<29;
const double EPS=1e-9;

struct Choco{
	int nut;
	double S;
};

int n,m,w,h,thre;
Choco ch[30000];

int solve(){
	static Choco acc[30001];
	acc[0]=(Choco){0,0};
	rep(i,m) acc[i+1]=(Choco){acc[i].nut+ch[i].nut,acc[i].S+ch[i].S};

	int ans=INF;
	rep(i,m){
		int lo=i,hi=m;
		while(lo<hi){
			int mi=(lo+hi+1)/2;
			if(acc[mi].S-acc[i].S<w*h-thre+EPS) lo=mi; else hi=mi-1;
		}
		ans=min(ans,n-(acc[lo].nut-acc[i].nut));
	}
	return ans;
}

int main(){
	for(;scanf("%d%d%d%d%d",&n,&m,&w,&h,&thre),n;){
		static int l[30001],r[30001];
		l[0]=r[0]=0;
		rep(i,m) scanf("%d%d",l+i+1,r+i+1);

		rep(i,m){
			ch[i].S=((l[i+1]-l[i])+(r[i+1]-r[i]))/2.0*w;
			ch[i].nut=0;
		}
		rep(i,n){
			double cx,cy; scanf("%lf%lf",&cx,&cy);

			int lo=0,hi=m+1;
			while(lo<hi){
				int mi=(lo+hi+1)/2;
				if((w-cx)*l[mi]+cx*r[mi]<w*cy) lo=mi; else hi=mi-1;
			}
			ch[lo].nut++;
		}

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

	return 0;
}

Measured memory_bytes: 1740
#include <iostream>
#include <cmath>
#include <string>
#include <vector>
#include <queue>
#include <stack>
#include <algorithm>
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vll;
const ll mod=1e9+7;

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

	cout << pow(N,3) << endl;
	
	return 0;
}

Measured memory_bytes: 256
while True:
	h, w = map(int, input().split())
	if h == 0 and w == 0:
		break
	for i in range(h):
		for j in range(w):
			if (i + j) % 2 == 0:
				print('#', end = '')
			else:
				print('.', end = '')
		print()
	print()


Measured memory_bytes: 7004
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define ll long long
using namespace std;
//typedef vector<unsigned int>vec;
//typedef vector<ll>vec;
//typedef vector<vec> mat;
typedef pair<int, int> P;
typedef pair<ll,ll> LP;
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 INF = 1000000000;
const ll LINF = 1000000000000000000;//1e18
const ll  MOD = 1000000007;
const double PI = acos(-1.0);
const double EPS = 1e-10;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }
//template<class T> inline void add(T &a, T b){a = ((a+b) % MOD + MOD) % MOD;};


vector<ll> divisor(ll n){
    vector<ll> res;
    for(ll i=1; i*i <= n; i++){
        if(n % i == 0){
            res.push_back(i);
            if(i != n / i) res.push_back(n / i);
        }
    }
    return res;
}

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N;
    cin >> N;
    int ans = 0;
    auto res = divisor(N);
    auto res2 = divisor(N-1);
    REP(i,res.size()){
        if(res[i] == 1) continue;
        ll tmp = N;
        while(tmp > 1){
            if(tmp % res[i] == 0) tmp /= res[i];
            else{
                tmp %= res[i];
                if(tmp < res[i]) break;
            }
        }
        if(tmp == 1) ans++;
    }
    REP(i,res2.size()){
        if(res2[i] == 1) continue;
        ll tmp = N;
        while(tmp > 1){
            if(tmp % res2[i] == 0) tmp /= res2[i];
            else{
                tmp %= res2[i];
                if(tmp < res2[i]) break;
            }
        }
        if(tmp == 1) ans++;
    }
    cout << ans << endl;
}

Measured memory_bytes: 384