akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;

#define INF_LL (int64)1e18
#define INF (int32)1e9
#define REP(i, n) for(int64 i = 0;i < (n);i++)
#define FOR(i, a, b) for(int64 i = (a);i < (b);i++)
#define all(x) x.begin(),x.end()
#define fs first
#define sc second

using int32 = int_fast32_t;
using uint32 = uint_fast32_t;
using int64 = int_fast64_t;
using uint64 = uint_fast64_t;
using PII = pair<int32, int32>;
using PLL = pair<int64, int64>;

const double eps = 1e-10;

template<typename A, typename B>inline void chmin(A &a, B b){if(a > b) a = b;}
template<typename A, typename B>inline void chmax(A &a, B b){if(a < b) a = b;}

template<typename T>
vector<T> make_v(size_t a){return vector<T>(a);}

template<typename T,typename... Ts>
auto make_v(size_t a,Ts... ts){
	return vector<decltype(make_v<T>(ts...))>(a,make_v<T>(ts...));
}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value!=0>::type
fill_v(U &u,const V... v){u=U(v...);}

template<typename T,typename U,typename... V>
typename enable_if<is_same<T, U>::value==0>::type
fill_v(U &u,const V... v){
	for(auto &e:u) fill_v<T>(e,v...);
}

int64 ptoi(int64 y, int64 x) {
  return y * 101 + x;
}

PLL itop(int64 p) {
  return PLL(p / 101, p % 101);
}

int64 dy[4] = {1, 0};
int64 dx[4] = {0, 1};
vector<string> mark({"v^", "><"});

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

  int64 N, M;
  cin >> N >> M;

  mf_graph<int64> graph(20000+2);
  int64 S = 20000, G = 20001;

  vector<string> s(N);
  REP(i, N) cin >> s[i];
  struct domino {
    int64 y1, x1, dir, id;
    domino(int64 a, int64 b, int64 d, int64 e):
      y1(a), x1(b), dir(d), id(e) {}
  };
  vector<domino> v;

  REP(i, N) {
    REP(j, M) {
      if ((i + j) % 2 == 0) graph.add_edge(S, ptoi(i, j), 1);
      else graph.add_edge(ptoi(i, j), G, 1);
      if (s[i][j] == '#') continue;
      REP(k, 2) {
        int64 yy = i + dy[k], xx = j + dx[k];
        if (yy < N && xx < M && s[yy][xx] != '#') {
          if ((i + j) % 2 == 0)
            v.emplace_back(i, j, k, graph.add_edge(ptoi(i, j), ptoi(yy, xx), 1));
          else
            v.emplace_back(i, j, k, graph.add_edge(ptoi(yy, xx), ptoi(i, j), 1));
        }
      }
    }
  }
  int res = graph.flow(S, G);

  for (auto &[y1, x1, k, id]: v) {
    if (graph.get_edge(id).flow == 1) {
      s[y1][x1] = mark[k][0];
      s[y1+dy[k]][x1+dx[k]] = mark[k][1];
    }
  }
  cout << res << endl;
  REP(i, N) {
    cout << s[i] << endl;
  }
}


Measured memory_bytes: 6376
import java.io.*;
import java.util.*;
 
/**
 * Built using CHelper plug-in
 * Actual solution is at the top
 */
public class Main {
    public static void main(String[] args) {
        InputStream inputStream = System.in;
        OutputStream outputStream = System.out;
        InputReader in = new InputReader(inputStream);
        PrintWriter out = new PrintWriter(outputStream);
        TaskD solver = new TaskD();
        solver.solve(1, in, out);
        out.close();
    }
 
    static class TaskD {
        public void solve(int testNumber, InputReader in, PrintWriter out) {
 
            int N = in.nextInt();
            for (int i = 0; i < N; i++) {
                long A = in.nextLong();
                long B = in.nextLong();
 
                long a = Math.min(A, B);
                long b = Math.max(A, B);
 
                long ans = 2L * (a - 1) + przedzial(a, b);
 
                out.println(ans);
            }
        }
 
        private long przedzial(long a, long b) {
            if (a == b || a + 1 == b) {
                return 0;
            }
 
            return 1L + szukaj(a + 1, b - 2, a * b);
        }
 
        private long szukaj(long a, long b, long LIMIT) {
            if (a > b) return 0;
            if (a == b) {
                return a * b < LIMIT ? 1 : 0;
            }
            long lo = a, hi = b;
            while (lo + 1 < hi) {
                long m = lo + (hi - lo) / 2;
                if (m * m >= LIMIT) {
                    hi = m;
                } else {
                    lo = m;
                }
            }
            long ans1 = 1 + 2L * (lo - 1 - a + 1);
            long ans2 = 0;
            if (lo * (lo + 1) < LIMIT) {
                ans2 = 2L * (lo - a + 1);
            }
            return Math.max(ans1, ans2);
        }
    }
    static class InputReader {
        public BufferedReader reader;
        public StringTokenizer tokenizer;
        public InputReader(InputStream stream) {
            reader = new BufferedReader(new InputStreamReader(stream), 32768);
            tokenizer = null;
        }
        public String next() {
            while (tokenizer == null || !tokenizer.hasMoreTokens()) {
                try {
                    tokenizer = new StringTokenizer(reader.readLine());
                } catch (IOException e) {
                    throw new RuntimeException(e);
                }
            }
            return tokenizer.nextToken();
        }
        public long nextLong() {
            return Long.parseLong(next());
        }
        public int nextInt() {
            return Integer.parseInt(next());
        }
    }
}

Measured memory_bytes: 21460
import java.util.*;

public class Main{
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        long A = sc.nextLong();
        long B = sc.nextLong();
        Mynum a = new Mynum(A-1);
        Mynum b = new Mynum(B);
        long r = Mynum.calc(a, b);
        System.out.println(r);
   }

   static class Mynum {
        final static int keta = 50;
        long[] val = new long[keta];
        Mynum(long init_param) {
            init_param++;
            for(int i=0; i<keta; i++) {
                long pivot = 2L << i;
                long divisor = pivot / 2;
                val[i] = (init_param / pivot) * divisor + Math.max(0, (init_param % pivot) - divisor);
//                System.out.println(String.format("%d:%d", i, val[i]));
            }

        }

        static long calc(Mynum A, Mynum B) {
            long r = 0L;
            for(int i=0; i<keta; i++) {
                long f = (B.val[i] - A.val[i]) % 2L;
                r+=f * ((2L << i) / 2L);
            }
            return r;
        }
   }
}

Measured memory_bytes: 23636
# T(ターン)で区切る
s = input().split("T")
x, y = ([int(i) for i in input().split()])

# x方向の移動量とy方向の移動量をまとめる
movex = []
movey = []

