akhauriyash/Code-Regression huggingface dataset:
#include<iostream>
#include<cstdio>
#include<algorithm>
#include<cstring>
#include<queue>
#include<vector>
#define LL long long
#define inf 7999999996000000001LL
using namespace std;
const int maxn=505;
struct point
{
	int id;
	LL x,y;
	friend bool operator <(point a,point b)
	{
		return a.x<b.x;
	}
}bb[maxn],cc[maxn];
bool cmp(point a,point b)
{
	return a.y<b.y;
}
int n,m;
void initial()
{
	cin>>n>>m;
	for(int i=1;i<=n;i++)
	cin>>bb[i].x>>bb[i].y;
}
LL MAX(LL a,LL b)
{
	return a>b?a:b;
}
LL MAX(LL a,LL b,LL c,LL d)
{
	return MAX(MAX(a,b),MAX(c,d));
}
LL MIN(LL a,LL b)
{
	return a<b?a:b;
}
LL MIN(LL a,LL b,LL c,LL d)
{
	return MIN(MIN(a,b),MIN(c,d));
}
bool check(LL a,LL b,LL c)
{
	if(a<=b&&b<=c) return 1;
	return 0;
}
void work()
{
	LL x1,y1,x2,y2,ans=inf;
	for(int a=1;a<=n;a++)
	for(int b=1;b<=n&&b!=a;b++)
	for(int c=1;c<=n;c++)
	for(int d=1;d<=n&&d!=c;d++)
	{
		x1=MIN(bb[a].x,bb[b].x);
		x2=MAX(bb[a].x,bb[b].x);
	//	if(!check(x1,bb[c].x,x2)) continue;
	//	if(!check(x1,bb[d].x,x2)) continue;
		y1=MIN(bb[c].y,bb[d].y);
		y2=MAX(bb[c].y,bb[d].y);
		int tot=0;
		for(int i=1;i<=n;i++)
		{
			int X=bb[i].x,Y=bb[i].y;
			if(check(x1,X,x2)&&check(y1,Y,y2)) tot++;
		}
		if(tot>=m)
		{
			LL ans1=(x2-x1)*(y2-y1);
			ans=MIN(ans,ans1);
		}
	}
	cout<<ans;
}
int main()
{
	//freopen("1.txt","r",stdin);
	initial();
	work();
	return 0;
} 

Measured memory_bytes: 384
#include<iostream>
#include<set>
#include<vector>
#include<algorithm>
using namespace std;

int main(){
	string s; cin >> s;
	int k; cin >> k;
	set<string> st;
	for(int i=0;i<s.size();i++){
		for(int j=1;j<=k;j++){
			st.insert(s.substr(i,j));
		}
	}
	vector<string> v(st.begin(),st.end());
	cout << v[k-1] << endl;
}


Measured memory_bytes: 1792
implicit none
integer:: a,b,c,x,i,j,k,count

read(*,*) a,b,c,x

count=0
do i=0,a
do j=0,b
do k=0,c
if(x==500*i+100*j+50*k)then
count=count+1
endif
end do
end do
end do

write(*,*) count
end

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

using namespace std;
using namespace __gnu_pbds;

namespace std {
	#define u(x, a, b) for(ll x = a; x < b; x++)
	#define d(x, a, b) for(ll x = a; x > b; x--)
}

typedef long long ll;
typedef long double ld;

#define MAXI 100010
#define MOD 1000000007

int main(){
	char c;
	cin >> c;
	
	if((int)c < 97){cout << "A";}
	else{cout << 'a';}
}


Measured memory_bytes: 3628
from sys import stdin,stdout
I = lambda : map(int,stdin.readline().split())
import math

n = input()
a = I()
x = 0
m = 0
for i in range(1,n):
	if a[i] <= a[i-1]:
		x+=1
	else:
		x = 0
	m = max(x,m)
print m

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



using namespace std;



int main(){

  int a, b;



  cin >> a >> b;



  if((0 < a) && (a < 10) && (0 < b) && (b < 10)){

    cout << a * b << endl;



  } else {

    cout << -1 << endl;

  }

  return 0;

}



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

using namespace std;
#define all(a)a.begin(),a.end()
using ll=long long;
const int INF = 1<<30;
const ll INFll =1LL<<62;
const int mod =(1e9)+7;
using P = pair<ll,ll>;

int main(){
    ll n;cin >>n;
    ll ans=n/2;
    if(n%2==0)ans--;
    cout <<ans<<endl;
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
//#include <boost/multiprecision/cpp_int.hpp>
//namespace mp = boost::multiprecision;

using namespace std;

const double PI = 3.14159265358979323846;
typedef long long ll;
const double EPS = 1e-9;
#define rep(i, n) for (int i = 0; i < (n); ++i)
//#define rep(i, n) for (ll i = 0; i < (n); ++i)
typedef pair<ll, ll> P;
const ll INF = 10e17;
#define cmin(x, y) x = min(x, y)
#define cmax(x, y) x = max(x, y)
#define ret() return 0;

double equal(double a, double b) {
    return fabs(a - b) < DBL_EPSILON;
}

std::istream &operator>>(std::istream &in, set<int> &o) {
    int a;
    in >> a;
    o.insert(a);
    return in;
}

std::istream &operator>>(std::istream &in, queue<int> &o) {
    ll a;
    in >> a;
    o.push(a);
    return in;
}

bool contain(set<int> &s, int a) { return s.find(a) != s.end(); }

//ofstream outfile("log.txt");
//outfile << setw(6) << setfill('0') << prefecture << setw(6) << setfill('0') << rank << endl;
// std::cout << std::bitset<8>(9);
//const ll mod = 1e10;

typedef priority_queue<ll, vector<ll>, greater<ll> > PQ_ASK;

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

    cout << ((n + 999) / 1000 * 1000) - n << endl;

}


Measured memory_bytes: 3640
#include <algorithm>
#include <bitset>
#include <cassert>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <deque>
#include <functional>
#include <iostream>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <vector>
#define Rep(i, n) for(int i=0;i<n;++i)
#define rep(i, n) for(int i=1;i<=n;++i)
#define ll long long int
#define INF 1e9
#define LINF 1e18
#define MOD 1000000007
#define PI 3.14159265359
#define All(a) (a).begin(), (a).end()

using namespace std;
using P = pair<ll, ll>;
 
int dx[4] = {0, 1, 0, -1};
int dy[4] = {1, 0, -1, 0};

/**
 * Usage:
 * 
 * G[from].push_back(Edge(to, weight));
 * using Graph = vector<vector<Edge>>;
 * 
 */ 
struct Edge {
  int to;     
  ll weight; 
  Edge(int t, ll w) : to(t), weight(w) { }
};

template<typename T>
void printv(vector<T>& v) {
  if (v.size() == 0) {
    cout << "\n";
    return;
  }

  Rep(i, v.size()) {
    cout << v[i] << ((i + 1 < v.size()) ? ' ' : '\n');
  }
}



