akhauriyash/Code-Regression huggingface dataset:
/// kAAzuki Hoshino
/*
#pragma comment(linker, "/stack:200000000")
#pragma GCC optimize("O3")
#pragma GCC optimize("Ofast")
#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
#pragma GCC optimize("unroll-loops")
*/
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace __gnu_pbds;
using namespace std;
#define int long long
typedef tree<int,null_type,less<int>,rb_tree_tag,tree_order_statistics_node_update>ordered_set;
typedef long double ld;
typedef vector<int> vi;
typedef pair<int,int> pi;
typedef vector<pi> vpi;
#define inf 1000000000
#define mod 1000000007
#define rep(i,a,b) for (int i = a; i <= b; i++)
#define rep1(i, a, b) for(int i =a; i >=b; i--)
#define dmp(x) cerr<<"line "<<__LINE__<<" "<<#x<<":"<<x<<endl
#define fs first
#define sc second
#define pb push_back
#define all(c) (c).begin(),(c).end()
#define mt make_tuple
template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){
	return o<<"("<<p.fs<<","<<p.sc<<")";
}
template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){
	o<<"{";
	for(const T& v:vc) o<<v<<",";
	o<<"}";
	return o;
}

int n,m,a[101010],ans;
vpi v;
priority_queue<int> q;

signed main(){
ios::sync_with_stdio(0);
cin.tie(0);
cout.tie(0);
//freopen("input.txt", "r", stdin);
//freopen("output.txt", "w", stdout);

    cin >> n >> m;
    for(int i=1;i<=n;i++){
      cin >> a[i];
      q.push(-a[i]);
    }

    for(int i=1;i<=m;i++){
      int l,r;
      cin >> l >> r;
      v.pb({r,l});
    }

    sort(all(v));
    reverse(all(v));

    bool flag = true;

    for(auto t:v){
      if(q.empty())break;
      int tt = q.top();
      tt*=-1;
      int val = t.fs;
      int cnt = t.sc;
      if(tt < val ){
          while( !q.empty() && -1*q.top() < val && cnt  ){
            q.pop();
            cnt--;
            ans+=val;
          }
      }
      else flag = false;

      if(!flag)break;
    }

    while(!q.empty()){
      ans+= -1LL*q.top();q.pop();
    }
    cout << ans << endl;

return 0;
}
///....


Measured memory_bytes: 3956
#include <bits/stdc++.h>
using namespace std;
string n[120];
int main(){
  int a,b;
  cin >> a >> b;
  for(int i = 0;i < a;i++){
    cin >> n[i];
  }
  sort(n,n+a);
  for(int i = 0;i < a;i++){
    cout << n[i];
  }
  cout << endl;
  
}


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

using namespace std;

int m, d[102][102], a, b, ok[102][102];
struct skrr {
  int i, j, c;
} v[20002];

int main()
{
  cin >> a >> b;
  for (int i = 1; i <= a; i++)
    for (int j = 1; j <= b; j++)
      cin >> d[i][j];
  for (int i = 0; i <= 100; i++)
    for (int j = 0; j <= 100; j++) {
      int mx = 0;
      for (int x = 1; x <= a; x++)
        for (int y = 1; y <= b; y++)
          mx = max (mx, d[x][y] - i * x - j * y);
      v[++m] = {i + 1, 202 - j, mx};
      for (int x = 1; x <= a; x++)
        for (int y = 1; y <= b; y++)
          if (mx + i * x + j * y == d[x][y])
            ok[x][y] = 1;
    }
  for (int x = 1; x <= a; x++)
    for (int y = 1; y <= b; y++)
    if (!ok[x][y]) {
      cout << "Impossible";
      return 0;
    }
  cout << "Possible\n";
  cout << "202 " << m + 200 << "\n";
  for (int i = 1; i <= 100; i++)
    cout << i << " " << i + 1 << " X\n";
  for (int i = 1; i <= 100; i++)
    cout << i + 101 << " " << i + 102 << " Y\n";
  for (int i = 1; i <= m; i++)
    cout << v[i].i << " " << v[i].j << " " << v[i].c << "\n";
  cout << "1 202";
  return 0;
}


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

using namespace std;

typedef long long ll;

int N,K;
ll a[50];
ll L,R;

vector<pair<int,ll> >x,y;

void func(int l,int r ,vector<pair<int,ll> >&t){
    int w=r-l;
    for(int i=0;i<(1<<w);i++){
        ll sum=0;
        int cnt=0;
        for(int j=0;j<w;j++){
            if((i>>j)&1){
                sum+=a[l+j];
                cnt++;
            }
        }
        t.push_back(make_pair(cnt,sum));
    }
}

int main(){
    cin>>N>>K>>L>>R;
    for(int i=0;i<N;i++)
        cin>>a[i];
    func(0,N/2,x);
    func(N/2,N,y);
    sort(y.begin(),y.end());
    ll ans=0;
    for(int i=0;i<x.size();i++){
        vector<pair<int,ll> >::iterator it1,it2;
        it1=lower_bound(y.begin(),y.end(),pair<int,ll>(K-x[i].first,L-x[i].second));
        it2=upper_bound(y.begin(),y.end(),pair<int,ll>(K-x[i].first,R-x[i].second));
        ans+=(it2-it1);
    }
    cout<<ans<<endl;
    return 0;
}

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

int euclid(int a, int b);

int main()
{
    long int a, b, c, d;
    cin >> a >> b >> c >> d;
    long int div_c, div_d, div_cd;
    div_c = b/c - (a-1)/c;
    div_d = b/d - (a-1)/d;
    div_cd = b/((c*d)/euclid(c, d)) - (a-1)/((c*d)/euclid(c, d));
    cout << b-a+1 - div_c - div_d + div_cd << endl;
    return 0;
}

int euclid(int a, int b){
  if(a%b == 0){
    return b;
  }else{
    return euclid(b, a%b);
  }
}

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

#define MAX 100005

using namespace std;

int n, m, s, t;
vector<int> G[MAX];
int8_t mark[MAX];;

int bfs()
{
        queue<pair<int,int>> q;
        int ls = 0;
        int kkp = 0;
        q.emplace(s,0);

        while (!q.empty()) {
                auto curr = q.front();
                q.pop();
                if (curr.second != 3) {
                        kkp += (ls == 3);
                        ls = curr.second;

                        if ((mark[curr.first] & (1<<curr.second))) continue;
                        mark[curr.first] |= (1<<curr.second);
                        for (auto e : G[curr.first])
                                q.emplace(e, curr.second+1);
                } else {
                        if (curr.first == t) return kkp+1;
                        else if ((mark[curr.first] & (1<<curr.second))) continue;

                        mark[curr.first] |= (1<<curr.second);
                        ls = curr.second;
                        for (auto e : G[curr.first])
                                q.emplace(e, 1);
                }
        }
        return -1;
}

int main()
{
        cin >> n >> m;
        for (int i = 0; i < m; i++) {
                int u, v;
                cin >> u >> v;
                G[u].push_back(v);
        }
        cin >> s >> t;
        cout << bfs() << endl;
        return 0;
}