for i, t in enumerate(s):
    if i % 2 == 0:
        movex.append(len(t))
    else:
        movey.append(len(t))

# 最終目標地へ到達可能か調べる


def t_dfs(move, target, is_x):
    if is_x:
        target -= move.pop(0)

    move.sort(reverse=True)

    for dx in move:
        if target > 0:
            target -= dx
        else:
            target += dx

    return target == 0


if t_dfs(movex, x, True) and t_dfs(movey, y, False):
    print("Yes")
else:
    print("No")


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

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

    for(int i = 0; i < N; ++i){
        if (A[i] % 2 == 0){
            if ( (A[i] % 3 != 0) && (A[i] % 5 != 0) ){
                cout << "DENIED" << endl;
                return 0;
            }
        }
    }

    cout << "APPROVED" << endl;

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>

#pragma GCC target ("avx2")
#pragma GCC optimization ("O3")
#pragma GCC optimization ("unroll-loops")
#pragma comment(linker, "/stack:200000000")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")

using namespace std;
using namespace __gnu_pbds;

typedef long long ll;
typedef string str;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector <pii> vpii;
typedef vector <pll> vpll;
typedef map <str,int> mapsi;
typedef map <str,int> :: iterator mapsitr;
typedef map <int , int> mint;
typedef map <ll , ll> mll;
typedef set <int> si;
typedef set <ll> sll;
typedef si :: iterator sitr;
typedef si :: reverse_iterator rsitr;
typedef sll :: iterator sltr;
typedef sll :: reverse_iterator rsltr;
#define mset multiset

typedef mset <int> msi;
typedef mset <ll> msll;
typedef msi :: iterator msitr;
typedef msi :: reverse_iterator msritr;
typedef msll :: iterator msltr;
typedef msll :: reverse_iterator mslritr;

#define ordered_set tree<int, null_type,less<int>, rb_tree_tag,tree_order_statistics_node_update>
#define mp make_pair
#define pb push_back
#define pob pop_back
#define pf push_front
#define pof pop_front
#define fi first
#define se second
#define fs first.second
#define ss second.second
#define ff first.first
#define sf second.first
#define newl '\n'
#define fbo find_by_order
#define ook order_of_key

char to_upper (char x){
    if( 97 <= int(x) && int(x) <= 122)return char(x-32);
    else if( 65 <= int(x) && int(x) <= 90)return x;
}
char to_lower (char x){
    if( 97 <= int(x) && int(x) <= 122)return x;
    else if( 65 <= int(x) && int(x) <= 90)return char(x+32);
}
int numerize (char x){
    if(48 <= int(x) && int(x) <= 57)return int(x-'0');
    else if( 97 <= int(x) && int(x) <= 122)return int(x-96);
    else if( 65 <= int(x) && int(x) <= 90)return int(x-64);
}
bool isect (int l1, int r1, int l2, int r2){
    pii p1,p2;
    p1 = mp(l1,r1); p2 = mp(l2,r2);
    if(p1>p2)swap(p1,p2);
    if(p2.fi <= p1.se)return true;
    else return false;
}
ll quickpow (ll num1, ll num2, ll MOD){
    if(num2==0)return 1;
    else if(num2==1)return num1;
    else{
        ll temp = quickpow (num1,num2/2,MOD); ll res = ((temp%MOD) * (temp%MOD))%MOD;
        if(num2%2==1) res = ((res%MOD)*(num1%MOD))%MOD; return res;
    }
}
ll invmod (ll num, ll MOD){return quickpow (num,MOD-2,MOD);}
ll gcd (ll num1, ll num2){
    if(num1 < num2) swap(num1,num2); ll num3 = num1 % num2 ;
    while(num3 > 0){ num1 = num2; num2 = num3; num3 = num1 % num2;}
    return num2;
}
ll lcm (ll num1 , ll num2){return (ll) (num1/__gcd(num1,num2))*num2;}
// end of Template
ll x;
int main(){

//    freopen("input.txt", "r", stdin);
//    freopen("output.txt", "w", stdout);

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

    cin>>x;
    ll p = 0;
    ll jump = 1;
    ll ans = 0;
    while(p < x){
        ans = jump;
        p += jump++;
    }
    cout<<ans<<newl;
}


Measured memory_bytes: 256
#include <stdio.h>

int main () {
  int N;
  int R;
  int I;

  scanf("%d",&N);
  scanf("%d",&R);

  if (N < 10) {
    I = R + (100*(10-N));
  }
  else {
    I = R;
  } 
  
  printf("%d",I);
  
  return 0;

}

Measured memory_bytes: 128
#include <bits/stdc++.h>
//---------------------------
using namespace std;
//---------------------------
#define REP(i,n) for(int i = 0; i < (n); i++)
#define P(x) cout << (x) << "\n"

#define MOD 1e9+7
#define PI acos(-1.0)
#define ll long long
#define INF 1000000001

int dx[4]={1,-1,0,0};
int dy[4]={0,0,1,-1};
//---------------------------

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

  // ifstream in("input.txt");
  // cin.rdbuf(in.rdbuf());

  int n;cin>>n;
  int ans=0;
  REP(i,n){
    int l,r;cin>>l>>r;
    ans+=r-l+1;
  }
  P(ans);
  return 0;
}


Measured memory_bytes: 256
A, B = map(int, input().split())
def xorchk(n):
    if n%4 == 0:
        return n
    elif n%4 == 1:
        return 1
    elif n%4 == 2:
        return n+1
    else:
        return 0
print(xorchk(A-1)^xorchk(B))

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

#define MAX 100002

int n;
int s;

deque<pair<long long int, long long int> > v;
vector<long long int> ope;

int main(){
	cin >> n >> s;
	for (int i = 0; i < n; i++){
		long long int x, p;
		scanf("%lld%lld", &x, &p);
		v.push_back(make_pair(x, p));
	}
	while ((!(s <= v[0].first)) &&(!(v.back().first <= s))){
		if (v[0].second >= v.back().second){
			ope.push_back(v.back().first);
			v[0].second += v.back().second;
			v.pop_back();
		}
		else{
			ope.push_back(v[0].first);
			v.back().second += v[0].second;
			v.pop_front();
		}
	}
	if (s <= v[0].first){
		while (v.size()){
			ope.push_back(v.back().first);
			v.pop_back();
		}
	}
	else{
		while (v.size()){
			ope.push_back(v[0].first);
			v.pop_front();
		}
	}
	ope.push_back(s);
	long long int ans = 0;
	for (int i = 0; i + 1 < ope.size(); i++){
		ans += abs(ope[i + 1] - ope[i]);
	}
	printf("%lld\n", ans);
	return 0;
}

Measured memory_bytes: 3084
N = int(input())

x = []
y = []
h = []