int N;
ll B, A;
vector<ll> d;
ll a[110000];

bool isOK(ll mid) {
  Rep(i, N) {
    a[i] = ((d[i] - mid * B) >= 0) ? (d[i] - mid * B) : 0;
  }

  ll tmp = 0LL;

  Rep(i, N) {
    //cout << tmp << "\n";
    tmp += ((a[i] % (A - B) == 0) ? (a[i] / (A - B)) : (a[i] / (A - B) + 1));
  }

  //cout << mid << "\n";
  //cout << tmp << "\n";

  return (tmp <= mid);
}


ll bs(ll st_min, ll st_max) {
  ll left = st_min;
  ll right = st_max;

  while (right - left > 1) {
    //cout << left << " " << right << "\n";

    ll mid = left + (right - left) / 2;

    if (isOK(mid)) right = mid;
    else left = mid;
  }

  return right;
}

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

  rep(i, N) {
    ll tmp;
    cin >> tmp;
    d.push_back(tmp);
  }

  sort(All(d));

  ll st_max = (d[N-1] % B == 0) ? (d[N-1] / B) : (d[N-1] / B + 1);

  cout << bs(0, st_max + 1) << "\n";

}

Measured memory_bytes: 1908
#include<iostream>

using namespace std;
int main()
{
    string s;
    cin>>s;
    if(s== "Sunny" )
        cout<< "Cloudy"<<endl;
    else if(s== "Cloudy" )
        cout<< "Rainy"<<endl;
    else if(s== "Rainy" )
        cout<< "Sunny"<<endl;
    else
        cout<<"enter weather prediction"<<endl;


        return 0;
}

Measured memory_bytes: 256
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Atcoder
{
    class Atcoderrrrrrr
    {
        static void Main(string[] args)
        {
            int N = int.Parse(Console.ReadLine());

            Console.WriteLine(
                (N*800)-(N/15)*200
            );
        }
    }
}


Measured memory_bytes: 11092
#include <iostream>
#include <complex>
#include <vector>
#include <string>
#include <algorithm>
#include <cstdio>
#include <numeric>
#include <cstring>
#include <ctime>
#include <cstdlib>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <list>
#include <cmath>
#include <bitset>
#include <cassert>
#include <queue>
#include <stack>
#include <deque>
#include <random>
typedef long long int ll;
typedef long double ld;
#define rep(i,n) for(int i=0;i<n;i++)
using namespace std;
const ll MOD=1000000007;
const ll MAX_N=500010;
const ll INF=999999999999;
set<int> alph[26];

int main(){
    int n,q,cnt=0;
    cin>>n;
    string s;
    cin>>s;
    cin>>q;
    for(int i=0;i<26;i++){
        alph[i].clear();
        alph[i].insert(n);
    }
    for(int i=0;i<n;i++){
        alph[(int)(s[i]-'a')].insert(i);
    }
    vector<ll> ans(0);
    for(int i=0;i<q;i++){
        int onetwo;
        cin>>onetwo;
        if(onetwo==1){
            int i; char c;
            cin>>i>>c;
            i--;
            for(int j=0;j<26;j++) alph[j].erase(i);
            alph[(int)(c-'a')].insert(i);
        }else if(onetwo==2){
            int l,r;
            cin>>l>>r;
            l--; r--;
            for(int j=0;j<26;j++){
                auto tmp=alph[j].lower_bound(l);
                //cout<<"j="<<j<<":"<<*tmp<<"  ";
                if(*tmp<=r) cnt++;
            }
            //cout<<endl;
            ans.push_back(cnt);
            cnt=0;
        }
    }
    for(auto u:ans) cout<<u<<endl;
    return 0;
}

Measured memory_bytes: 24708
<?php
//----------------------------
//syudousa
//---------------------------
$n = trim(fgets(STDIN));
$trump_card = card_set();
for($i = 0; $i< $n; $i++){
  list($suit, $rank) = input_explode();
  $trump_card[$suit][$rank] = "check";
}
foreach ($trump_card as $key => $value) {
  for($j = 1; $j <= 13; $j++){
    if(!isset($trump_card[$key][$j])){
      echo $key.' '.$j.PHP_EOL;
    }
  }
}

//-----------------------------
//kansuu
//-----------------------------
function input_explode(){
  return explode(" ", trim(fgets(STDIN)));
}

function card_set(){
  return array(
    'S' => array_fill(1,13,null),
    'H' => array_fill(1,13,null),
    'C' => array_fill(1,13,null),
    'D' => array_fill(1,13,null)
  );  
}

Measured memory_bytes: 15328
#include <algorithm>
#include <cassert>
#include <chrono>
#include <cmath>
#include <complex>
#include <cstdlib>
#include <deque>
#include <iomanip>
#include <iostream>
#include <iterator>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <random>
#include <set>
#include <stack>
#include <string>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace std;
typedef long long ll;
int main() {
  ios::sync_with_stdio(false);
  cin.tie(NULL);
  int n;
  cin >> n;
  vector<ll> v(n);
  for (auto &x : v)
    cin >> x;
  vector<ll> ans(n);
  ans[0] = v[0];
  for (int i = 0; i < n / 2; i++) {
    ans[0] = ans[0] ^ v[i] ^ v[i + n / 2];
  }
  for (int i = 1; i < n; i++) {
    ans[i] = v[i] ^ v[i - 1] ^ ans[i - 1];
  }
  ll tx = 0;
  for (auto x : ans) {
    tx ^= x;
  }
  for (int i = 0; i < n; i++) {
    ll x = ans[i];
    assert((tx ^ x) == v[i]);
    cout << x << " ";
  }
  cout << "\n";
}