Measured memory_bytes: 5760
N , M = map(int,input().split())
h = list(map(int, input().split()))
graph = [[] for _ in range(N)]
for _ in range(M):
    a , b = map(int,input().split())
    graph[a - 1].append(b - 1)
    graph[b - 1].append(a - 1)
ans=0
 
for index,i in enumerate(graph):
    judge=1
    for j in i:
        if h[index] <= h[j]:
            judge=0
            break
    if judge==1:
        ans+=1
print(ans)


Measured memory_bytes: 29356
A, B, K = map(int,input().split())
count=1
num=[]
num.append(1)

if A>B:
    for i in range(2,B+1):
        if A%i==0 and B%i==0:
            num.append(i)
            count =count+1
else:
    for i in range(2,A+1):
        if A%i==0 and B%i==0:
            num.append(i)
            count =count+1
#print(count)

print(num[count-K])

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define int long long
#define double long double

vector<int>v[100005];
int n,m;
int vis[100005];
int val[100005];
int32_t main()
{
    IOS;
    cin>>n>>m;
    for(int i=0;i<m;i++)
    {
        int a,b;
        cin>>a>>b;
        v[a].push_back(b);
        v[b].push_back(a);
    }
    for(int i=0;i<100004;i++)
        val[i]=1e18;
    queue<pair<pair<int,int>,int>>q;
    q.push({{0,1},1});
    while(q.size())
    {
        auto i=q.front();
        q.pop();
        vis[i.first.second]=i.second;
        for(int j:v[i.first.second])
            if(val[j]>1+i.first.first)
            {
                val[j]=1+i.first.first;
                q.push({{1+i.first.first,j},i.first.second});
            }
    }
    for(int i=2;i<=n;i++)
        if(!vis[i])
            return cout<<"No",0;
    cout<<"Yes"<<endl;
    for(int i=2;i<=n;i++)
        cout<<vis[i]<<endl;
}

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

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            new Program().Solve(new ConsoleInput(Console.In,' '));
        }

        public void Solve(ConsoleInput cin)
        {
            var N = cin.ReadLong;

            WriteLine(N % 2 == 0 ? N/2 : N/2+1);
        }
    }


    public class ConsoleInput
    {
        private readonly System.IO.TextReader _stream;
        private char _separator = ' ';
        private Queue<string> inputStream;
        public ConsoleInput(System.IO.TextReader stream,char separator = ' ')
        {
            this._separator = separator;
            this._stream = stream;
            inputStream = new Queue<string>();
        }

        public string Read
        {
            get
            {
                if(inputStream.Count != 0) return inputStream.Dequeue();
                string[] tmp = _stream.ReadLine().Split(_separator);
                for(int i = 0;i < tmp.Length;i++)
                    inputStream.Enqueue(tmp[i]);
                return inputStream.Dequeue();
            }
        }

        
        public string ReadLine { get { return _stream.ReadLine(); }}
        public int ReadInt { get { return int.Parse(Read); }}
        public long ReadLong { get { return long.Parse(Read); }}
        public double ReadDouble { get { return double.Parse(Read); }}
        public string[] ReadStrArray(long N) { var ret = new string[N]; for (long i = 0; i < N; ++i) ret[i] = Read; return ret;}
        public int[] ReadIntArray(long N) { var ret = new int[N]; for (long i = 0; i < N; ++i) ret[i] = ReadInt; return ret;}
        public long[] ReadLongArray(long N) { var ret = new long[N]; for (long i = 0; i < N; ++i) ret[i] = ReadLong; return ret;}
    }

}

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

const int N = 202020;
int a[N], pr[N], ne[N], pos[N];

int main()
{
	int n;
	cin >> n;
	for (int i = 1; i <= n; ++i){
		cin >> a[i];
		pos[a[i]] = i;
	}

	for (int i = 0; i <= n + 1; ++i){
		pr[i] = i - 1;
		ne[i] = i + 1;
	}

	long long ans = 0;
	for (int i = n; i >= 1; i--){
		int j = pos[i];
		ans += i * 1ll * (j - pr[j]) * (ne[j] - j);
		pr[ne[j]] = pr[j];
		ne[pr[j]] = ne[j];
	}

	cout << ans << endl;
}


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

using ll = long long;

#define rep(i, n) for (int i = 0; i < (n); ++i)
#define rrep(i, n) for (int i = 1; i <= (n); ++i)
#define drep(i, n) for (int i = (n)-1; i >= 0; --i)
#define ddrep(i, n) for (int i = n; i > 0; --i)
#define srep(i, s, t) for (int i = s; i < t; ++i)
#define ssrep(i, s, t) for (int i = s; i <= t; ++i)

#define rng(a) a.begin(), a.end()
#define rrng(a) a.rbegin(), a.rend()
#define pb push_back
#define eb emplace_back
#define fi first
#define se second

#define chmax(x, y) (x = max(x, y))
#define chmin(x, y) (x = min(x, y))

using pi = pair<int, int>;
using vi = vector<int>;
using vvi = vector<vi>;
using vl = vector<ll>;
using vvl = vector<vl>;
using ld = long double;

template <class T, class U>
ostream &operator<<(ostream &os, const pair<T, U> &p) {
  os << "(" << p.first << "," << p.second << ")";
  return os;
}

template <class T> ostream &operator<<(ostream &os, const vector<T> &v) {
  os << "{";
  rep(i, (int)v.size()) {
    if (i)
      os << ",";
    os << v[i];
  }
  os << "}";
  return os;
}

template <typename T, size_t S> void printArray(const T (&array)[S]) {
  for (auto val : array)
    std::cout << val << ", ";
  std::cout << "\n";
}

const int mod = 1e9 + 7;
const int inf = 1e9 + 5;

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

  int n, x; std::cin >> n >> x;
  vi a(n); rep(i, n) std::cin >> a[i];
  ll ans = 0;
  rep(i, n-1) {
    if (a[i]+a[i+1] <= x) continue;
    int diff = (a[i] + a[i+1]) - x;
    a[i+1] = max(0, a[i+1]-diff);
    ans += diff;
  }
  std::cout << ans << "\n";
}


Measured memory_bytes: 640
/* main code starts from line 130. */

/* ---------- STL Libraries ---------- */

// IO library
#include <cstdio>
#include <iomanip>
#include <ios>
#include <iostream>

// algorithm library
#include <algorithm>
#include <cmath>
#include <numeric>

// container library
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <string>
#include <vector>

/* ---------- Namespace ---------- */

using namespace std;

/* ---------- Type Abbreviation ---------- */

template <typename T>
using V = vector<T>;
template <typename T, typename U>
using P = pair<T, U>;
template <typename T>
using PQ = priority_queue<T>;

using ll = long long;
using str = string;

#define fst first
#define snd second
#define pb push_back
#define mp make_pair
#define mt make_tuple

/* ---------- conversion ---------- */