for _ in range(N):
    t_x, t_y, t_h = map(int, input().split())
    x.append(t_x)
    y.append(t_y)
    h.append(t_h)

for i in range(101):
    for j in range(101):

        H = -1
        # 初期化
        for index, t_h in enumerate(h):
            if t_h != 0:
                H = abs(i - x[index]) + abs(j - y[index]) + t_h
                break

        for t_x, t_y, t_h in zip(x, y, h):
            if t_h == 0:
                if H > abs(i - t_x) + abs(j - t_y):
                    break
            elif H != abs(i - t_x) + abs(j - t_y) + t_h:
                break
        else:
            print(i, j, H)
            break

        continue
    else:
        continue

    break


Measured memory_bytes: 42736
#include<bits/stdc++.h>
using namespace std;
#define rg register 
#define ll long long
inline ll read()
{
	ll x=0,f=1;
	char c=getchar();
	while(c<'0'||c>'9')
	{
		if(c=='-')
		{
			f=-1;
		}
		c=getchar();
	}
	while(c<='9'&&c>='0')
	{
		x=(x<<1)+(x<<3)+(c^48);
		c=getchar();
	}
	return x*f;
}
int n,k;
ll a[200000];
ll s[200000];
ll ss[200000];
ll sum;
ll maxx;
int main()
{
	n=read();
	k=read();
	for(rg int i=1;i<=n;++i)
	{
		a[i]=read();
		s[i]=s[i-1]+a[i];
		if(a[i]>0)//用来保存区间外面的正数 
		{
			ss[i]=ss[i-1]+a[i];
		}
		else
		{
			ss[i]=ss[i-1];
		}
	}
	for(rg int i=1;i<=n-k+1;++i)
	{
		sum=0;
		ll j=i+k-1;//右端点 
		if(s[j]-s[i-1]>=0)
		{
			sum+=s[j]-s[i-1];
		}
		sum+=(ss[n]-ss[j]);//统计区间外正数 
		sum+=(ss[i-1]-ss[0]);
		maxx=max(maxx,sum);	
	}
	cout<<maxx;
}

Measured memory_bytes: 3584
require 'bigdecimal'

readlines.each do |input|
  a, b, n = input.chomp.split

  decimal = (BigDecimal.new(a) / b.to_i).to_s('F').scan(/\d+\.(\d+)/).flatten.first
  puts decimal[0, n.to_i].chars.inject(0) { |sum, d| sum += d.to_i }
end

Measured memory_bytes: 8836
using System;
using System.Diagnostics;
using System.IO;
using System.Text;
using System.Linq;
using System.Collections.Generic;

class Program
{
    static void Main(string[] args) {
#if DEBUG
        //MyDebugger.MakeTestCase("../TextFile2.txt");
        MyDebugger.Test(process, "../TextFile1.txt");
#else
        object ret = process(new StreamReader(Console.OpenStandardInput()));
        Console.WriteLine(ret);
#endif
    }

    static object process(TextReader input) {
        int n = int.Parse(input.ReadLine());
        string s = input.ReadLine();

        int count = 0;
        char prev = ' ';

        for(int i=0; i<n; i++) {
            char c = s[i];
            if (prev != c) count++;
            prev = c;
        }

        return count;
    }
}


Measured memory_bytes: 11232
// 動的計画法
// 最長共通部分列
// Longest Common Subsequence (LCS)

#include <cstdio>
#include <string>
#include <iostream>

#define rep(i,a) for(int i=0;i<(a);i++)
using namespace std;
void ps(const string &s) { printf("%s ", s.c_str()); }
void br() { putchar('\n'); }

typedef pair<int, string> P;
const int N=3005;

string s,t;

int dp[N][N]; //[i][j]---S1...Siとt1...tiに対するLCSのながさ

// int rec(int i, int j) {
//   if(i >= 0 || j>= 0) return 0;
//   if(dp[i][j] != -1) return dp[i][j];
//   int ret1 = 0;
//   if( s[i] == t[i] ) ret1 = rec(i+1, j+1) + 1;
//   else ret1 = max({ret1, rec(i+1, j), rec(i, j+1)});
//   return dp[i][j] = ret1;
// }

int main() {
  cin >> s >> t;
  rep(i, s.length()) {
    rep(j, t.length()) {
      if(s[i] == t[j]) {
        dp[i+1][j+1] = dp[i][j] + 1;
        // c[i+1][j+1] = c[i][j] + s[i];
      } else {
        if (dp[i][j+1] > dp[i+1][j]) {
          dp[i+1][j+1] = dp[i][j+1];
          // c[i+1][j+1] = c[i][j+1];
        } else {
          dp[i+1][j+1] = dp[i+1][j];
          // c[i+1][j+1] = c[i+1][j];
        }
      }
    }
  }

  string ans = "";
  int i = s.length();
  int j = t.length();
  while (i > 0 && j > 0) {
    if (dp[i][j] == dp[i - 1][j]) {
      --i;
    } else if (dp[i][j] == dp[i][j - 1]) {
      --j;
    } else {
      ans = s[i - 1] + ans;
      --i;
      --j;
    }
  }
  cout << ans << endl;
}


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

using namespace std;
#define BUF (300005)
#define ll long long 

int n,a,b;

int v[BUF];


int main(void){
	cin >> n >> a >> b;

	int sep = n/a;
	if(n%a!=0)sep++;
	
	if(n<a){
		cout << -1 << endl;
		return 0;
	}
	if(b<sep || n-a+1 < b){
		cout << -1 << endl;
		return 0;
	}

	int cnt = 0;
	while(1){
		int st = 1+a*cnt;
		int end= a+a*cnt;

		if(st<=n&&n<=end){
			int c=0;
			for(int i=st;i<=n;i++){
				v[i]=-cnt*a+c+st;
				c++;
			}
			break;
		}

		for(int i=1;i<=a;i++){
			v[i+cnt*a]=n-a+i-cnt*a;
		}
		cnt++;
	}

	for(int i=a+1;i<=n;i++){
		int k = i/a;
		if(i%a!=0)k++;
		k+=n-i;
		//cout << k << i<< " ";
		if(k==b){
			sort(v+i,v+n+1,greater<int>());
			break;
		}
	}

	for(int i=1;i<=n;i++){
		 cout << v[i];
		 cout << " ";
	}
	cout << endl;
	return 0;
}


Measured memory_bytes: 3328
#include<iostream>
#include<vector>
#include<map>
using namespace std;
using ll = long long;

vector<int>v;
map<int, int>mp;