Measured memory_bytes: 6324
#include <iostream>
using namespace std;
int a,b,c;
int main() {
 cin>>a>>b>>c;
 if(a==b && c!=b) {cout<<"Yes";return 0;}
 if(b==c && a!=c) {cout<<"Yes";return 0; }
if(a==c && b!=c){cout<<"Yes"; return 0; }
cout<<"No";
 return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#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 SORTR(v,n) sort(v, v+n, greater<int>());
#define SORTPairSecond(v, n) sort(v, v+n, pairCompareSecond);
#define int long long    // %d=>%lld, 1<<n  => 1LL<<n
#define pb push_back

using namespace std;
typedef long long ll;

typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<int, pii> piii;
typedef pair<ll, pll> plll;
bool pairCompareSecond(const pii& firstEl, const pii& secondEl) {
    return firstEl.second > secondEl.second;
}

const ll MOD = 1000000007;
const int INF = 1000000007;
// const int INF = 0x3f3f3f3f;
const ll LLINF = 0x3f3f3f3f3f3f3f3f;
// const ll LLINF = 1LL << 50;
const double PI = acos(-1);
const double EPS = 0.000000001;


const int MAX_n = 100000;
int n, a[MAX_n];



signed main(){

    cin >> n;
    priority_queue<int> que;
    for(int i = 0;i < n;i++){
        cin >> a[i];
        que.push(a[i]);
    }

    int edge[2];
    edge[0] = LLINF;
    edge[1] = LLINF;
    int before;

    while(1){
        before = que.top();que.pop();
        if(before == edge[0]){
            break;
        }
        edge[0] = before;
        if(que.empty()){
            edge[0] = 0;
            break;
        }
    }
    while(!que.empty()){
        before = que.top();que.pop();
        if(before == edge[1]){
            break;
        }
        edge[1] = before;
        if(que.empty()){
            edge[1] = 0;
            break;
        }
    }

    cout<< edge[0]*edge[1]<< endl;

    return 0;
}

Measured memory_bytes: 1912
#include<cstdio>
#include<iostream>
#include<cstring>
#define RG register
using namespace std;
const int N=2e3+10;
struct dabt{
	int next,to;
}e[N<<1],pt[N];
int n,m,k,head[N],st,dis[N][N],ans=2e9,minn;
inline void add(int from,int to){e[++k]=(dabt){head[from],to}; head[from]=k;}
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;}
inline int mi(int a,int b){return a<b ? a : b;}
void dfs(int lst,int x,int dep)
{
	for(int i=head[x];i;i=e[i].next)
	{
		int v=e[i].to;
		if(v==lst) continue;
		dis[v][st]=dis[st][v]=dep;
		dfs(x,v,dep+1);
	}
}
int main()
{
	//freopen("Shorten Diameter.in","r",stdin);
	//freopen(".out","w",stdout);       
	n=read(); m=read();
	for(int i=1,a,b;i<n;i++)
	{
		a=read(); b=read();
		add(a,b); add(b,a);
		pt[i]=(dabt){a,b};
	}
	for(int i=1;i<=n;i++) 
	{
		st=i;
		dfs(0,i,1);
	}
	if(m%2==0)
	{
		m/=2;
		for(int i=1;i<=n;i++)
		{
			minn=0;
			for(int j=1;j<=n;j++)
			 if(i!=j && dis[i][j]>m) minn++;
			ans=mi(ans,minn);
		}
	}
	else
	{
		m/=2;
		for(int i=1;i<n;i++)
		{
			int a=pt[i].next, b=pt[i].to; minn=0;
			for(int j=1;j<=n;j++)
			 if(dis[a][j]>m && dis[b][j]>m) minn++;
			ans=mi(ans,minn);
		}
	}
	printf("%d\n",ans);
	//fclose(stdin); fclose(stdout);
	return 0;
}


Measured memory_bytes: 16128
s = int(input())
series = [s]
while True:
    if (series[-1] == 4) or (series[-1] == 2) or (series[-1] == 1):
        break
    elif (series[-1]%2)==0:
        series.append(series[-1]//2)
    else:
        series.append(3*series[-1]+1)        
print(len(series)+3)

Measured memory_bytes: 3060
#include<algorithm>
#include<iostream>
#include<cstring>
#include<iomanip>
#include<sstream>
#include<cstdio>
#include<string>
#include<vector>
#include<bitset>
#include<queue>
#include<cmath>
#include<stack>
#include<set>
#include<map>
#define rep(i,x,n) for(int i=x;i<=n;i++)
#define per(i,n,x) for(int i=n;i>=x;i--)
#define sz(a) int(a.size())
#define rson mid+1,r,p<<1|1
#define pii pair<int,int>
#define lson l,mid,p<<1
#define ll long long
#define pb push_back
#define mp make_pair
#define se second
#define fi first
using namespace std;
const double eps=1e-8;
const int mod=1e9+7;
const int N=1e5+10;
const int inf=1e9;
int A,B,C,D;
int main(){
	//ios::sync_with_stdio(false);
	//freopen("in","r",stdin);
	cin>>A>>B>>C>>D;
	if((A+D-1)/D*B>=C) puts("Yes");
	else puts("No");
	return 0;
}

Measured memory_bytes: 3612
import java.util.HashMap;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		try (Scanner sc = new Scanner(System.in)) {
			long n = sc.nextLong();
			int result = 0;
			Map<Integer, Map<Integer, Integer>> map = new HashMap<>();
			for (int i = 1; i <= n; i++) {
				String ist = String.valueOf(i);
				int first = Integer.parseInt(ist.substring(0, 1));
				int last = Integer.parseInt(ist.substring(ist.length() - 1, ist.length()));
				Map<Integer, Integer> innerMap = map.get(first);
				if (innerMap == null) {
					innerMap = new HashMap<>();
					map.put(first, innerMap);
				}
				if (innerMap.get(last) == null) {
					innerMap.put(last, 0);
				}
				innerMap.put(last, innerMap.get(last) + 1);
			}
			for (Entry<Integer, Map<Integer, Integer>> entry : map.entrySet()) {
				for (Entry<Integer, Integer> innerEntry : entry.getValue().entrySet()) {
					if (map.get(innerEntry.getKey()) != null) {
						Integer wkValue = map.get(innerEntry.getKey()).get(entry.getKey());
						if (wkValue != null) {
							result = result + (innerEntry.getValue() * wkValue);
						}
					}
				}
			}
			System.out.println(result);
		}
	}
}

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

// infty
#define ULLINF (ULLONG_MAX)
#define LLINF  (LLONG_MAX)
#define IINF   (INT_MAX)
#define INF    (1<<29)

// math
#define Sq(x) ((x)*(x))

// container utility
#define ALL(x) (x).begin(), (x).end()
#define MP make_pair
#define PB push_back
#define EACH(it,c) for(__typeof((c).begin())it=(c).begin();it!=(c).end();it++)

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

// typedef
typedef pair<int, int> PII;
typedef vector<int> VI;
typedef vector<PII> VII;
typedef vector<VI> VVI;

typedef long long ll;

// pair util
#define FST first
#define SND second

// range validator
#define CK(n,a,b) (a<=n && n<b)

// conversion
template<class T> inline string toStr(T a) { ostringstream oss_; oss_ << a; return oss_.str(); }
inline int toInt(string s) { return atoi(s.c_str()); }

// prime
int isp[10000000];
bool isPrime(int a) {
  if(a == 1) return isp[a] = 0;
  
  if(isp[a]>=0) return isp[a];
  for(int i=2; i*i <=a; i++)
    if(a%i == 0) return isp[a] = 0;
  
  return isp[a] = 1;
}

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

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

int main() {
  
  memset(isp, -1, sizeof(isp));
  
  int n;
  while(cin >> n && n) {
    int ans = -INF;
    for(int i=5; i<=n; i++) {
      if(isPrime(i-2) && isPrime(i)) {
	ans = max(ans, i);
      }
    }
    cout << ans-2 << ' ' << ans << endl;
  }
  
  return 0;
}

Measured memory_bytes: 40228
$n = 0
$heap = []