#define INT(c) static_cast<int>(c)
#define CHAR(n) static_cast<char>(n)
#define LL(n) static_cast<ll>(n)
#define DOUBLE(n) static_cast<double>(n)

/* ---------- container ---------- */

#define ALL(v) (v).begin(), (v).end()
#define SIZE(v) (LL((v).size()))

#define FIND(v, k) (v).find(k) != (v).end()
#define VFIND(v, k) find(ALL(v), k) != (v).end

#define SORT(v) sort(ALL(v))
#define GSORT(v) sort(ALL(v), greater<decltype((v).front())>())

/* ---------- repetition ---------- */

#define FOR(i, a, b) for (ll i = (a); i < (b); i++)
#define REP(i, n) FOR(i, 0, n)
#define NREP(i, n) FOR(i, 1, n + 1)

#define RFOR(i, a, b) for (ll i = (a); i >= (b); i--)
#define RREP(i, n) RFOR(i, n - 1, 0)
#define RNREP(i, n) RFOR(i, n, 1)

// Usual REP runs from 0 to n-1 (R: n-1 to 0)
// Natural REP runs from 1 to n (R: n to 1)

/* ---------- Short Functions ---------- */

template <typename T>
T sq(T a) {
    return a * a;
}

#define fcout cout << fixed << setprecision(10)

/* ----------- debug ---------- */

template <typename T, typename U>
void testP2(T a, U b) {
    cout << "(" << a << ", " << b << ")" << endl;
    return;
}

template <typename T>
void testV(T v) {
    cout << "[";
    for (auto i : v) {
        cout << i << ", ";
    }
    cout << "\b\b]" << endl;
    return;
}

template <typename T>
void testV2(T v) {
    for (auto sv : v) {
        testV(sv);
    }
    cout << endl;
    return;
}

#define GET_VAR_NAME(variable) #variable
#define test(x) cout << GET_VAR_NAME(x) << " = " << x << endl;
#define testP(p)                      \
    cout << GET_VAR_NAME(p) << " = "; \
    testP2(p.fst, p.snd);

/* ---------- Constants ---------- */

// const ll MOD = 1e9 + 7;
// const int INF = 1 << 25;
// const ll INF = 1LL << 50;
// const double PI = 3.14159265358979;
// const ll dx[4] = {0, -1, 1, 0};
// const ll dy[4] = {-1, 0, 0, 1};
// const ll dx[8] = {-1, 0, 1, -1, 1, -1, 0, 1};
// const ll dy[8] = {-1, -1, -1, 0, 0, 1, 1, 1};

/* v-v-v-v-v-v-v-v-v Main Part v-v-v-v-v-v-v-v-v */

/* ---------- Type Definition ----------- */


/* ---------- Global Variance ----------- */


/* ------------- Functions -------------- */


/* ----------- Main Function ------------ */

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

    str S;
    cin >> S;
    cout << S.substr(0, 4) << " " << S.substr(4) << endl;
    return 0;
}

Measured memory_bytes: 256
#pragma GCC optimize("Ofast")
#include<bits/stdc++.h>
#include <boost/multiprecision/cpp_dec_float.hpp>
#include <boost/multiprecision/cpp_int.hpp>
#include <boost/numeric/interval.hpp>
#include <boost/numeric/interval/io.hpp>
using namespace::std;
namespace mp = boost::multiprecision;
typedef mp::number<mp::cpp_dec_float<32,int64_t>> cfloat;
typedef mp::cpp_int cint;
typedef long long lint;
typedef long long ll;
typedef long double ldouble;
typedef vector<lint> vec;
typedef vector<vector<lint>> mat;
typedef vector<vector<vector<lint>>> mat3;
typedef vector<double> dvec;
typedef vector<vector<double>> dmat;
typedef vector<vector<vector<double>>> dmat3;
typedef vector<string> svec;
typedef vector<vector<string>> smat;
typedef vector<vector<vector<string>>> smat3;
#define rep(i, n) for(lint i = 0; i < (lint)(n); i++)
#define irep(i) for(lint i = 0;; i++)
#define irep1(i) for(lint i = 1;; i++)
#define irep2(i) for(lint i = 2;; i++)
#define rrep(i, n) for(lint i = (lint)(n-1); i >-1; i--)
#define rrepi(i,a,b) for(lint i = (lint)(b-1); i >a-1; i--)
#define repi(i,a,b) for(lint i=lint(a);i<lint(b);i++)
#define rep2(i,a,b,c) for(lint i=lint(a);i>lint(b);i+=c)
#define all(x) (x).begin(),(x).end()
#define sl(c) (('a')<=(c)&&(c)<=('z'))
#define ll(c) (('A')<=(c)&&(c)<=('Z'))
#define max3(a,b,c) max(a,max(b,c))
#define min3(a,b,c) min(a,min(b,c))
#define PI 3.141592653589793
#define cout (cout<<fixed<<setprecision(15))
#define makeupper(t) (transform(all(t),t.begin(),::toupper))
#define makelower(t) (transform(all(t),t.begin(),::tolower))
#define dist(x1,y1,x2,y2) (pow(pow(x2-x1,2)+pow(y2-y1,2),0.5))
#define NEXT_LINE string junk; getline(cin, junk);
#define output(v) do{rep(i,v.size())cout<<(i?" ":"")<<v[i];cout<<"\n";}while(0)
#define output2(v) rep(i,v.size()){rep(j,v[i].size()){cout<<(j?" ":"")<<v[i][j];}cout<<"\n";}
#define input(a,n) lint n;cin>>n;vector<lint>a(n);rep(i,n)cin>>a[i];
#define INF (1LL<<60)
#define IINF (1<<30)
#define LINF 9223372036854775807
#define MOD 1000000007
vector<lint> dx={-1,1,0,0,1,1,-1,-1};
vector<lint> dy={0,0,-1,1,1,-1,1,-1};
inline lint gcd(lint a,lint b){return b?gcd(b,a%b):a;}
inline lint lcm(lint a,lint b){return a*b/gcd(a,b);}
inline lint max(vector<lint> num){
    lint M=num[0];
    rep(i,num.size())M=max(M,num[i]);
    return M;
}
inline lint min(vector<lint> num){
    lint M=num[0];
    rep(i,num.size())M=min(M,num[i]);
    return M;
}
int main(){
    lint n,k;
    cin>>n>>k;
    vec x(n),y(n);
    vector<pair<lint,lint>>v(n);
    rep(i,n)cin>>x[i]>>y[i];
    rep(i,n)v[i]=make_pair(x[i],y[i]);
    sort(all(v));
    lint m=LINF;
    rep(i,n-k+1)repi(j,k,n-i+1){
        lint w=v[i+j-1].first-v[i].first;
        vec a(j);
        rep(l,j){
            a[l]=v[i+l].second;
        }
        sort(all(a));
        rep(l,j-k+1){
            m=min(m,w*(a[l+k-1]-a[l]));
        }
    }
    cout<<m;
}

Measured memory_bytes: 384
import sys

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