int main() {
	bool visited[110];
	int m, k; cin >> m >> k;
	int x_or = 0;
	for (int i = 0; i < (1 << m); i++) {
		v.push_back(i); v.push_back(i);
		if (i != k) x_or ^= i;
	}
	if (k == 0) {
		for (auto&& x : v)cout << x << ' ';
		return 0;
	}
	if (x_or == k) {
		int n = (1 << (m + 1));
		v[n / 2 - 1] = k;
		int j = 0;
		for (int i = 0; i < n / 2 - 1; i++) {
			if (j == k)j++;
			v[i] = j;
			v[n - 2 - i] = j;
			j++;
		}
		v[n - 1] = k;
		for (auto&& x : v)cout << x << ' ';
		return 0;
	}
	cout << -1;
	return 0;
}

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

int main(){
    while(1){
        int SR,SW,C,R;
        cin>>SR>>SW>>C>>R;
        if(SR == 0 && SW == 0 && C == 0 && R == 0) break;
        int cur = SR,ans = 0;

        while(cur/SW < C){
            cur += R;
            ans++;
        }

        cout<<ans<<endl;   
    }

    return 0;
}


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

using namespace std;

#define debug(x) cout << "\n" << __LINE__ << " " <<  (#x) << " is " << (x) << endl


int main(){
	#ifdef EVAL	
		freopen("input.txt","r",stdin);
		//freopen("output.txt","w",stdout);
	#endif
	int b1 = -1, b2 = -1;
	int N;
	cin >> N;
	vector <int> v(N);
	for(int i = 0; i < N; i++){
		cin >> v[i];
		if(v[i] > b1){
			b2 = b1;
			b1 = v[i];
		}else{
			if(v[i] > b2){
				b2 = v[i];
			}
		}
	}
	for(int i = 0; i < N; i++){
		if(v[i] == b1){
			cout << b2 << '\n';
		}else{
			cout << b1 << '\n';
		}
	}
	return 0;
}

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

#ifdef LOCAL
#include "/home/shahraaz/bin/debug.h"
#else
#define db(...)
#endif

using ll = long long;
#define f first
#define s second
#define pb push_back
#define all(v) v.begin(), v.end()

const int NAX = 2e5 + 5, MOD = 1000000007;

class Solution
{
private:
public:
    Solution() {}
    ~Solution() {}
    void solveCase()
    {
        int n, m;
        cin >> n >> m;
        ll sum = 0;
        while (m)
        {
            m--;
            int x;
            cin >> x;
            sum += x;
        }
        if (sum > n)
            cout << -1 << '\n';
        else
            cout << n - sum << '\n';
    }
};

int32_t main()
{
#ifndef LOCAL
    ios_base::sync_with_stdio(0);
    cin.tie(0);
#endif
    int t = 1;
    // cin >> t;
    Solution mySolver;
    for (int i = 1; i <= t; ++i)
    {
        mySolver.solveCase();
#ifdef LOCAL
        cerr << "Case #" << i << ": Time " << chrono::duration<double>(chrono::steady_clock::now() - TimeStart).count() << " s.\n";
        TimeStart = chrono::steady_clock::now();
#endif
    }
    return 0;
}


Measured memory_bytes: 3640
use proconio::input;

#[allow(unused_imports)]
use std::collections::HashSet;

use std::cmp;


fn main() {
    input! {
        n: usize,
        k: usize,
    }
    solve(n, k);
}

fn prepare(m: usize, k: usize, p :u64) -> Vec<Vec<u64>> {
    let mut v : Vec<Vec<u64>> = Vec::<Vec<u64>>::with_capacity(m + 1);
    let v0 : Vec<u64> = vec![1; 1];
    v.push(v0);
    for i in 1..m+1 {
        let mut vi : Vec<u64>;
        if i <= k {
            vi = vec![0; i+1];
            vi[0] = 1;
            vi[i] = 1;
            for j in 1..i/2+1 {
                vi[j] = (v[i-1][j-1] + v[i-1][j]) % p;
                vi[i-j] = vi[j];
            }
        }
        else {
            vi = vec![0; k+1];
            vi[0] = 1;
            if i < 2 * k {
                for j in 1..i/2+1 {
                    vi[j] = (v[i-1][j-1] + v[i-1][j]) % p;
                    if i-j <= k {
                        vi[i-j] = vi[j];
                    }
                }
            } else {
                for j in 1..k+1 {
                    vi[j] = (v[i-1][j-1] + v[i-1][j]) % p;
                }
            } 
        }
        v.push(vi);
    }
    return v;
}

fn solve(n: usize, k: usize) {
    let p : u64 = (10u32.pow(9u32) + 7) as u64;

    // 1. Calculate values of combinations
    let m = cmp::max(k-1, n-k+1);
    let c = prepare(m, k, p);

    // 2. Calculate possible ways
    for i in 1..k+1 {
        let b = c[k-1][i-1];
        let r = if i > n-k+1 { 
            0
        } else {
            c[n-k+1][i]
        };
        let t = b * r % p;
        println!("{}", t);
    }
}


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

int main(){
  int k, n; cin >> k >> n;
  vector<int> a(n);
  for(int i = 0; i < n; i++) cin >> a[i];
  
  int ans = a[0] + k - a[n-1];
  for(int i = 0; i < n-1; i++){
  	ans = max(ans, a[i+1]-a[i]);
  }
  
  cout << k-ans << endl;
}

Measured memory_bytes: 1024
//#include <bits/stdc++.h>
#include "bits/stdc++.h"
using namespace std;
typedef long long ll;
//#include "boost/multiprecision/cpp_int.hpp"
//typedef boost::multiprecision::cpp_int LL;
typedef long double dd;
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2

ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
void Add(ll &pos,ll val){pos=mod(pos+val);}
dd EPS=1E-9;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second
#define endl "\n"
#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
//template<class T>void max(T a,T b){if(a<b)return b;else return a;}
//template<class T>void min(T a,T b){if(a>b)return b;else return a;}
//template<class T>bool Max(T&a, T b){if(a < b){a = b;return 1;}return 0;}
//template<class T>bool Min(T&a, T b){if(a > b){a = b;return 1;}return 0;}

//////////////////////////


int main(){fastio
    ll n,k;cin>>n>>k;
    ll ans=0;
    rep(b,k+1,n){
        ll t=n/b;
        ans+=t*(b-k);
        ll ama=n%b;
        if(ama>=k){
            if(k!=0)ans+=ama-k+1;
            else ans+=ama-k;
        }
    }
    cout<<ans<<endl;
    
    return 0;
}


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

using namespace std;
using ll = long long;

int main() {
    int N = 0;
    cin >> N;
    vector<int> A(N,0);
    for(int i = 0; i < N; i++) {
        cin >> A.at(i);
        A.at(i)--;
    }
    int now = 0;
    for(int i = 0; i < N; i++) {
        now = A.at(now);
        if(now == 1) {
            cout << i + 1 << endl;
            return 0;
        }
    }
    cout << -1 << endl;



    return 0;
}