def maxHeapify x
  l = 2*x
  r = 2*x+1
  if l <= $n && $heap[l] > $heap[x]
    largest = l
  else
    largest = x
  end
  if r <= $n && $heap[r] > $heap[largest]
    largest = r
  end
  if largest != x
    $heap[x], $heap[largest] = $heap[largest], $heap[x]
    maxHeapify(largest)
  end
end

def extract
  key = $heap[1]
  $heap[1] = $heap[$n]
  $n -= 1
  maxHeapify(1)
  key
end

def insert key
  $n += 1
  $heap[$n] = key
  i = $n
  while i > 1 && $heap[i/2] < $heap[i]
    $heap[i], $heap[i/2] = $heap[i/2], $heap[i]
    i /= 2
  end
end

while l = gets
  break if l.chomp == "end"
  if l.chomp == "extract" then puts extract
  else insert(l.split[1].to_i)
  end
end

Measured memory_bytes: 16692
#include <iostream>

using namespace std;

int main()
{
    int s[13],h[13],c[13],d[13];
    int n;
    char ch;
    int rank;

    for (int i=0;i<13;i++){
        s[i]=h[i]=c[i]=d[i]=0;
    }

    cin >> n;
    for(int i=0;i<n;i++){
        cin >>ch >>rank;
        switch(ch){
            case 'S':
                s[rank-1]=1;
                break;
            case 'H':
                h[rank-1]=1;
                break;
            case 'C':
                c[rank-1]=1;
                break;
            case 'D':
                d[rank-1]=1;
                break;
        }

    }

    for(int i=0;i<13;i++){
        if (s[i]==0){
            cout << 'S' <<' '<<i+1 <<endl;
        }
    }

    for(int i=0;i<13;i++){
        if (h[i]==0){
            cout << 'H' <<' '<<i+1 <<endl;
        }
    }

    for(int i=0;i<13;i++){
        if (c[i]==0){
            cout << 'C' <<' '<<i+1 <<endl;
        }
    }

    for(int i=0;i<13;i++){
        if (d[i]==0){
            cout << 'D' <<' '<<i+1 <<endl;
        }
    }

    //cout << endl;
    return 0;
}



Measured memory_bytes: 3116
import java.io.OutputStream;
import java.io.IOException;
import java.io.InputStream;
import java.io.PrintWriter;
import java.util.Scanner;

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

    static class Task {
        public void solve(int testNumber, Scanner in, PrintWriter out) {
            StringBuilder sb = new StringBuilder();
            int n = in.nextInt();
            String s = in.next();
            String t = s.substring(0, n / 2);
            t = t + t;
            out.println(t.equals(s) ? "Yes" : "No");

        }

    }
}



Measured memory_bytes: 23764
#include <bits/stdc++.h>
using namespace std;
#define mp       make_pair
#define pb       push_back
#define all(x)   (x).begin(),(x).end()
#define YES() printf("YES\n")
#define NO() printf("NO\n")
#define Yes() printf("Yes\n")
#define No() printf("No\n")
#define in(x,y,h,w) x >= 0 && x < h && y >= 0 && y < w

#define int long long
//typedef    long long          ll;
typedef    vector<bool>       vb;
typedef    vector<int>        vi;
typedef    vector<vb>         vvb;
typedef    vector<vi>         vvi;
typedef    pair<int,int>      P;

template <typename T> T &chmin(T &a, const T &b) { return a = min(a, b); }
template <typename T> T &chmax(T &a, const T &b) { return a = max(a, b); }
 
const int INF=1e+18;
const double EPS=1e-9;
const int MOD=1000000007;

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

vector<int> G[5010];
int dp[5010][5010][2],vs[5010],num[5010],nxt[5010][2];

void dfs(int v,int par){
	dp[v][1][0] = 1;
	vs[v] = 1;
	for(int to : G[v]){
		if(par != to){
			dfs(to,v);
			for(int j = 0;j <= vs[v] + vs[to];j++){
				nxt[j][0] = 0;
				nxt[j][1] = 0;
			}
			for(int j = vs[v];j >= 1;j--){
				for(int k = vs[to];k >= 1;k--){
					for(int l = 0;l < 2;l++){
						for(int m = 0;m < 2;m++){
							(nxt[j + k][(l + m) % 2] += dp[v][j][l] * dp[to][k][m]) %= MOD;
							if(k % 2 == 0) (nxt[j][(l + m + 1) % 2] += dp[v][j][l] * dp[to][k][m] % MOD * num[k]) %= MOD;
						}
					}
				}
			}
			vs[v] += vs[to];
			for(int j = 0;j <= vs[v];j++){
				dp[v][j][0] = nxt[j][0];
				dp[v][j][1] = nxt[j][1];
			}
		}
	}
}