n = ni()
s = ns()
if n % 2 == 0 and s[0:n//2] == s[n//2:]:
    print("Yes")
else:
    print("No")


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

typedef long long ll;

int main()
{
	// int n;
	// cin>>n;
	string s;
	cin>>s;
	if(s[2]==s[3] and s[4]==s[5])
		cout<<"Yes"<<endl;
	else cout<<"No"<<endl;

}

Measured memory_bytes: 256
#include "bits/stdc++.h"
#define fio ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0)
#define endl '\n'
#define all(V) (V).begin(), (V).end() 
using namespace std;
typedef long long ll;

int main() {fio;
	int n;
	cin >> n;
	vector <int> a(n);
	for(int i = 0; i < n; i++) {
		cin >> a[n - i - 1];
	} 
	if(a[0] != 2) {
		cout << -1 << endl;
		return 0;
	}
	ll L = 2, R = 3;
	for(int i = 1; i < n; i++) {
		if(L % a[i] != 0) L += (a[i] - L % a[i]);
		if(R % a[i] != 0) R -= R % a[i];
		if(L > R) {
			cout << -1 << endl;
			return 0;
		}
		R += a[i] - 1;
	}
	cout << L << ' ' << R << endl;
    return 0;
}

Measured memory_bytes: 3708
#include <cmath>
#include <iostream>
#include <stdio.h>
#include <string>
#include <sstream>
#include <iomanip>
#include <algorithm>
#include <vector>
#include <set>
#include <limits.h>
#include <map>
#include <numeric>

namespace test {
	std::string to_string (char val) {
		return std::string (1, val);
		// return std::string{val};
	}
	//if( str.find ("r") != string::npos)
}

using namespace std;
typedef long long int llint;

int main (void) {
	int n,k; cin >> n >> k;
	int *l = new int [n];
	for (int i = 0; i < n; i++) {
		cin >> l[i];
	}
	sort(l, l + n);
	int total = 0;
	for (int i = 0; i < k; i++) {
		total += l[n - i - 1];
	}
	cout << total << endl;
	return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
#define N 1000000
#define Q 50000

int main()
{

  int i,j,n,q,count=0,left,right,mid,S[N],T[Q];

  scanf("%d",&n);
  for(i=0;i<n;i++){
    scanf("%d",&S[i]);
  }
  
  scanf("%d",&q);
  for(i=0;i<q;i++){
    scanf("%d",&T[i]);  
    
    //binarySearch
    left = 0;
    right = n;
    while(left < right){
      mid = (left+right)/2;
      if(S[mid] == T[i]){
	count++;
	break;
      }
      else if(T[i] < S[mid]) right = mid;
      else left = mid+1;
    }
  }    
  
  printf("%d\n",count);
  
  return 0;
}

Measured memory_bytes: 1188
#include <bits/stdc++.h>
#define N 200005
using namespace std;
typedef long long ll;
ll n,m,k,ans,a[N],b[N],sa[N],sb[N];
int main(){
   	cin>>n>>m>>k;
    for(int i=1;i<=n;i++)cin>>a[i],sa[i]=a[i]+sa[i-1];
    for(int i=1;i<=m;i++)cin>>b[i],sb[i]=b[i]+sb[i-1];
    for(int i=0;i<=n;i++){
        if(sa[i]>k)break;
        ll t=k-sa[i],pos=upper_bound(sb+1,sb+m+1,t)-sb;
        ans=max(ans,i+pos-1);
    }
   	cout<<ans<<endl;
    return 0;
}

Measured memory_bytes: 9856
#include<bits/stdc++.h>
using namespace std;
int main(){
	int n,m;
	cin>>n;
	vector<int> x;
	int temp;
	for(int i=0;i!=n;++i){
		cin>>temp;
		x.push_back(temp);
	}
	int sum=0;
	for(auto &i:x)
		sum+=i;
	cin>>m;
	for(int i=0;i!=m;++i){
		int a,b,c=sum;
		cin>>a>>b;
		c-=x[a-1];
		c+=b;
		cout<<c<<endl;
	}
}


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

#define fi first
#define se second
#define pb push_back
#define int long long
#define all(x) (x).begin(), (x).end()

using LL = long long;
using LD = long double;
using pii = pair<int, int>;
using vii = vector<pii>;

const int INF = 1e18;
const int MOD = 1e9 + 7;
const int N = 1e5 + 5;

int n, k, ans = 1;
vector<int> g[N];
bool vis[N];
//int par[N];
int a[N];

// void dfs(int x, int p) {
// 	par[x] = p;
// 	for (int y: g[x]) {
// 		if (y != p) {
// 			dfs(y, x);
// 		}
// 	}
// }

void dfs1(int x, int p, int pp) {
	int bad = a[p] + (pp != 0);
	ans = (ans * (k - bad)) % MOD;
	a[x]++;

	for (int y: g[x]) {
		if (y != p) {
			dfs1(y, x, p);
			a[x]++;
		}
	}
}

int32_t main() {
    ios::sync_with_stdio(false); cin.tie(nullptr);

	cin >> n >> k;

	for (int i = 1; i < n; i++) {
		int x, y;
		cin >> x >> y;
		g[x].pb(y);
		g[y].pb(x);
	}

	//dfs(1, 0);
	dfs1(1, 0, 0);

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


Measured memory_bytes: 9984
#include<bits/stdc++.h>
#define endl              "\n"
#define fast               ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
using namespace std;
int main()
{
    fast;
    long long   i,j,n,c=0,d=0,e=0,f=0,g=0,h=0,k,r,sum=0;
    cin>>n;
    vector<long long > a(n);
    for(i=0;i<n;i++)
    {
        cin>>a[i];
        g+=a[i];
    }
    e=g/n;
    c=e;
    if(g%n!=0)
    {
        e++;
    }
    for(i=0;i<n;i++)
    {
        f=abs(a[i]-e);
        sum+=(f*f);
    }
    for(i=0;i<n;i++)
    {
        f=abs(a[i]-c);
        d+=(f*f);
    }
    cout<<min(sum,d);
}


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

#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
#define repr(i,n) for(int (i)=(n);(i)>0;(i)--)
#define rrep(i,n,m) for(int (i)=(n);(i)<(m);(i)++)
#define rrepr(i,n,m) for(int (i)=(n);(i)>(m);(i)--)
#define SORT(s) sort((s).begin(),(s).end())
#define SORTR(s,t) sort((s).begin(),(s).end(),greater<t>())

typedef long long ll;
typedef pair<int,int> pii;
typedef vector<int> vi;
typedef vector<ll> vll;
typedef vector<pii> vpii;
typedef vector<vector<int>> vvi;

const double PI = acos(-1.0);
const double EPS = 1e-10;

int L,R; int MOD=2019;
void input()
{
    cin>>L>>R;
    return;
}

void solve()
{
    int ans=MOD;
    if(R-L>=MOD) ans=0;
    else{
        L%=MOD; R%=MOD;
        if(L>=R) R+=MOD;
        for(int i=L;i<R;++i){
            for(int j=i+1;j<=R;++j){
                ans=min(ans,(i*j)%MOD);
            }
        }
    }
    cout<<ans<<endl;
    return;
}

int main()
{
    cin.tie(0);
    ios::sync_with_stdio(false);
    input();
    solve();
    return 0;
}

Measured memory_bytes: 256
import itertools

S = list(input())
N = len(S)
# print('S:',S)

#onとoff
a = ['nashi','+']
Ls = list(itertools.product(a, repeat=N-1))
# print('Ls:',Ls)

out=0
dammy=[]
for L in Ls:
    # print('L,out:',L,out)
    dammy=[]
    for i in range(N):
        # print('dammy:',dammy)
        if i==N-1:
            dammy.append(S[i])
            out+=int(''.join(dammy))
            dammy=[]
        elif L[i] == 'nashi':
            dammy.append(S[i])
        else:
            dammy.append(S[i])
            out+=int(''.join(dammy))
            dammy=[]

print(out)


Measured memory_bytes: 69604
import java.util.*;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int D = sc.nextInt();
		int count=0;
		
		for(int i=0;i<N;i+=D*2+1) {
			count++;
		}
		System.out.println(count);
		sc.close();
	}
}


Measured memory_bytes: 21076
import sys
import itertools
import bisect
import math

stdin = sys.stdin

ni = lambda: int(ns())
na = lambda: list(map(int, stdin.readline().split()))
ns = lambda: stdin.readline().rstrip()  # ignore trailing spaces

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

mod = 10**9+7 #出力の制限
N = 10**6
g1 = [1, 1] # 元テーブル
g2 = [1, 1] #逆元テーブル
inverse = [0, 1] #逆元テーブル計算用テーブル

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


mod = 10 ** 9 + 7
x, y = na()
if (x + y) % 3 != 0:
    print(0)
else:
    n = ((x + y) // 3 + (y - x)) // 2
    m = y - (2 * n)
    if n < 0 or m < 0:
        print(0)
    else:
        print(cmb(n+m, n, mod))




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

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

const int black = 0x01;
const int white = 0x02;

int search(vector<vector<char> >& map, int y, int x, int& whose){
    if(map[y][x]=='A'){
        return 0;
    }
    if(map[y][x]=='B'){
        whose|=black;
        return 0;
    }
    if(map[y][x]=='W'){
        whose|=white;
        return 0;
    }
    map[y][x] = 'A';
    
    int count=1;
    for(int i=0; i<4; i++){
        count += search(map, y+dy[i], x+dx[i], whose);
    }
    return count;
}

int main(){
    while(1){
        int w,h;
        cin >> w >> h;
        if(w==0) break;

        vector<vector<char> > map(h+2, vector<char>(w+2, 'A'));
        for(int i=1; i<=h; i++){
            for(int j=1; j<=w; j++){
                cin >> map[i][j];
            }
        }

        int bcount=0;
        int wcount=0;
        for(int i=1; i<=h; i++){
            for(int j=1; j<=w; j++){
                if(map[i][j]=='.'){
                    int whose=0; // 1:black 2:white 3:both
                    int count=0;
                    count = search(map, i, j, whose);
                    if(whose==1){
                        bcount+=count;
                    }else if(whose==2){
                        wcount+=count;
                    }
                }
            }
        }

        cout << bcount << " " << wcount << endl;
    }
    return 0;
}

Measured memory_bytes: 3152
#include<bits/stdc++.h>
using namespace std;
#define ll long long
#define mod 1000000007

ll i,j,k;

int mypow(int a,int b){
    int num=1;
    while(b!=0){
        num*=a;
        b--;
    }
    return num;
}

int main(){
    int n;cin>>n;
    vector<int> p(n),q(n);
    int num1=0,num2=0;//p<qにするための判定

    for(i=0;i<n;i++){
        cin>>p[i];
        num1+=p[i]*mypow(10,n-1-i);
    }
    for(i=0;i<n;i++){
        cin>>q[i];
        num2+=q[i]*mypow(10,n-1-i);
    }

    if(num1>num2){
        for(i=0;i<n;i++){
            int ins;

            ins=p[i];
            p[i]=q[i];
            q[i]=ins;
        }
    }

    int ans=0;
    do{
        bool end=true;
        for(i=0;i<n;i++){
            if(p[i]!=q[i]){end=false;break;}
        }
        if(end){break;}
        ans++;
    }while(next_permutation(p.begin(),p.end()));

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

Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
typedef pair<int,int>P;
int main(){
  int n;
  P job[200005];
  cin>>n;
  for(int i=0;i<n;i++){
    int times,deadline;
    cin>>times>>deadline;
    job[i]=P(deadline,times);
  }
  
  sort(job,job+n);
  int sum=0;
  bool success=true;
  for(int i=0;i<n&&success;i++){
    sum+=job[i].second;
    if(sum>job[i].first){
      success=false;
    }
  }
  if(success){
    cout<<"Yes"<<endl;
  }else{
    cout<<"No"<<endl;
  }
  return(0);
}


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

int main() {
    string s;
    cin >> s;
    if (s.size() < 4) {
        cout << "NA\n";
    }
    int s1 = stoi(s.substr(0, 2));
    int s2 = stoi(s.substr(2));
    int mask = 0;
    if (s1 >= 1 && s1 <= 12) {
        mask |= 1;
    }
    if (s2 >= 1 && s2 <= 12) {
        mask |= 2;
    }
    if (mask == 3) {
        cout << "AMBIGUOUS\n";
    } else if (mask == 1) {
        cout << "MMYY\n";
    } else if (mask == 2) {
        cout << "YYMM\n";
    } else {
        cout << "NA\n";
    }
    return 0;
}

Measured memory_bytes: 256
#include<stdio.h>
int main()
{
    int a, b;
    scanf("%d %d", &a, &b);
    int max = a + b;
    if (max < a - b)
        max = a - b;
    if (max < b*a)
        max = a * b;
    printf("%d\n", max);
    return 0;
}

Measured memory_bytes: 128
N = int(input())
H_list = list(map(int, input().split()))

H_list.reverse()

flag = True
check_int = H_list[0]

for i in range(1, N):
    if H_list[i] > check_int:
        if check_int != H_list[i] -1:
            flag = False
            break
        else:
            check_int = H_list[i] -1
    else:
        check_int = H_list[i]

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

Measured memory_bytes: 14396
import sys
import collections
import itertools
#def input(): return sys.stdin.readline().strip()
#def INT(): return int(input())
#def MAP(): return map(int, input().split())
#def LIST(): return list(map(int, input().split()))

n,k = map(int, input().split())

A = []
for i in range(k):
    d = input()
    A.append(tuple(map(int, input().split())))

c = list(itertools.chain.from_iterable(A))
ans1 = collections.Counter(c)

print(n-len(ans1))

Measured memory_bytes: 9344
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] o = sc.next().split("");
		String[] e = sc.next().split("");
		for (int i = 0; i < o.length + e.length; i++)
			if (i == 0 || i % 2 == 0)
				System.out.print(o[i / 2]);
			else
				System.out.print(e[i / 2]);
		System.out.println("");
	}
}