Measured memory_bytes: 3768
#include<stdio.h>
#define NUM 15000
int main(void){
  int a[NUM],i=0;
  for(i=0;i<NUM;i++){
    scanf("%d",&a[i]);
    if(a[i]==0){
      break;
    }
  }
     for(i=0;i<NUM;i++){
    if(a[i]==0){
      break;
    }
    printf("Case %d: %d\n",i+1,a[i]);
  }
  return 0;
}

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

using namespace std;

typedef long long ll;

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

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


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

  string s;
  cin >> s;

  ll ans = 0;
  REP(l,s.length()-1) if (s[l]!=s[l+1]) ans++;

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


Measured memory_bytes: 512
import java.util.*;
public class Main {
    public static void main(String[] args) {
        Scanner console = new Scanner(System.in);

        // 入力されたNを変数に格納する
        int n = console.nextInt();
        console.nextLine();

        // 理想の状態、現状、それらの差分をそれぞれリストに格納する
        List<Integer> expectedHeights = new ArrayList<>(n);
        List<Integer> currentHeights = new ArrayList<>(n);
        List<Integer> differences = new ArrayList<Integer>(n);
        for(int i = 0; i < n; i++){
            currentHeights.add(0);
            differences.add(0);
            expectedHeights.add(console.nextInt());
        }

        // 水やり操作を行う。またその回数をカウントする
        int count = 0;
        int beginIndex = -1;
        int endIndex = -1;

        while(true){
            differences = getDifferences(expectedHeights, currentHeights);
            beginIndex = getRange(differences)[0];
            endIndex = getRange(differences)[1];
            if(beginIndex == -1){
                break;
            }else{
                count++;
                for(int i = beginIndex; i <= endIndex; i++){
                    currentHeights.set(i, currentHeights.get(i) + 1);
                }
            }
        }
        System.out.println(count);
    }

    public static List<Integer> getDifferences(List<Integer> expectedHeights, List<Integer> currentHeights){
        int arraySize = expectedHeights.size();
        List<Integer> differences = new ArrayList<Integer>(arraySize);

        for(int i = 0; i < arraySize; i++){
            differences.add(expectedHeights.get(i) - currentHeights.get(i));
        }
        return differences;
    }

    public static int[] getRange(List<Integer> differences){
        int[] answer = new int[2];
        int beginIndex = -1;
        int endIndex = -1;
        boolean isBegin = true;

        for(int i = 0; i < differences.size(); i++){
            int num = differences.get(i);
            if(isBegin && num > 0){
                beginIndex = i;
                endIndex = i;
                isBegin = false;
            }else if(!isBegin && num > 0){
                endIndex = i;
            }else if(isBegin && num == 0){
                continue;
            }else if(!isBegin && num == 0){
                break;
            }
        }

        answer[0] = beginIndex;
        answer[1] = endIndex;
        return answer;
    }
}


Measured memory_bytes: 39532
#include<iostream>
#include <algorithm>
using namespace std;
int main(void) {
	int h, w;
	cin >> h >> w;
	char s[100][100];
	for (int i(0); i < h; i++) {
		for (int j(0); j < w; j++) {
			cin >> s[i][j];
		}
	}
	int time[100][100] = { 0 };
	bool flag[100][100] = { 0 };
	if (s[0][0] == '#') {
		time[0][0]++;
		flag[0][0] = true;
	}
	for (int i(0); i < w-1; i++) {
		if (s[0][i + 1] == '.') {
			time[0][i + 1] = time[0][i];
			flag[0][i + 1] = false;
		}
		else if (s[0][i + 1] == '#' && flag[0][i] == false) {
			time[0][i + 1] = time[0][i] + 1;
			flag[0][i + 1] = true;
		}
		else if (s[0][i + 1] == '#' && flag[0][i] == true) {
			time[0][i + 1] = time[0][i];
			flag[0][i + 1] = true;
		}
	}
	for (int i(0); i < h - 1; i++) {
		if (s[i + 1][0] == '.') {
			time[i + 1][0] = time[i][0];
			flag[i + 1][0] = false;
		}
		else if (s[i + 1][0] == '#' && flag[i][0] == false) {
			time[i + 1][0] = time[i][0] + 1;
			flag[i + 1][0] = true;
		}
		else if (s[i + 1][0] == '#' && flag[i][0] == true) {
			time[i + 1][0] = time[i][0];
			flag[i + 1][0] = true;
		}
	}
	for (int i(1); i < h; i++) {
		for (int j(1); j < w; j++) {
			bool before_flag;
			int smaller;
			if (time[i - 1][j] == time[i][j - 1]) {
				if (flag[i - 1][j] == true || flag[i][j - 1] == true)before_flag = true;
				else before_flag = false;
				smaller = time[i - 1][j];
			}
			else if (time[i-1][j] > time[i][j-1]) {
				if (flag[i][j - 1] == true)before_flag = true;
				else before_flag = false;
				smaller = time[i][j - 1];
			}
			else {
				if (flag[i-1][j] == true)before_flag = true;
				else before_flag = false;
				smaller = time[i - 1][j];
			}
			if (s[i][j] == '.') {
				time[i][j] = smaller;
				flag[i][j] = false;
			}
			else if (s[i][j] == '#' && before_flag == false) {
				time[i][j] = smaller + 1;
				flag[i][j] = true;
			}
			else if (s[i][j] == '#' && before_flag == true) {
				time[i][j] = smaller;
				flag[i][j] = true;
			}
		}
	}
	cout << time[h - 1][w - 1] << endl;
	return 0;
}

Measured memory_bytes: 384
#include <stdio.h>

// 入力受付用の変数
#define BUF 200002
char str[BUF];

// 入力された値
#define LIM_X 11
int N, D;
int X[LIM_X][LIM_X];

void receive_input() {
	fgets(str, sizeof(str), stdin);
	sscanf(str, "%d %d", &N, &D);

	for (size_t n = 0; n < N; n++) {
		for (size_t d = 0; d < D; d++) {
			scanf("%d", &X[d][n]);
		}
	}
}

int distance(int a, int b) {
	int sum = 0;
	for (size_t d = 0; d < D; d++) {
		int dist = X[d][a] - X[d][b];
		sum += dist*dist;
	}

	for (int i = 1; i*i <= sum; i++) {
		if (i*i == sum) {
			return 1;
		}
	}

	return 0;
}