signed main(){
	int n,ans = 0;
	cin >> n;
	for(int i = 0;i <= n;i++) num[i] = 1;
	for(int i = 4;i <= n;i += 2) num[i] = num[i - 2] * (i - 1) % MOD;
	for(int i = 0;i < n - 1;i++){
		int a,b;
		cin >> a >> b; a--;b--;
		G[a].pb(b);
		G[b].pb(a);
	}
	dfs(0,-1);
	/*for(int i = 0;i < n;i++){
		for(int j = 0;j <= n;j++) cout << dp[i][j][0] * num[j] << ":" << dp[i][j][1] * num[j] << " ";
		cout << endl;
	}*/
	//ans = num[n];
	for(int i = 0;i <= n;i += 2) ans = (ans + (dp[0][i][0] - dp[0][i][1] + MOD) * num[i]) % MOD;
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 391424
#include <iostream>

using namespace std;

int main()
{
    char X, Y;
    char A=10, B=11, C=12, D=13,E=14,F=15 ;
    cin >>X>>Y ;
    if (X==Y)
        cout << "=" ;
    else if (X<Y)
        cout << "<" ;
    else if (X>Y)
        cout << ">" ;






    return 0;
}


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

namespace cpp
{
  int F()
  {
    int a, b, c;
    while(c = getchar(), c < '-');
    b = c == '-';
    for(a = b ? 0 : c - '0'; c = getchar(), c > '-'; a = a * 10 + c - '0');
    return b ? -a : a;
  }

  const int N = 200, inf = (int) 1e9;
  int n, m, r;
  int g[N][N], a[N];

  int main()
  {
    n = F(); m = F(); r = F();
    for(int i = 0; i < r; ++i) a[i] = F() - 1;
    sort(a, a + r);
    for(int i = 0; i < n; ++i) for (int j = 0; j < n; ++j)
      g[i][j] = i == j ? 0 : inf;
    int x, y, gt;
    while(m--) 
    {
      x = F() - 1; y = F() - 1; 
      g[x][y] = g[y][x] = min(g[x][y], F());
    }
    for(int k = 0; k < n; ++k) for(int i = 0; i < n; ++i) for(int j = 0; j < n; ++j)
      g[i][j] > (gt = g[i][k] + g[k][j]) ? g[i][j] = gt : 0;
    int ans = inf;
    do
    {
      int cur = 0;
      for(int i = 0; i < r - 1; ++i) cur += g[a[i]][a[i + 1]];
      cur < ans ? ans = cur : 0;
    } while(next_permutation(a, a + r));
    printf("%d\n", ans);
  }
}

int main() {cpp::main(); return 0;}

Measured memory_bytes: 384
#ifdef LOCAL111
#else
	#define NDEBUG
#endif
#include <bits/stdc++.h>
const int INF = 1e8;
using namespace std;

#define endl '\n'
#define ALL(a)  (a).begin(),(a).end()
#define SZ(a) int((a).size())
#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for (int i=(b)-1;i>=(a);i--)
#define REP(i,n)  FOR(i,0,n)
#define RREP(i,n) for (int i=(n)-1;i>=0;i--)
#define RBP(i,a) for(auto& i : a)
#ifdef LOCAL111
	#define DEBUG(x) cout<<#x<<": "<<(x)<<endl
	template<typename T> void dpite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
#else
	#define DEBUG(x) true
	template<typename T> void dpite(T a, T b){ return; }
#endif
#define F first
#define S second
#define SNP string::npos
#define WRC(hoge) cout << "Case #" << (hoge)+1 << ": "
#define rangej(a,b,c) ((a) <= (c) and (c) < (b))
#define rrangej(b,c) rangej(0,b,c)
template<typename T> void pite(T a, T b){ for(T ite = a; ite != b; ite++) cout << (ite == a ? "" : " ") << *ite; cout << endl;}
template<typename T> bool chmax(T& a, T b){if(a < b){a = b; return true;} return false;}
template<typename T> bool chmin(T& a, T b){if(a > b){a = b; return true;} return false;}

typedef long long int LL;
typedef unsigned long long ULL;
typedef pair<int,int> P;
typedef pair<LL,LL> LP;

void ios_init(){
	//cout.setf(ios::fixed);
	//cout.precision(12);
#ifdef LOCAL111
	return;
#endif
	ios::sync_with_stdio(false); cin.tie(0);	
}



int main()
{
	ios_init();
	int n;
	while(cin >> n){
		vector<int> a(n);
		REP(i,n) cin >> a[i];
		multiset<int> s;
		REP(i,n){
			s.insert(a[i]);
		}
		bool ans = true;
		int ma = *(--s.end());
		if(ma%2 == 0){
			if(s.count(ma/2)) s.erase(s.find(ma/2));
			else ans = false;
		}
		dpite(ALL(s));
		FOR(i,ma/2+1,ma+1){
			if(s.find(i) != s.end()){
				s.erase(s.find(i));
				if(s.find(i) != s.end()){
					s.erase(s.find(i));
				}else{
					ans = false;
					break;
				}
			}else{
				ans = false;
				break;
			}
		}
		if(ans){
			for(auto&& e : s) {
				if(e <= (ma+1)/2){
					ans = false;
					break;
				}
			}
		}
		if(ans){
			cout << "Possible" << endl;
		}else{
			cout << "Impossible" << endl;
		}
	}
	return 0;
}


Measured memory_bytes: 256
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <queue>
#include <set>
#include <string>
#include <vector>
#define SORT(a) sort(a.begin(), a.end())
#define RSORT(a) sort(a.rbegin(), a.rend())
#define REP(i, n) for (int i = 0; i < n; i++)
#define RREP(i, n) for (int i = n; 0 <= i; i--)
#define FOR(i, start, end) for (int i = start; i < end; i++)
#define FORSTEP(i, start, end, step) for (int i = start; i < end; i += step)
#define RFOR(i, start, end) for (int i = start; end <= i; i--)
#define ALL(a) a.begin(), a.end()
#define MOD(a) a %= 1000000007
typedef long long ll;
const int INF32 = 2147483647;
const ll INF64  = 9223372036854775807;
using namespace std;

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

    int N;
    cin >> N;
    vector<int> A(N);
    REP(i, N) cin >> A[i];

    REP(i, N) A[i] -= i + 1;
    SORT(A);
    int b  = A[N / 2];
    ll ans = 0;
    REP(i, N) { ans += abs(A[i] - b); }

    cout << ans << endl;

    return 0;
}

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



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

  int a[300500];
  for(int i=0;i<n;i++){
    cin>>a[i];
    a[i]=a[i]/10;
  }
  int mx=0;
  for(int i=0;i<=mx;i++){
    mx=max(mx,a[i]+i);
    if(mx>n){break;}
  }
  bool j=true;
  if(n-1>mx){j=false;}
  
  reverse(a,a+n);
  mx=0;
  for(int i=0;i<=mx;i++){
    mx=max(mx,a[i]+i);
    if(mx>n){break;}
  }
  if(n-1>mx){j=false;}
  
  if(j){cout<<"yes"<<endl;}
  else{cout<<"no"<<endl;}


  return 0;
}



Measured memory_bytes: 4272
#include<bits/stdc++.h>
using namespace std;
typedef long long int lli;
typedef unsigned long long int ulli;
typedef long double ld;

void vprint(vector<int>&v)
{  for(int i=0;i<v.size();i++)cout<<v[i]<<' ';cout<<endl;}

void aprint(int *arr,int n)
{  for(int i=0;i<n;i++)cout<<arr[i]<<' ';cout<<endl;}


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

   vector<int>v;
   ld mult=1;
   ld fsum=0;
   for(int i=0;i<n;i++)
   {
       int x;
       cin>>x;
       v.push_back(x);
       mult*=x;
   }

   if(n==1)
   {
       cout<<v[0]<<endl;
       return 0;
   }

   for(int i=0;i<n;i++)
   {
       fsum+=mult/v[i];
   }

   cout<<mult/fsum<<endl;


}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include <math.h>
using namespace std;
bool is_prime(int x){
    bool f = true;
    if(x == 2){ f = true; }
    else if(x < 2 || x % 2 == 0){ f = false; }
    else{
        int i = 3;
        while(i <= sqrt(x)){
            if(x % i == 0){ f = false; break;}
            i += 2;
        }
    }
  return f;
}

int main(){
  int n;
  cin >> n;
  vector<int> v(0);
  for(int i = 1; i <= n; i++){
    if(is_prime(i)){v.push_back(i);}
  }
  
  vector<int> w(v.size(), 0);
  for(int i = 0; i < v.size(); i++){
    if(w[i] > pow(n, 0.5)){
    w[i] = n / v[i];
    }
    else{
      int j = 1;
      while(pow(v[i], j) <= n){
        w[i] += (n / pow(v[i], j));
        j++;
      }
    }
  }
  
  long long ans = 1;
  long long q = pow(10, 9) + 7;
  
  for(int i = 0; i < w.size(); i++){
    ans *= w[i] + 1;
    ans %= q;
  }
	//for(auto c : w){cout << c << endl;}
  cout << ans << endl;
  
}
       

Measured memory_bytes: 384
import sys
import math

K=int(input())

my_gcd=dict()