Measured memory_bytes: 22100
package main

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

func main() {
	sc := NewScanner()
	a, b, x := sc.NextFloat(), sc.NextFloat(), sc.NextFloat()

	l := float64(0)
	r := math.Pi / 2

	for r-l >= 1e-9 {
		c := (r + l) / 2
		p := a*a*b - a*a*a*math.Tan(c)/2
		k := a*math.Tan(c) - b
		if k > 0 {
			p = b * b / math.Tan(c) * a / 2
		}
		if p >= x {
			l = c
		} else {
			r = c
		}
	}
	fmt.Println(180 * l / math.Pi)

}

type Scanner struct {
	r   *bufio.Reader
	buf []byte
	p   int
}

func NewScanner() *Scanner {
	rdr := bufio.NewReaderSize(os.Stdin, 1000)
	return &Scanner{r: rdr}
}
func (s *Scanner) Next() string {
	s.pre()
	start := s.p
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			break
		}
	}
	result := string(s.buf[start:s.p])
	s.p++
	return result
}
func (s *Scanner) NextLine() string {
	s.pre()
	start := s.p
	s.p = len(s.buf)
	return string(s.buf[start:])
}
func (s *Scanner) NextInt() int {
	v, _ := strconv.Atoi(s.Next())
	return v
}
func (s *Scanner) NextInt64() int64 {
	v, _ := strconv.ParseInt(s.Next(), 10, 64)
	return v
}