void solve() {
	int ans = 0;

	for (size_t y = 0; y < N; y++) {
		for (size_t z = y+1; z < N; z++) {
			ans += distance(y, z);
		}
	}

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

int main(void) {
	receive_input();

	solve();

	return 0;
}


Measured memory_bytes: 128
from sys import stdin

n = int(stdin.readline().rstrip())
li = list(map(int,stdin.readline().rstrip().split()))
point = 0
mi = 10**10
for i in range(n):
    mi = min(li[i],mi)
    if li[i] <=  mi:
        point += 1
print(point)

    
    

Measured memory_bytes: 24744
#include <bits/stdc++.h>
using namespace std;
#define fast ios::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL)
#define pb push_back
#define gcd __gcd
#define mp make_pair
typedef unsigned long long ull;
typedef long long ll;

#define mod 1000000007

ll fast_exp(ll a, ll b)
{
    if (b == 0) return 1;
  if (b % 2 == 0) {
    ll t = fast_exp(a, b / 2);
    return t * t % mod;
  }
  return a * fast_exp(a, b - 1) % mod;
}

ll NcR(ll n, ll r) 
{ 
   ll x=1,y=1;
   	for (int i = 0; i < r; i++) {
		x = x * (n - i) % mod; 
		y = y * (i + 1) % mod; 
	}
	return x*fast_exp(y,mod-2)%mod;
} 


int main(){
	fast;	
	ll n,a,b;
	cin>>n>>a>>b;
	  
	  ll ans = fast_exp(2, n) - 1;
	ll diff = (NcR(n, a) + NcR(n, b)) % mod;
	cout << (ans - diff + mod) % mod << endl;
	
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdio>
#include <cmath>
#include <vector>
#include <cstring>
#include <string>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <algorithm>
using namespace std;

#define REP(i,n) for(int i=0; i<n; ++i)
#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 ALL(c) (c).begin(), (c).end()

typedef long long ll;
typedef vector<int> VI;
typedef vector<ll> VL;
typedef vector<VI> VVI;
typedef vector<VL> VVL;
typedef pair<int,int> P;
typedef pair<ll,ll> PL;

int main(){
    ll x, k;
    cin >> x >> k;
    VL r(k);
    REP(i,k) scanf("%lld", &r[i]);

    int q;
    cin >> q;
    int i = 0;
    int d = 0;
    ll le = 0, ri = x;
    ll c = 0;
    while (q--){
        ll t, a;
        scanf("%lld %lld", &t, &a);

        while (i < k && r[i] < t){
            if (i % 2 == 0) c -= r[i] - d;
            else c += r[i] - d;
            le = max(le, -c);
            ri = min(ri, x - c);
            if (i % 2 == 0) ri = max(ri, le);
            else le = min(le, ri);
            d = r[i++];
        }

        // printf("left %d right %d c %d\n", le, ri, c);

        ll p;
        if (a <= le) p = le + c;
        else if (a >= ri) p = ri + c;
        else p = a + c;

        ll ans;
        if (i % 2 == 1) ans = p + t - d;
        else ans = p - (t - d);
        ans = max(ans, 0LL);
        ans = min(ans, x);
        printf("%lld\n", ans);
    }


    return 0;
}

Measured memory_bytes: 2048
/**
 * @copyright (c) 2020 Daisuke Hashimoto
 */

#include <bits/stdc++.h>
using namespace std;
using ll = int64_t;
using Pair = pair<int64_t, int64_t>;

// std::cout << std::setprecision(20) << 1.1 << endl;

int64_t GreatestCommonDivisor(const int64_t a, const int64_t b) {
  // GCD. O(log(min(a, b))). 最大公約数.
  int64_t result = -1LL;
  if (a < 0) {
    std::cerr << "ERROR: GreatestCommonDivisor(): a is out of range: " << a << std::endl;
    throw 1;
  } else if (b < 0LL) {
    std::cerr << "ERROR: GreatestCommonDivisor(): b is out of range: " << b << std::endl;
    throw 1;
  } else if (a == 0LL) {
    result = b;
  } else if (b == 0LL) {
    result = a;
  } else {
    const int64_t new_a = std::min(a, b);
    const int64_t new_b = std::max(a, b) % new_a;  // Euclidean Algorithm
    result = GreatestCommonDivisor(new_a, new_b);
  }
  return result;
}

std::vector<std::pair<int64_t, int64_t>> FactorizeIntoPrimeFactors(const int64_t N) {
  std::vector<std::pair<int64_t, int64_t>> result;
  if (N <= 0LL || N == 1LL) {
    return result;
  }
  int64_t remaining = N;
  for (int64_t i = 2LL; i * i <= remaining; ++i) {
    int64_t count = 0LL;
    while (remaining % i == 0LL) {
      ++count;
      remaining /= i;
    }
    if (count > 0LL) {
      result.push_back(std::pair<int64_t, int64_t>(i, count));
    }
  }
  if (remaining > 1) {
    result.push_back(std::pair<int64_t, int64_t>(remaining, 1));
  }
  return result;
}

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

  int64_t A, B;
  cin >> A >> B;
  int64_t gcd = GreatestCommonDivisor(A, B);
  vector<pair<int64_t, int64_t>> factors = FactorizeIntoPrimeFactors(gcd);
  const int64_t N = static_cast<int64_t>(factors.size());
  cout << N + 1 << endl;
  return 0;
}


Measured memory_bytes: 256
//Coded by Abhijay Mitra
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <numeric>
#include <vector>
#include <iterator> 
#include <map>
#include <set>
#include <climits>
#include <queue>
#include <cmath>
#include <stack>
#include <cctype>
#include <bitset>
// #include <bits/stdc++.h>
#define double long double
#define int long long int
#define ll int
#define ibs ios_base::sync_with_stdio(false)
#define cti cin.tie(0)
#define bp __builtin_popcount
#define pb push_back
#define res(v) v.resize(unique(v.begin(), v.end()) - v.begin());
#define cnt_res(v) std::distance(v.begin(),std::unique(v.begin(), v.end())); 
#define timer cerr << "Time elapsed : " << 1.0 * clock() / CLOCKS_PER_SEC << " sec \n";
using vi = std::vector<int>;
using vvi = std::vector<vi>;
using pii = std::pair<int,int>;
using vpii = std::vector<pii>;
using vvpii = std::vector<vpii>;
#define mp         make_pair
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define per(i,b,a) for (int i = b; i >= a; i--)
#define all(x)     x.begin(), x.end()
using namespace std;
const int N=2e6+10;
const int inf = /*0x3f3f3f3f*/1e18+10;
// const ll M = 998244353 ; // Mulo
const int M = 1e9+7 ; // Mulo
const double Pi = 3.14159265;
#define F first
#define S second
int mul(int a,int b){
  return ((a%M)*(b%M))%M;
}
int add(int a,int b){
  return ((a%M)+(b%M))%M;
}
ll powM(ll a, int n) {
  ll x = 1;
  while(n > 0){
    if(n & 1) x = x * a % M;
    a = a * a % M;
    n >>= 1;
  }
  return x;
}
int invM(int x){ 
  return powM(x,M-2);
}
int f[N],b[N];
void binomialCoeff(int n) 
{ 
  f[0]=b[0]=1;
  rep(i,1,N-1){
    f[i]=mul(f[i-1],i);
    b[i]=invM(f[i]);
  }
  // per(i,N-2,0)b[i]=mul(b[i+1],i+1);
  // rep(i,1,n){
  //   C[i]=mul(mul(f[n],b[n-i]),b[i]);
  // }
}
int C(int n,int i){
  if(i<0 or n<i)return 0;
  return mul(mul(f[n],b[n-i]),b[i]);
}
void solve(){
  int n,k;cin>>k;string s;cin>>s;n=s.length();
  binomialCoeff(n+k);
  int ans=0;
  rep(i,n,n+k){
    ans=add(ans,mul(powM(25,n+k-i),C(n+k,i)));
  }
  cout<<ans;
}
int32_t main()
{
  ibs;cti;
  solve()
  /*,cout<<"\n"*/;
  // cout<<"\n";
  int xx=0;
  // int t;cin>>t;while(t--){/*xx++;cout<<"Case "<<xx<<":\n"*/;solve();cout<<"\n";}
  return 0;
}

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

#define F first
#define S second
#define MP make_pair
#define pb push_back
#define all(a) a.begin(), a.end()
#define rall(a) a.rbegin(), a.rend()
#define LCM(a, b) (a) / __gcd((a), (b)) * (b)
#define CEIL(a, b) (a)/(b)+(((a)%(b))?1:0)
#define ln '\n'

using namespace std;
using LL = long long;
using ldouble = long double;
using P = pair<int, int>;
using LP = pair<LL, LL>;

static const int INF = INT_MAX;
static const LL LINF = LLONG_MAX;
static const int MIN = INT_MIN;
static const LL LMIN = LLONG_MIN;
static const int MOD = 1e9 + 7;
static const int SIZE = 200005;

const int dx[] = {0, -1, 1, 0};
const int dy[] = {-1, 0, 0, 1};

vector<LL> Div(LL n) {
    vector<LL> ret;
    for(LL i = 1; i * i <= n; ++i) {
        if(n % i == 0) {
            ret.pb(i);
            if(i * i != n) ret.pb(n / i);
        }
    }
    sort(all(ret));
    return ret;
}

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

    int cnt[SIZE] = {};
    int n;
    cin >> n;
    vector<int> v(n), tmp(n);
    for(int i = 0; i < n - 1; ++i) {
        cin >> v[i];
        ++cnt[v[i]];

    }
    sort(all(v), greater<>());

    for(int i = 1; i <= n; ++i) {
        cout << cnt[i] << endl;

    }
    return 0;
}



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