for i in range(1,K+1):
    for j in range(i,K+1):
        g = math.gcd(i,j)
        
        p = i*300+j
        my_gcd[p]=g
        q = j*300+i
        my_gcd[q]=g

sum=0
for i in range(1,K+1):
    for j in range(1,K+1):
        g = my_gcd[i*300+j]
        for k in range(1,K+1):
            sum += my_gcd[g*300+k] 

print(sum)


Measured memory_bytes: 11680
#include <bits/stdc++.h>
#define all(v) (v).begin(), (v).end()
#define pb push_back
#define REP(i,n) for(int i=0; i<(n); i++)
#define REP2(i,x,n) for(int i=x; i<(n); i++)
using namespace std;
using ll = long long;
using ld = long double;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
template<class T>using numr=std::numeric_limits<T>;
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return 1; } return 0; }
template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return 1; } return 0; }
const int INF = 1e9;
const ll LLINF = 1e16;
const int MOD = 1000000007;
const int MOD2 = 998244353;

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr>
std::istream& operator>> (std::istream& is, Container& v)
    { for (auto & x : v) { is >> x; } return is; }

template < typename Container, typename Value = typename Container::value_type, std::enable_if_t<!std::is_same< Container, std::string >::value, std::nullptr_t> = nullptr >
std::ostream& operator<< (std::ostream& os, Container const& v) {
os << "{";
    for (auto it = v.begin(); it != v.end(); it++)
        {os << (it != v.begin() ? "," : "") << *it;}
    return os << "}";
}

int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    int n;
    cin >> n;
    int a=0,b=0,c=0,d=0;
    for(int i=0;i<n;i++){
        string s;
        cin >> s;
        if(s =="AC") a++;
        else if(s =="WA") b++;
        else if(s =="TLE") c++;
        else if(s =="RE") d++;
    }
    cout << "AC x " << a << endl;
    cout << "WA x " << b << endl;
    cout << "TLE x " << c << endl;
    cout << "RE x " << d << endl;


}

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

#define rep(i, a, b) for (int i = a; i < (b); ++i)
#define trav(a, x) for (auto& a : x)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;

int main() {
	int n, a, b; string s;
	cin >> n >> a >> b >> s;

	int ca = 0, cb = 0;

	for (char c : s) {
		if (c == 'a' && ca + cb < a + b) {
			ca++;
			cout << "Yes" << endl;
		} else if (c == 'b' && ca + cb < a + b && cb < b) {
			cb++;
			cout << "Yes" << endl;
		} else {
			cout << "No" << endl;
		}
	}
}


Measured memory_bytes: 896
# -*- coding: utf-8 -*-
base = 2019
l, r = map(int, input().split())
result = 2018*2017

if r - l > 2019:
    result = 0
else:
    for i in range(l, r):
        for j in range(i+1, r+1):
            tmp_r = (i * j) % base
            if tmp_r < result:
                result = tmp_r

print(result)


Measured memory_bytes: 2940
l=input()
a,b,c,d=[int(l[i]) for i in range(4)]
plmi=[1,-1]
x=[None,'+','-']
for i in plmi:
	for j in plmi:
		for k in plmi:
			if a+b*i+c*j+d*k==7:
				print(str(a)+x[i]+str(b)+x[j]+str(c)+x[k]+str(d)+'=7')
				exit()

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

int main(){
  int N;
  cin >> N;
  string S[N];
  rep(i, N){
    cin >> S[i];
  }
  rep(i, N){
    sort(S[i].begin(), S[i].end());
  }
  long long ans = 0;
  unordered_map<string, long long> X;
  rep(i, N){
    X[S[i]]++;
  }
  for (auto x : X){
    long long n = x.second;
    ans += (n * (n-1) / 2);
  }
  cout << ans << endl;
}

Measured memory_bytes: 13456
//Jai Bhole Ki
#include <bits/stdc++.h>
using namespace std;
#define fast static int fastline = []() { std::ios::sync_with_stdio(false); cin.tie(NULL); return 0; }();
#define ll long long
#define LL unsigned ll
#define pb push_back
#define pi pair<ll,ll>
#define debug(x) cout<<x<<"\n";
#define debug cout<<"debugged\n";
#define minval -2e9
#define maxval 2e9
long double PI =3.14159265358979323846;
 
const ll M=1e9+7;
const ll inf=1e18;
const ll ms=2e5+5;
fast;
LL ans;
LL n,m,q;
void solve()
{
    cin>>m>>n;
    ll outlet=1;
    while(outlet<n)
    {
        outlet--;
        outlet+=m;
        ans++;
    }
    cout<<ans<<endl;
}   

int main()
{
 // freopen("input.txt","r",stdin);
//  freopen("output.txt","w",stdout);
   // int t;cin>>t;while(t--)
    {
        solve();
    }
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <fstream>
#include <cstdlib>
#include <math.h>
#include <utility>
#include <algorithm>
#include <functional>
#include <vector>
#include <numeric>
#include <bits/stdc++.h>

using namespace std;
using ll = long long;
using vi = vector <int>;

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

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

    int n; cin >> n;
    vi s;
    REP(i, n) {
        int tmp;
        cin >> tmp;
        s.push_back(tmp);
    }

    int q; cin >> q;
    
    int cnt = 0;
    REP(i, q) {
        int tmp;
        cin >> tmp;
        auto iter = lower_bound(s.begin(), s.end(), tmp);
        int idx = distance(s.begin(), iter);
        if (s[idx] == tmp) cnt++;
    }

    cout << cnt << "\n";
}


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

using namespace std;
int n;
int ar[100005][4];
int dp[100005][4];

int main() {
    //freopen("input.in", "r", stdin);
    //freopen("output.txt", "w", stdout);
    ios::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    memset(dp,-1,sizeof dp);
    cin>>n;
    for(int i=0;i<n;i++){
        for(int j=0;j<3;j++)
        {
            cin>>ar[i][j];
        }
    }
    dp[0][0]=ar[0][0];
    dp[0][1]=ar[0][1];
    dp[0][2]=ar[0][2];
    for(int ind=1;ind<n;ind++){
        for(int j=0;j<3;j++){
            int tmp=0;
            for(int k=0;k<3;k++){
                if(j==k){
                    continue;
                }
                tmp=max(tmp,dp[ind-1][k]);
            }
            dp[ind][j]=ar[ind][j]+tmp;
        }
    }
    cout<<max(dp[n-1][0],max(dp[n-1][1],dp[n-1][2]))<<endl;
    return 0;
}