func (s *Scanner) NextFloat() float64 {
	v, _ := strconv.ParseFloat(s.Next(), 64)
	return v
}

func (s *Scanner) NextIntArray() []int {
	s.pre()
	start := s.p
	result := []int{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 0)
			result = append(result, int(v))
			start = s.p + 1
		}
	}

	return result
}
func (s *Scanner) NextInt64Array() []int64 {
	s.pre()
	start := s.p
	result := []int64{}
	for ; s.p < len(s.buf)+1; s.p++ {
		if s.p == len(s.buf) || s.buf[s.p] == ' ' {
			v, _ := strconv.ParseInt(string(s.buf[start:s.p]), 10, 64)
			result = append(result, v)
			start = s.p + 1
		}
	}
	return result
}

func (s *Scanner) NextMap() map[int]bool {
	s.pre()
	start := s.p
	mp := map[int]bool{}
	for ; s.p < len(s.buf); s.p++ {
		if s.buf[s.p] == ' ' {
			v, _ := strconv.Atoi(string(s.buf[start:s.p]))
			mp[v] = true
			start = s.p + 1
		}
	}
	v, _ := strconv.Atoi(string(s.buf[start:s.p]))
	mp[v] = true

	return mp
}

func (s *Scanner) pre() {
	if s.p >= len(s.buf) {
		s.readLine()
		s.p = 0
	}
}
func (s *Scanner) readLine() {
	s.buf = make([]byte, 0)
	for {
		l, p, e := s.r.ReadLine()
		if e != nil {
			panic(e)
		}
		s.buf = append(s.buf, l...)
		if !p {
			break
		}
	}
}


Measured memory_bytes: 640
#include <bits/stdc++.h>
#pragma GCC optimize 03
#pragma GCC optimize ("unroll-loops")
#define int long long
#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
using namespace std;
const int N = 3e5 + 2e5;
const int inf = 2e9;
const int MOD = 1e9 + 7;
const int LogN = 30;
vector<int> e[N];
bool use[N];
int mod(int a) {
    a %= MOD;
    return a;
}

void dfs(int u, int& cnt) {
    ++cnt;
    use[u] = 1;
    for (auto v : e[u])
    if (!use[v])
        dfs(v, cnt);
}

void solve() {
    int D, T, S, a, b;
    string s, t;
    int n, k;
    cin >> n >> k;
    for (int i = 0; i < k; ++i) {
        cin >> a >> b;
        e[a].push_back(b);
        e[b].push_back(a);
    }
    int ans = 0;
    for (int i = 1; i <= n; ++i)
    if (!use[i]) {
        int x = 0;
        dfs(i, x);
        ans = max(ans, x);
    }
    cout << ans;
}

signed main() {
    #ifdef local
        freopen("input.txt", "r", stdin);
    #endif
    ios_base::sync_with_stdio(false); cin.tie(0);
    solve();
}


Measured memory_bytes: 31180
#include<iostream>
#include<algorithm>
#include<math.h>
#include<queue>
#include<vector>
#include<climits>
#include<map>
#include<string>
#include<functional>
#include<iomanip>
#include<deque>
#include<random>
#include<set>
#include<bitset>
#include<cassert>

using namespace std;
typedef long long ll;
typedef double lldo;
#define mp make_pair
#define pub push_back
#define rep(i,n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
ll gcd(ll a, ll b) { if (a % b == 0) { return b; } else  return gcd(b, a % b); }
ll lcm(ll a, ll b) { if (a == 0) { return b; }return a / gcd(a, b) * b; }
template<class T>ll LBI(vector<T>& ar, T in) { return lower_bound(ar.begin(), ar.end(), in) - ar.begin(); }
template<class T>ll UBI(vector<T>& ar, T in) { return upper_bound(ar.begin(), ar.end(), in) - ar.begin(); }

ll n, k, p[1005] = {}, ans = 0;

int main() {
	cin >> n >> k;
	rep(i, n)cin >> p[i];
	stable_sort(p, p + n);
	rep(i, k)ans += p[i];
	cout << ans << endl;
	return 0;
}

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

int main(){

    string s;
    cin >> s;

    string t="hi";

    if(s.size()%2!=0){
        cout << "No" << endl;
        return 0;
    }
    rep(i,s.size()/2){
        if(s.substr(i*2,2)!=t){
            cout << "No" << endl;
            return 0;
        }
    }

    cout << "Yes" << endl;

    return 0;
}

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

int solve(int x) 
{
    int s = 0;
    while(x != 0)
    {
        s += (x % 10);
        x /= 10;
    }
    return s;
}  