int main(){
    int n;
    int t;
    int point[100];
    int total;
    int low,high;
    while(1){
        memset(point,0,sizeof(point));
        cin >> n;
        if(n == 0) break;
        for(int i=0;i<n;i++){
            total = 0;
            for(int j=0;j<5;j++){
                cin >> t;
                total += t;
            }
            point[i] = total;
        }
        low = point[0];
        high = point[0];
        for(int i=1;i<n;i++){
            if(low > point[i]) low = point[i];
            else if(high < point[i]) high = point[i];
        }
        cout << high << " " << low << endl;
    }
}

Measured memory_bytes: 1160
#include<cstdio>
#include<algorithm>
#include<functional>
#include<cstring>
using namespace std;
int main(void)
{
	int i,n,j,x,y,a,x1[100000],x2[100000],b;
	scanf("%d %d",&n,&x);
	for(i=0;i<n;i++)	{
		scanf("%d",&a);
		a=a-x;
		if(a<0)	a=-a;
		x1[i]=a;
	}
	a=x1[0];
	for(i=1;i<n;i++)	{
		x=a;	y=x1[i];
		if(x<y)	swap(x,y);
		while(1)	{
			b=x%y;
			if(b==0)	{
				a=y;	break;
			}
			x=y;	y=b;
		}
	}
	printf("%d\n",a);
	return 0;
}

Measured memory_bytes: 512
#include <iostream>
#include <fstream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <random>
#include <cstdio>
#include <cstring>
#include <cmath>

// for i in f..<t {... : as Swift
#define forin(i, f, t) for(ll i = f; i < t; i++)

using namespace std;
using ll = long long;
using P = pair<ll, ll>;

int main() {
    ll n;
    cin >> n;
    vector<ll> a(n);
    for (auto &v : a)
        cin >> v;
    
    const ll MAX = 1e9;
    
    ll bit[n*2+2];
    auto add = [&](ll x) {
        x+=n+1;
        for (;x < n*2+2; x+=x&-x) bit[x]++;
    };
    auto clear = [&]() {
        for (auto &b : bit) b = 0;
    };
    auto query = [&](ll x) {
        x+=n+1;
        ll ret = 0;
        for (;x;x-=x&-x) ret+=bit[x];
        return ret;
    };
    
    auto check = [&](ll med) {
        cerr<<"med= "<<med<<endl;
        ll sum[n];
        ll prev = 0;
        forin(i, 0, n) {
            sum[i] = a[i] >= med ? prev+1 : prev-1;
            prev = sum[i];
        }
        clear();
        ll score = 0;
        add(0);
        forin(i, 0, n) {
            score += query(sum[i]);
            add(sum[i]);
        }
        cerr<<score<<endl;
        ll pat = n*(n+1)/2;
        return score >= ceil(float(pat)/2);
    };
    
    ll l = 0, r = MAX;
    ll ans = 0;
    while (l <= r) {
        ll mid = (l+r)/2;
        if (check(mid)) {
            ans = mid;
            l = mid+1;
        }
        else r = mid-1;
    }
    cout << ans << endl;
    
    
}



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

int main()
{
	int a,s,d,ans;
	cin >> a;

	s = a / 500;
	d = a % 500;

	s = 1000 * s;
	d = d / 5;

	d = d * 5;

	ans = s + d;

	cout << ans << endl;

	cin.get();
    cin.get();
    return 0;
}

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

namespace Atcoder
{
    class Program
    {
        static void Main(string[] args)
        {
            var r = Console.ReadLine();
            foreach (var c in r)
            {
                if (c == '9')
                {
                    Console.WriteLine("Yes");
                    return;
                }
            }
            Console.WriteLine("No");
        }
        
    }
}