Measured memory_bytes: 3328
#include <iostream>
#include <bits/stdc++.h>
#define lli unsigned long long int
using namespace std;
#define S second
#define F first
#define pb push_back
#define M1 1000000007
#define M2 998244353
#define pint pair<int,int>
#define setit set<int>::iterator seti
#define mapit map<int,int> ::iterator mapi
#define MP make_pair
#define MT make_tuple
#define PI 3.14159265358979323846
// map      iterator->first  iterator.first
// map      mp[key]=value
// set      *s.begin()
// vector   v[j]=value
// pair     p.first p.second
// vector of pairs v[j].first v[j].second
// tuple    get<index>(tuple_name)
// vector of tuples get<index>(v[j])  sort(v.begin(),v.end())
//priority queue .top() .pop() .push()
// __gcd(x,y)
#define mini(x,y) (y + ((x - y) & ((x - y) >>(sizeof(int) * CHAR_BIT - 1))))
#define maxi(x,y) (x - ((x - y) & ((x - y) >> (sizeof(int) * CHAR_BIT - 1))))
#define fr(j,a,b) for(j=a;j<b;j++)

int power(int x, unsigned int y, int p)
{   int res = 1;
    x = x % p;
    if (x == 0) return 0;
    while (y > 0)
    {   if (y & 1)
            res = (res * x) % p;
        y = y >> 1;
        x = (x * x) % p;
    }
    return res;
}

int main()
{
  /*
#ifndef ONLINE_JUDGE
    // for getting input from input.txt
    freopen("input.txt", "r", stdin);
    // for writing output to output.txt
    freopen("output.txt", "w", stdout);
#endif
*/
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    lli t, n, g, b, i, x, j;
//   cin >> t;
    t = 1;
    string s, w;
    for (i = 0; i < t; i++) {
        cin >> s >> w;
        x = 0;
        for (j = 0; j < 3; j++) {
            if (s[j] == w[j]) {
                x++;
            }
        }
        cout << x;
    }

}



Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#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 all(a) (a).begin(),(a).end()
#define print(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<_<<", "; cerr<<"]"<<endl; }
#define printpair(v) { cerr<<#v<<": [ "; for(auto _ : v) cerr<<"{"<<_.first<<","<<_.second<<"}"<<", "; cerr<<"]"<<endl; }
#define dump(x) cerr<<#x<<": "<<x<<endl;
#define bit(k) (1LL<<(k))
#define Yes "Yes"
#define No "No"
#define YES "YES"
#define NO "NO"
typedef long long ll;

template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }

const int INF = (ll)1e9;
const ll INFLL = (ll)1e18+1;
const ll MOD = (ll)1e9+7;
const double PI = acos(-1.0);
void debug(set<int>& s){
    cerr<<"set: ";
    for(auto x:s){
        cerr<<x<<" ";
    }
    cerr<<endl;
}
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    cout << fixed << setprecision(20);

    int N,Q;
    cin>>N>>Q;
    vector<pair<int, pair<int, int>>> stx(N);
    rep(i,N){
        cin>>stx[i].second.first>>stx[i].second.second>>stx[i].first;
    }
    //xでソート
    sort(all(stx));
    vector<int> S(N), T(N), X(N);
    rep(i,N){
        S[i] = stx[i].second.first;
        T[i] = stx[i].second.second;
        X[i] = stx[i].first;
    }
    vector<int> D(Q), ans(Q, -1);
    set<int> set;
    map<int, int> idx;
    rep(i,Q){
        cin>>D[i];
        idx[D[i]] = i;
        set.insert(D[i]);
    }

    rep(i,N){

        auto l_itr = set.lower_bound(S[i] - X[i]);
        auto r_itr = set.upper_bound(T[i] - X[i]);
        /*
        while(l_itr != r_itr){
            ans[idx[*l_itr]] = X[i];
            l_itr = set.erase(l_itr);
        }*/
        while(l_itr != set.end()){
            if(*l_itr >= T[i] - X[i])break;
            ans[idx[*l_itr]] = X[i];
            set.erase(l_itr++);
        }
    }
    rep(i,Q){
        cout<<ans[i]<<endl;
    }
}

/*

set: 0 1 2 3 5 8 
set: 2 3 5 8 
set: 3 5 8 
set: 5 8 

set: 0 1 2 3 5 8 
set: 1 2 3 5 8 
set: 2 3 5 8 
set: 3 5 8 

*/

Measured memory_bytes: 26880
#include <iostream>
#include <algorithm>
#include <vector>
#include <cmath>
#include <iomanip>
#include <map>
using namespace std;

void solve(){
  string s; cin >> s;
  int ans = 0;
  for(int i = 0; i < s.length(); i++){
    if(s[i] == '+') ans++;
    else ans--;
  }
  cout << ans << endl;
  return;
}
int main(){
  solve();
  return 0;
}


Measured memory_bytes: 256
local function split(text, delimiter)
   if text.find(text, delimiter) == nil then
     return { text }
   end

   local splited_texts = {}
   local last_position

   for splited_text, position in text:gmatch("(.-)"..delimiter.."()") do
     table.insert(splited_texts, splited_text)
     last_position = position
   end
   table.insert(splited_texts, string.sub(text, last_position))
   return splited_texts
end

local total = io.read()
local arares = io.read()

local color = {}
color["p"] = 0
color["w"] = 0
color["g"] = 0
color["y"] = 0

local arare_list = split(arares, " ")
for k,v in pairs(arare_list) do
  if v == "P" then
    color["p"] = color["p"] + 1
  elseif v == "W" then
    color["w"] = color["w"] + 1
  elseif v == "G" then
    color["g"] = color["g"] + 1
  elseif v == "Y" then
    color["y"] = color["y"] + 1
  end
end

local number = 0
if color["p"] > 0 then
 number = number + 1
end
if color["w"] > 0 then
 number = number + 1
end
if color["g"] > 0 then
 number = number + 1
end
if color["y"] > 0 then
 number = number + 1
end

if number == 3 then
  print("Three")
elseif number == 4 then
  print("Four")
end

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <queue>
#include <vector>
#include <map>
#include <string>

using namespace std;

int main() {
    string s,t;
    cin >> s >> t;
        int cou1[26];
        int cou2[26];
        for(int i = 0; i < 26; i++) {
            cou1[i] = 0;
            cou2[i] = 0;
        }

        for(int i = 0; i < s.length(); i++) {
            cou1[s[i] - 'a']++;
        }
        for(int i = 0; i < t.length(); i++) {
            cou2[t[i] - 'a']++;
        }

        int a[s.length()];
        int b[t.length()];

        for(int i = 0; i < s.length(); i++) {
            for(int j = 0; j < 26; j++) {
                if(cou1[j] != 0) {
                    cou1[j]--;
                    a[i] = j;
                    break;
                }
            }
        }

        for(int i = 0; i < t.length(); i++) {
            for(int j = 25; j >= 0; j--) {
                if(cou2[j] != 0) {
                    cou2[j]--;
                    b[i] = j;
                    break;
                }
            }
        }
        bool ok = false;
        for(int i = 0; i < s.length(); i++) {
            if(a[i] < b[i]) {
                ok = true;
                break;
            } else if(a[i] > b[i]) {
                ok = false;
                break;
            }

            if(i == s.length() - 1 && s.length() < t.length()) {
                ok = true;
                break;
            }
        }

        

        if(!ok)
        cout << "No" << endl;
        else
        {
            cout << "Yes" << endl;
        }



}