int main()
{
    ios_base::sync_with_stdio(false); cin.tie(0);
    int n;
    while(cin >> n)
    {
        int ans = 2000000;
        for(int a = 1; a < n; a++)
            ans = min(ans, solve(a) + solve(n-a));
        cout << ans << '\n';
    }
    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define rep(i, m, n) for(int i = m; i < (n); i++)
#define rrep(i,m,n) for(int i = m; i >= n; i--)
#define print(x) cout << (x) << endl;
#define print2(x,y) cout << (x) << " " << (y) << endl;
#define printa(x,n) for(int i = 0; i < n; i++){ cout << (x[i]) << " ";} cout << endl;
#define printa2(x,m,n) for(int i = 0; i < m; i++){ for(int j = 0; j < n; j++){ cout << x[i][j] << " ";} cout << endl;}
#define printp(x,n) for(int i = 0; i < n; i++){ cout << "(" << x[i].first << ", " << x[i].second << ") "; } cout << endl;
#define INF (1e18)
using namespace std;
typedef long long ll;
const ll MOD = 1e9 + 7;
typedef struct{
    ll to;
    ll cost;
} edge;
typedef pair<ll, ll> lpair;
ll dp[110][100010] = {};

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll N,W;
    ll w[110], v[110];
    cin >> N >> W;
    rep(i,0,N) cin >> w[i] >> v[i];
    ll dp[100010] = {};
    rep(i,0,N){
        rrep(j,W, w[i]){
            dp[j] = max(dp[j], dp[j-w[i]] + v[i]);
        }
    }
    print(dp[W]);
    // ll N,W;
    // ll w[110], v[110];
    // cin >> N >> W;
    // rep(i,0,N){
    //     cin >> w[i] >> v[i];
    // }
    // rep(i,0,N){
    //     rep(j,0,W+1){
    //         if(j - w[i] >= 0){
    //             dp[i+1][j] = max(dp[i][j], dp[i][j - w[i]] + v[i]);
    //         }else{
    //             dp[i+1][j] = dp[i][j];
    //         }
    //     }
    // }
    // print(dp[N][W]);
}


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

int main(void) {
    string s;
    cin >> s;

    vector<string> word_set{"dream", "dreamer", "erase", "eraser"};
    reverse (s.begin(), s.end());
    for (int i = 0; i < 4; i++) {
        reverse (word_set.at(i).begin(), word_set.at(i).end());
    }
    int count = 0, i = 0;
    while (i < s.size()) {
        bool not_hit = true;
        for (int j = 0; j < 4; j++) {
            if (word_set.at(j) == s.substr(i, word_set.at(j).size())) {
                i += word_set.at(j).size();
                not_hit = false;
            }
        }
        if (not_hit) {
            break;
        }
    }
    if (i == s.size()) {
        cout << "YES" << endl;
    } else {
        cout << "NO" << endl;
    }
}

Measured memory_bytes: 512
a, b = list(map(int, input().split()))
x = [1, 3, 5, 7, 8, 10, 12]
y = [4, 6, 9, 11]
if a in x and b in x:
  print('Yes')
elif a in y and b in y:
  print('Yes')
elif a == 2 and b == 2:
  print('Yes')
else:
  print('No')

Measured memory_bytes: 9096
# coding=utf-8

if __name__ == '__main__':
    N, K = map(int, input().split())

    sunuke = [0] * N
    #print(sunuke)

    for i in range(K):
        D = int(input())
        li = list(map(int, input().split()))

        for j in range(D):
            sunuke[li[j] - 1] += 1
            #print(sunuke)

    print(sunuke.count(0))


Measured memory_bytes: 68016
#include <bits/stdc++.h>
using namespace std;typedef long long ll;typedef string str;
typedef vector<str> vst;
typedef vector<ll> vll;
// ll gcd(ll a, ll b){if (b==0){return a;}return gcd(b, a%b);}
// for (ll i=0;i<n;i++) {
// sort(.begin(),.end());
int main(){
  ll n,ans=1;
  cin>>n;
  vst s(n);
  vector<vll> c(n,vector<ll>(26,0));
  for (ll i=0;i<n;i++) {
    cin>>s[i];
    for (ll j=0;j<s[i].size();j++) {
      c[i][s[i][j]-'a']++;
    }
    if (i==0) continue;
    for (ll j=0;j<26;j++) {
      if (c[i][j]>=c[i-1][j]) {
        c[i][j]=c[i-1][j];
      }
    }
  }
  
  for (ll i=0;i<26;i++) {
    for (ll j=0;j<c[n-1][i];j++) {
      cout<<char(i+97);
    }
  }
  cout<<endl;
}

Measured memory_bytes: 256
# -*- coding: utf-8 -*-

def resolve(T,v):
    lv = v
    while lv != T[lv]:
        lv = T[lv]
    T[v] = lv
    return lv

def solve():
    N, M = map(int, input().split())
    T = list(range(N+1))
    for i in range(M):
        u, v = map(int, input().split())
        lu = resolve(T,u)
        lv = resolve(T,v)
        if lv == lu:
            continue
        T[lv] = lu
        #print(f'===round{i}===')
        #print(T)
        #print([resolve(T,v) for v in range(N+1)])
    return len(set(resolve(T,v) for v in range(1,N+1)))-1

if __name__ == '__main__':
    print(solve())



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

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

    string s;
    cin >> s;
    int len = s.size();
    for(int i = 0; i < len; i++) {
        cout << "x";
    }
    return 0;
}


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

int N;
int M;

int res;

int main ()
{
    cin >> N >> M;
    
    if(N > 1) res += N * (N - 1) / 2;
    if(M > 1) res += M * (M - 1) / 2;

    cout << res << endl;    

}

Measured memory_bytes: 256
#include <iostream>
#include <numeric>
#include <iomanip>
#include <string> // string, to_string, stoi
#include <vector> // vector
#include <algorithm> // min, max, swap, sort, reverse, lower_bound, upper_bound
#include <utility> // pair, make_pair
#include <tuple> // tuple, make_tuple
#include <cstdint> // int64_t, int*_t
#include <cstdio> // printf
#include <map> // map
#include <queue> // queue, priority_queue
#include <set> // set
#include <stack> // stack
#include <deque> // deque
#include <unordered_map> // unordered_map
#include <unordered_set> // unordered_set
#include <bitset> // bitset
#include <cctype> // isupper, islower, isdigit, toupper, tolower
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)




int main() {

		int A,B;
		cin>>A>>B;
		cout <<(2*B)-A << endl;
	
}

Measured memory_bytes: 256
import math


def combination(n, r):
    return math.factorial(n) // math.factorial(r) // math.factorial(n-r)


reducer = 10**9 + 7
num_total, num_blue = map(int, input().split(' '))

num_red = num_total - num_blue
max_trial = min(num_blue, num_total - num_blue + 1)

for num_trial in range(1, max_trial+1):
    free_blue = num_blue - num_trial
    free_red = num_red - (num_trial - 1)

    blue_pot = num_trial
    red_pot = num_trial + 1

    pattern_red = combination(free_red + red_pot - 1, free_red)
    pattern_blue = combination(free_blue + blue_pot - 1, free_blue)

    print((pattern_red * pattern_blue) % reducer)

for _ in range(max_trial, num_blue):
    print("0")