Measured memory_bytes: 11092
/*
                            Author: Ankit Kaul
*******Code Belongs to Respective Author Only*************
*/
/*#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC optimize("unroll-loops")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
*/
/*freopen("input.txt", "rt", stdin);
freopen("output.txt", "wt", stdout);
*/
#include <bits/stdc++.h>
#define endl       '\n'
#define PI          3.141592653589
#define jaldi       ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define M           1000000007
#define int         long long int
#define inf         INT_MAX
#define pb          emplace_back
#define pf          emplace_front
#define pii         pair<int,int>
#define vi          vector<int>
#define vii         vector<pii>
#define mi          map<int,int>
#define mii         map<pii,int>
#define all(a)      (a).begin(),(a).end()
#define rall(a)     (a).rbegin(),(a).rend()
using namespace std;
int gcd(int a,int b) { return b == 0 ? a : gcd(b, a % b); }
int power(int x,int n){
    int result=1;
    while(n>0)
        {   if(n % 2 ==1)
            result=(result * x)%M;
            x=(x*x)%M;
            n=n/2;
        }
    return result%M;
}
bool isPrime(int n)
    {
    if (n <= 1)
        return false;
    if (n <= 3)
        return true;
    if (n % 2 == 0 || n % 3 == 0)
        return false;
    for (int i = 5; i * i <= n; i = i + 6)
        if (n % i == 0 || n % (i + 2) == 0)
            return false;
    return true;
    }
int inv(int a,int m)
{   return power(a,m-2);
}   
int lcm(int a,int b)
{   return a*b/(gcd(a,b));
}
signed main()
{   jaldi  
    string str;
    cin>>str;
    if(str[str.length()-1]=='s')
    {   str+="es";
        cout<<str;
    }
    else
    {   str+="s";
        cout<<str;
    }
}


Measured memory_bytes: 3636
#include <bits/stdc++.h>
#define REP(i, n) for(int i = 0;i < n;i++)
#define REPR(i, n) for(int i = n;i >= 0;i--)
#define FOR(i, m, n) for(int i = m;i < n;i++)
#define FORR(i, m, n) for(int i = m;i >= n;i--)
#define SORT(v, n) sort(v, v+n);
#define VSORT(v) sort(v.begin(), v.end());
#define llong long long
#define pb(a) push_back(a)
#define INF 999999999
using namespace std;
typedef pair<int, int> P;
typedef pair<llong, llong> LP;
typedef pair<int, P> PP;
typedef pair<llong, LP> LPP;

int dy[]={0, 0, 1, -1, 0};
int dx[]={1, -1, 0, 0, 0};

int main() {
    int x,t;
    cin>>x>>t;
    int ans=x-t;
    if(ans<=0) cout<<0<<endl;
    else cout<<ans<<endl;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define ll long long
#define endl '\n'
#define PI acos(-1)
#define sz 86029900
#define RUN_FAST ios::sync_with_stdio(false);
using namespace std;

int main()
{
    RUN_FAST; cin.tie(nullptr);
    string s1, s2;
    int i, j, len1, len2, up, cnt, mn;
    cin >> s1 >> s2;
    len1=s1.size();
    len2=s2.size();
    up=len1-len2+1;
    mn=1000000;
    for (i=0; i<up; i++) {
        cnt=0;
        for (j=0; j<len2; j++) {
            if (s1[i+j]!=s2[j]) cnt++;
        }
        mn=min(mn, cnt);
    }
    cout << mn << endl;
    return 0;
}


Measured memory_bytes: 3644
#include <iostream>
#include<string>
#include<cstdio>
#include<cmath>
#include<algorithm>
#include<vector>
#include<queue>
using namespace std;
int main(){
    double a,b,c,d,e,f,x,y;
    while(cin>>a>>b>>c>>d>>e>>f){
        x=(c*e-b*f)/(e*a-b*d);
        y=(c*d-a*f)/(b*d-a*e);
        if(x==0)x=0.000;
        if(y==0)y=0.000;
        printf("%.3f ",x);
        printf("%.3f\n",y);
    }
    return 0;
}

Measured memory_bytes: 3268
#include <bits/stdc++.h>
#define mp make_pair
#define eb emplace_back
#define fi first
#define se second
#define bit(n) 1 << n
using namespace std;
using cd = complex <double>;

typedef pair <int, int> pii;
typedef vector <int> vi;
typedef vector <pair <int, int> > vii;
typedef map <int, int> mii;

const int Inf = 100000;
const int mod = 1000000007;
const double Pi = acos(-1);

void Fastio()
{
	ios_base::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
}

int n, x, y;
int C[2005];

void Solve()
{
	cin >> n >> x >> y;
	for(int i = 1; i <= n; i++)
	{
		for(int j = i + 1; j <= n; j++)
		{
			C[min(j - i, abs(i - x) + 1 + abs(j - y))]++;
		}
	}
	for(int i = 1; i < n; i++)
	{
		cout << C[i] << endl;
	}
}

signed main()
{
	Solve();
}


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

int n, x, m, l[10], r[10], s[10];
int ret[6];

bool rec( int now, int sum){
  if(now == n){

    int sum[6] = {};
    for(int i = 0 ; i < n ; i++){
      sum[i + 1] = sum[i] + ret[i];
    }
    for(int i = 0 ; i < m ; i++ ){
      if(sum[r[i]] - sum[l[i] - 1] != s[i]) return false;
    }
    for(int i = 0 ; i < n ; i++ ){
      cout << (i  ? " " : "") << ret[i];
    }
    cout << endl;
    return true;

  }
  for(int i = x ; i >= 0 ; i--){
    ret[now] = i;
    if(rec( now + 1, sum - i)) return true;
  }
  return false;
}

int main(){
  cin >> n >> x >> m;
  for(int i = 0; i < m; i++){
    cin >> l[i] >> r[i] >> s[i];
  }
  if(!rec(0,m)) cout << "-1\n";
}

Measured memory_bytes: 1164
#include <bits/stdc++.h>
using namespace std;
int main(){
  int N,M;
  cin >> N >> M;
  vector<int> a(N),b(N),c(M),d(M);
  for (int i = 0; i < N ; ++i ) {
    cin >> a[i] >> b[i];    
} 
for (int i = 0; i < M; ++i ) {
    cin >> c[i] >> d[i];
}

for (int i = 0; i < N; ++i ) {
  int min_dist = abs(a[i] -c[0]) + abs(b[i] - d[0]) ;
  int check = 1;
  for (int k = 1; k < M; ++k ) {
    int cur_dist = abs(a[i] -c[k]) + abs(b[i] - d[k]) ;
    if (cur_dist < min_dist) {
      check = k + 1;
      min_dist = cur_dist;
    }
  }    
  cout << check << endl;
}
}


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

int main() {
int A, B, C, D;
cin >> A >>  B >> C >> D;

while(true){

if(C > 0){
C = C- B;
}else{
cout << "Yes";
break;
}

if(A > 0){
A = A-D;
}else{
cout << "No";
break;
}

}

return 0;

}

Measured memory_bytes: 3636