Measured memory_bytes: 256
#include <stdio.h>
#include <assert.h>
#include <fstream>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <queue>
#include <set>
#include <cmath>
#include <unordered_map>

long long pow_mod(long long x, long long n, long long mod_num) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) { res = (res * x) % mod_num; }
        x = (x * x) % mod_num;
        n = (n >> 1);
    }
    return res;
}

class Combi_Num {
    public:
    long long mod_num;
    std::vector<long long> factorial, factorial_inv, inv;
    Combi_Num() {}
    Combi_Num(const int n, const long long mod_num_in) {
        mod_num = mod_num_in;
        factorial.resize(n+1, 0);
        factorial_inv.resize(n+1, 0);
        inv.resize(n+1, 0);
        factorial[0] = 1;
        factorial_inv[0] = 1;
        inv[0] = 1;
        for (int i = 1; i <= n; i++) {
            factorial[i] = (factorial[i-1] * i) % mod_num;
            inv[i] = pow_mod(i, mod_num - 2, mod_num);
            factorial_inv[i] = (factorial_inv[i-1] * inv[i]) % mod_num;
        }
    }

    long long calc(const int n, const int r) {
        return (factorial[n] * ((factorial_inv[r] * factorial_inv[n-r]) % mod_num)) % mod_num;
    }
};

const long long MOD = 1000000007;
const int MAX_N = 2000050;
int N;

Combi_Num combi_num = Combi_Num(MAX_N, MOD);
long long all_colored_num[MAX_N] = {};

int main(int argc, char **argv) {
    std::cin >> N;

    for (int K = 1; K <= N - 1; K++) {
        if (K - 1 >= N - 1 - K) {
            long long tmp = (combi_num.factorial[K] * combi_num.factorial[N-1-K]) % MOD;
            all_colored_num[K] = (tmp * combi_num.calc(K - 1, N - 1 - K)) % MOD;
        }
    }

    long long ret = 0;

    for (int K = 1; K <= N - 1; K++) {
        long long num = (all_colored_num[K] - all_colored_num[K-1] + MOD) % MOD;
        ret += (num * K) % MOD;
        ret = ret % MOD;
    }

    std::cout << ret << std::endl;

    return 0;
}


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

int main(void){
	int ct = 0;
	string s,t;
	cin>>s>>t;
	for(int i = 0; i < s.size(); i++){
		ct += s[i] != t[i];
	}
	cout<<ct<<'\n';
	return 0;
}


Measured memory_bytes: 3936
#include <bits/stdc++.h>
#define ll long long
using namespace std;
const int N = 2e5 + 5;


int a[N];
int main(){
    ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
    int n, x, y;
    cin >> n >> x >> y;
    x--;
    y--;
    for(int i = 0; i < n; i++){
        for(int j = i + 1; j < n; j++){
            int dis = min(j - i, abs(x - i) + 1 + abs(j - y));
            a[dis]++;
        }
    }
    for(int i = 1; i < n; i++){
        cout << a[i] << '\n';
    }


    return 0;
}


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

public class Main {
	public static void main(String[] args) {
		BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    
		String x = "";
		try {
			x = in.readLine();
		} catch (NumberFormatException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (IOException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		
		String[] values = x.split(" ");
		int a = Integer.parseInt(values[0]);
		int b = Integer.parseInt(values[1]);
		int c = Integer.parseInt(values[2]);
		
		int num = 0;
		for (int i = a; i <= b; i++) {
			if ((c % i) == 0) num++;
		}
		System.out.println(num);
	}
}

Measured memory_bytes: 24448
#include <stdio.h>

int main() {
  int a=0, b=0;
  scanf("%d %d", &a, &b);
  if (a == b) printf("%d\n", a*2);
  else if (a > b) printf("%d\n", a*2-1);
  else printf("%d\n", b*2-1);
  return 0;
}


Measured memory_bytes: 128
//From Naruto to Hokage
//#include <RJ>
#include<bits/stdc++.h>
using namespace std;

#define ll          long long
#define pb          push_back
#define eb          emplace_back
#define endl        '\n'
#define mii         map<ll,ll>
#define pii         pair<ll,ll>
#define vi          vector<ll>
#define all(a)      (a).begin(),(a).end()
#define F           first
#define S           second
#define sz(x)       (ll)x.size()
#define hell        1000000007
#define INF         (1ll<<60)
#define rep(i,a,b)  for(ll i=a;i<=b;i++)
#define rrep(i,a,b)  for(ll i=a;i>=b;i--)
#define present(c,x) ((c).find(x) != (c).end())
#define cpresent(c,x) (find(all(c),x) != (c).end())
#define ios ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0);
#define time        cerr << "\nTime elapsed: " << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
ll gcd(ll a, ll b) { return b == 0 ? a : gcd(b, a % b); }
ll lcm(ll a, ll b) { return a * (b / gcd(a, b)); }
const int N=100005;
void solve(){
    string n;
    cin>>n;
    if(n[0]==n[1] || n[1]==n[2] || n[2]==n[3]) cout<<"Bad";
    else cout<<"Good";
}
signed main()
{
    ios
    int TESTS=1;
    //cin>>TESTS;
    while(TESTS--){
        solve();
    }
    time
    return 0;
}

Measured memory_bytes: 256
#include <cctype>
#include <iostream>
#include <string>

std::string solve(std::string s, int k)
{
  s[k - 1] = std::tolower(s[k - 1]);
  return s;
}

int main()
{
  int n, k;
  std::string s;
  std::cin >> n >> k;
  std::cin >> s;

  std::cout << solve(s, k) << std::endl;
}


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

int main(){
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n,m;cin>>n>>m;
  ll a=1<<m;
  ll b=1900*m+(n-m)*100;
  cout<<a*b<<endl;
  return 0;
  }


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

char s[100005];

int main(){
	scanf("%s",s+1);
	int n=strlen(s+1);
	if(s[1]=='0'||s[n]=='1'){puts("-1");return 0;}
	for(int i=1;i<n;++i)
		if(s[i]^s[n-i]){puts("-1");return 0;}
	int now=1;
	for(int i=2;i<=n;++i){
		printf("%d %d\n",now,i);
		if(s[i-1]=='1') now=i;
	}
	return 0;
} 


Measured memory_bytes: 1536
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
bool f[114514];
int main() {
	ll n,m,x,y,cnt[114514];
	cin>>n>>m;
	for(int i=1;i<=n;i++)cnt[i]=1;
	f[1]=1;
	for(int i=0;i<m;i++){
		cin>>x>>y;
		cnt[x]--;
		cnt[y]++;
		if(f[x]){
			f[y]=1;
			if(cnt[x]==0)f[x]=0;
		}
	}
	ll ans=0;
	for(int i=1;i<=n;i++)if(f[i])ans++;
	cout<<ans<<endl;
	return 0;
}

Measured memory_bytes: 1152