Measured memory_bytes: 3316
#include <bits/stdc++.h>
#define rep(i,n) for(int i=0;i<(int)n;i++)
#define rep1(i,n) for(int i=1;i<=(int)n;i++)
#define rep2(i,j,n) for(int j=i;j<n;j++)
#define rep3(i,j,n) for(int j=i;j<=n;j++)
#define rrep(i,n) for(int i=n-1;i>=0;i--)
#define sp(n) cout << fixed << setprecision(n)
typedef long long ll;
using namespace std;
int main(void){
    // Your code here!
    int h,w;cin>>h>>w;
    char t[h][w];
    rep(i,h)rep(j,w) cin>>t[i][j];
    vector<vector<int>> s(h,vector<int>(w,100000));
    s[0][0]=(t[0][0]=='.')? 0 : 1;
    int roty[2]={0,1},rotx[2]={1,0};
    rep(i,h)rep(j,w)rep(k,2){
            int ny=i+roty[k],nx=j+rotx[k];
            if(nx<0||w<=nx||ny<0||h<=ny)continue;
            int now=s[i][j];
            int nw=(t[ny][nx]=='#')? (t[i][j]!='#')? now+1 : now : now;
            s[ny][nx]=min(nw,s[ny][nx]);
    }
    
    cout<<s[h-1][w-1]<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define IFOR(i, begin, end) for(int i=(end)-1;i>=(begin);i--)
#define IREP(i, n) IFOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define REVERSE(a) reverse(a.begin(), a.end())
#define Lower_bound(v, x) distance(v.begin(), lower_bound(v.begin(), v.end(), x))
#define Upper_bound(v, x) distance(v.begin(), upper_bound(v.begin(), v.end(), x))
#define int long long
#define INF 1000000000000000000
using namespace std;

#define ANS(f) if(f) cout << "YES" << endl; else cout << "NO" << endl;

typedef vector<int> vec;
typedef vector<vec> mat;
typedef pair<int, int> Pii;

template<typename T>
void readv(vector<T> &a){ REP(i, a.size()) cin >> a[i]; }
void readi(vector<int> &a){ REP(i, a.size()){cin >> a[i]; a[i]--;} }
void debug(mat m){REP(i, m.size()){ REP(j, m[i].size()){ cout << m[i][j] << ","; } cout << endl; }}

int modpow(int x, int n, int m){
    int a = 1;
    IREP(i, 64){
        a = (a * a) % m;
        if(((n >> i) & 1) == 1) a = (a * x) % m;
    }
    return a;
}

class Combination
{
public:

    vec fact, invfact;
    int MAX_N, mod;

    Combination(int MAX_N, int mod): MAX_N(MAX_N), mod(mod) {
        initialize();
    }

    void initialize(){
        fact = vec(MAX_N + 1);
        invfact = vec(MAX_N + 1);
        fact[0] = 1;
        FOR(i, 1, MAX_N + 1){
            fact[i] = (fact[i - 1] * i) % mod;
        }
        invfact[MAX_N] = modpow(fact[MAX_N], mod - 2, mod);
        IREP(i, MAX_N){
            invfact[i] = (invfact[i + 1] * (i + 1)) % mod;
        }
    }

    int nCr(int n, int r){
        if(r > n || r < 0 || n < 0) return 0;
        if(n > MAX_N){
            MAX_N = n;
            initialize();
        }
        int a = fact[n];
        a = (a * invfact[r]) % mod;
        a = (a * invfact[n - r]) % mod;
        return a;
    }
};

signed main(){

    int K, N; cin >> K >> N;
    int mod = 998244353;
    Combination comb(N + K, mod);

    FOR(i, 2, 2 * K + 1){
        if(i % 2 == 1){
            int p = min(i, 2 * K + 2 - i) / 2;
            int ans = 0;
            REP(j, p + 1){
                int k = K - 2 * p + j;
                int n = N - j;
                ans += ((comb.nCr(n + k - 1, n) * modpow(2, j, mod)) % mod) * comb.nCr(p, j);
                ans %= mod;
            }
            cout << ans << endl;
        }else{
            int p = min(i, 2 * K + 2 - i) / 2 - 1;
            int ans = 0;
            REP(j, p + 1){
                int k = K - 1 - 2 * p + j;
                int n = N - j;
                ans += ((comb.nCr(n + k - 1, n) * modpow(2, j, mod)) % mod) * comb.nCr(p, j);
                ans %= mod;
                n = N - j - 1;
                ans += ((comb.nCr(n + k - 1, n) * modpow(2, j, mod)) % mod) * comb.nCr(p, j);
                ans %= mod;
            }
            cout << ans << endl;
        }
    }

    
    return 0;
}

Measured memory_bytes: 384
#include <bits/stdc++.h>
using namespace std;
 
int main() {
  long long n,a;
  long long ans=0;
  cin >> n;
  if(n%2==1){
    cout << 0 << endl;
  }
  else{
    n /= 10;
    ans +=n;
    while(n){
      n /= 5;
      ans += n;
    }
    cout << ans <<endl;
  }
}
  

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

int main (){
  int a,b=8;
  cin >> a;
  if (a>=600) b=7;
  if (a>=800) b=6;
  if (a>=1000) b=5;
  if (a>=1200) b=4;
  if (a>=1400) b=3;
  if (a>=1600) b=2;
  if (a>=1800) b=1;
  cout << b;
}

Measured memory_bytes: 3196
import java.util.Scanner;
public class Main {
			  public static void main(String[]args){
			    Scanner sc = new Scanner(System.in);
			    int a = sc.nextInt();
			    int b = sc.nextInt();
			    try{
		              if(a < b){
                                System.out.println("a < b");
                             } else if(a == b){
                                 System.out.println("a == b");
                             } else{
                               System.out.println("a > b");
                             }
			    }catch(Exception e){
			     }
			  }
			}



Measured memory_bytes: 26204
#include<bits/stdc++.h>
const int N=1e6+10;
using namespace std;

inline int read(){
	char ch=getchar();int x=0,f=1;
	while(ch<'0'||ch>'9'){if(ch=='-')f=-1;ch=getchar();}
	while(ch>='0'&&ch<='9'){x=x*10+ch-'0';ch=getchar();}
	return x*f;
} 

struct node{
	int v,nxt,w;
}e[N<<1];
int head[N],cnt;
int dis[N],n,m,INF;
bool used[N],vis[N];

void add(int u,int v,int w){
	e[++cnt].v=v;
	e[cnt].w=w;
	e[cnt].nxt=head[u];
	head[u]=cnt;
}

bool spfa(int s){
	queue<int> q;
	q.push(s);
	vis[s]=true;
	dis[s]=0;
	while(!q.empty()){
		int u=q.front();
		q.pop();vis[u]=false;
		for(int i=head[u];i;i=e[i].nxt){
			int v=e[i].v,w=e[i].w;
			if(dis[v]==INF){
				dis[v]=dis[u]+w;
				used[v]=true;
				if(!vis[v])vis[v]=true,q.push(v);
			}
			else if(dis[v]!=dis[u]+w)return false;
		}
	}
	return true;
}

int main(){
	memset(dis,0x3f,sizeof(dis));
	INF=dis[1];
	n=read(),m=read();
	for(int i=1;i<=m;i++){
		int x=read(),y=read(),z=read();
		add(x,y,z);add(y,x,-z);
	}
	for(int i=1;i<=n;i++){
		if(!used[i]){
			used[i]=true;
			if(!spfa(i)){
				printf("No");
				return 0;
			}
		}
	}
	printf("Yes");
	return 0;
}



Measured memory_bytes: 15232