akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
typedef long long ll;
typedef long double ld;
#define rep(i,n) for(ll i=0;i<(n);i++)
#define repr(i,n) for(ll i=(n-1);i>=0;i--)
#define all(x) x.begin(),x.end()
#define br cout << "\n";
using namespace std;
const int INF = 1e9;
const int MOD = 1e9+7;
using Graph = vector<vector<ll>>;
template<class T> inline bool chmin(T &a, T b) { if(a > b){ a = b; return true;} return false;}
template<class T> inline bool chmax(T &a, T b) { if(a < b){ a = b; return true;} return false;}

// 0 false, 1 true 
// string to int : -48
// a to A : -32
// ceil(a)  1.2->2.0
// c++17	g++ -std=c++17 a.cpp

int main() {
    std::cout << std::fixed << std::setprecision(15);
    ll h1, m1, h2, m2, k;
    cin >> h1 >> m1 >> h2 >> m2 >> k;
    ll tmp = h1 * 60 + m1;
    ll tmp2 = h2 * 60 + m2;

    cout << tmp2 - tmp - k << endl;

}

Measured memory_bytes: 3632
from math import factorial
import sys


def input(): return sys.stdin.readline().strip()
def I(): return int(input())
def LI(): return list(map(int, input().split()))
def IR(n): return [I() for i in range(n)]
def LIR(n): return [LI() for i in range(n)]
def SR(n): return [S() for i in range(n)]
def S(): return input()
def LS(): return input().split()


k, s = LI()
ans = 0
for x in range(k + 1):
    for y in range(k + 1):
        z = s - (x + y)
        if 0 <= z <= k:
            ans += 1
print(ans)


Measured memory_bytes: 9100
#include <bits/stdc++.h>
#define _overload3(_1, _2, _3, name, ...) name
#define _rep(i, n) repi(i, 0, n)
#define repi(i, a, b) for (int i = (a); i < (b); ++i)
#define rep(...) _overload3(__VA_ARGS__, repi, _rep, )(__VA_ARGS__)
#define ALL(x) x.begin(), x.end()
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
using ll = long long;
using lld = long double;
using VI = vector<int>;
using VVI = vector<VI>;
using VL = vector<ll>;
using VVL = vector<VL>;
using PII = pair<int, int>;
random_device rnd;
mt19937 mt(rnd());

const int IINF = 1 << 30;
const ll INF = 1ll << 60;
const ll MOD = 1e9 + 7;

int main()
{
    int p;
    cin >> p;
    if (p == 1)
    {
        cout << "Hello World" << endl;
    }
    else
    {
        int a, b;
        cin >> a >> b;
        cout << a + b << endl;
    }
    return 0;
}

Measured memory_bytes: 256
#include <iostream>
#include <algorithm>
#include <vector>
#include <string>
#include <cmath>
#include <cstring>
#include <utility>
#include <numeric>

using namespace std;

int main(){

    int N, Z, W;
    cin >> N >> Z >> W;
    vector<int> a(N);

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

    if(N == 1){
        cout << abs(W - a[0]) << endl;
    }
    else{
        cout << max(abs(W - a[N - 1]), abs(a[N - 1] - a[N - 2])) << endl;
    }

    return 0;
}

Measured memory_bytes: 256
//by yjz
#include<bits/stdc++.h>
using namespace std;
#define FF first
#define SS second
#define PB push_back
#define MP make_pair
#define foreach(it,s) for(__typeof((s).begin()) it=(s).begin();it!=(s).end();it++)
#ifndef LOCAL
#define cerr if(0)cout
#endif
typedef long long ll;
const int mod = 1e9+7;
//My i/o stream
struct fastio
{
	char s[100000];
	int it, len;
	fastio() {it=len=0;}
	inline char get()
	{
		if (it<len) return s[it++]; it=0;
		len=fread(s, 1, 100000, stdin);
		if (len==0) return EOF; else return s[it++];
	}
	bool notend()
	{
		char c=get();
		while (c==' '||c=='\n') c=get();
		if (it>0) it--;
		return c!=EOF;
	}
}_buff;
#define geti(x) x=getnum()
#define getii(x,y) geti(x),geti(y)
#define getiii(x,y,z) getii(x,y),geti(z)
#define puti(x) putnum(x),putchar(' ')
#define putii(x,y) puti(x),puti(y)
#define putiii(x,y,z) putii(x,y),puti(z)
#define putsi(x) putnum(x),putchar('\n')
#define putsii(x,y) puti(x),putsi(y)
#define putsiii(x,y,z) putii(x,y),putsi(z)
inline ll getnum()
{
	ll r=0; bool ng=0; char c; c=_buff.get();
	while (c!='-'&&(c<'0'||c>'9')) c=_buff.get();
	if (c=='-') ng=1, c=_buff.get();
	while (c>='0'&&c<='9') r=r*10+c-'0', c=_buff.get();
	return ng?-r:r;
}
template <class T> inline void putnum(T x)
{
	if (x<0) putchar('-'), x=-x;
	register short a[20]={}, sz=0;
	while (x) a[sz++]=x%10, x/=10;
	if(sz==0) putchar('0');
	for (int i=sz-1; i>=0; i--) putchar('0'+a[i]);
}
inline char getreal() {char c=_buff.get(); while (c<=32) c=_buff.get(); return c;}
ll qpow(ll x, ll k) {return k==0? 1: 1ll*qpow(1ll*x*x%mod,k>>1)*(k&1?x:1)%mod;}
const int maxn = 111;
int n;
int a[maxn];
bool vis[maxn];
int main()
{
	geti(n);
	for (int i=1; i<=n; i++) geti(a[i]);
	vector<int> v;
	for (int i=1; i<=n; i++)
	{
		int cnt = 0, lst = -1;
		for (int j=1; j<=n; j++)
		{
			if (vis[j]) continue;
			cnt++;
			if (a[j]==cnt)
			{
				lst = j;
			}
		}
		if (lst==-1)
		{
			puts("-1");
			return 0;
		}
		vis[lst] = 1;
		v.PB(a[lst]);
	}
	reverse(v.begin(), v.end());
	for (auto x : v) putsi(x);
	return 0;
}


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

using namespace std;
using ll = long long;


int main()
{
    ll a; cin >> a;
    string s;
    while(a) {
        a--;
        s.push_back('a' + a % 26);
        a /= 26;
    }
    reverse(s.begin(), s.end());
    cout << s << endl;
}

Measured memory_bytes: 3624
#include <bits/stdc++.h>
#define fto(i,a,b) for(int i=a; i<=b;++i)
#define fdto(i,a,b) for(int i=a; i>=b;--i)
#define fi first
#define se second
#define mp make_pair
#define pb push_back
#define pii pair<ll,ll>
#define ll long long
#define maxn 100009
#define gb(i,j) ((i>>j)&1)
#define name "a"
#define endl '\n'
#define int ll

using namespace std;

const int mod=1e9+7;

pii a[maxn];
int t[maxn],s[maxn],n;

void add(int x){
    for(;x; x-=x&-x)++t[x];
}

int get(int x){
    int res=0;
    for(;x<=n; x+=x&-x)res+=t[x];
    return res;
}

main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    fto(i,1,n){
        cin >> a[i].fi;
        a[i].se=i;
    }
    sort(a+1,a+n+1,greater<pii>());
    int top=n;
    for(int i=1; i<=n;){
        int x=a[i].fi;
        while(a[i].fi==x && i<=n){
            top=min(top,a[i].se);
            add(a[i].se);
            ++i;
        }
        s[top]+=get(top)*(a[i-1].fi-a[i].fi);
    }
    fto(i,1,n) cout << s[i]<<endl;

    return 0;
}


Measured memory_bytes: 4224
#include<iostream>
#include<stdio.h>
#include<cctype>
using namespace std;

int main(){
	char ch;
	
	while(1) {
		scanf("%c", &ch);
		
		if(islower(ch)){
			ch = toupper(ch);
		}
		else if(isupper(ch)){
			ch = tolower(ch);
		}	
		if(ch == '\n') break;
		cout << ch;
	}
	cout << endl;
	
	return 0;
}

Measured memory_bytes: 1152
import java.util.*;
public class Main{
    
    static final int INF = (int)1e9;
    
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        
        int n = Integer.parseInt(sc.next());
        int k = Integer.parseInt(sc.next());
        int[] a = new int[n];
        for(int i=0; i<n; i++){
            a[i] = Integer.parseInt(sc.next());
        }
        
        int[] b = new int[n];
        for(int i=0; i<n-1; i++){
            b[i+1] = (a[i]<a[i+1])? 1 : 0;
        }
        for(int i=0; i<n-1; i++){
            b[i+1] += b[i];
        }
        
        TreeSet<Integer> set = new TreeSet<>();
        for(int i=0; i<k; i++){
            set.add(a[i]);
        }
        
        boolean ct = (b[k-1]==k-1);
        int ans = (ct)? 0 : 1;
        
        for(int i=k; i<n; i++){
            boolean flag1 = (set.first()==a[i-k]);
            set.add(a[i]);
            set.remove(a[i-k]);
            boolean flag2 = (set.last()==a[i]);
            boolean ok = !(flag1&&flag2);
            
            if(b[i] - b[i-k+1] == k-1){
                ct = true;
            }else if(ok){
                ans++;
            }
        }
        
        if(ct){
            ans++;
        }
        System.out.println(ans);
    }
    
}

Measured memory_bytes: 66532
#include<iostream>
using namespace std;
int main()
{
	string s,t;
	cin >> s >> t;
	int A,B;
	cin >> A >> B;
	string u;
	cin >> u;
	if( u == s)
	{
		cout << A - 1 << " " << B;
	}
	else
	{
		cout << A << " " << B - 1;
	}
	return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define gc getchar_unlocked
#define fo(i,n) for(i=0;i<n;i++)
#define foo(i,k,n) for(i=k;k<n?i<n:i>n;k<n?i+=1:i-=1)
#define ll long long
#define deb(x) cout << #x << "=" << x << endl
#define deb2(x, y) cout << #x << "=" << x << "," << #y << "=" << y << endl
#define pb push_back
#define mp make_pair
#define F first
#define S second
#define all(x) x.begin(), x.end()
#define clr(x) memset(x, 0, sizeof(x))
#define sortall(x) sort(all(x))
#define tr(it, a) for(auto it = a.begin(); it != a.end(); it++)
#define PI 3.1415926535897932384626
#define min3(a,b,c)         min(a,min(b,c))
#define max3(a,b,c)         max(a,max(b,c))
#define min4(a,b,c,d)       min(a,min(b,min(c,d)))
#define max4(a,b,c,d)       max(a,max(b,max(c,d)))
#define max5(a,b,c,d,e)     max(max3(a,b,c),max(d,e))
#define min5(a,b,c,d,e)     min(min3(a,b,c),min(d,e))
typedef pair<int, int>  pii;
typedef pair<ll, ll>  pl;
typedef vector<int>   vi;
typedef vector<ll>    vl;
typedef vector<pii>   vpii;
typedef vector<pl>    vpl;
typedef vector<vi>    vvi;
typedef vector<vl>    vvl;
int mpow(int base, int exp); 
void ipgraph(int m);
void DFS(int n);
bool isprime(ll n);
ll gcd(ll a,ll b);
void rstgraph(int n);

const int mod = pow(10,9)+7;
const int N = 3e5, M = N;

//=======================================================================================
vi g[N];
int vis[N];
int nodes=0;

void iluzn() {
  string s;
  cin>>s;
  int count=0;
  int i;
  fo(i,s.length()/2)
  {
    if(s[i]!=s[s.length()-1-i]) count++;
  }
  cout<<count;
}

 
int main() {
  #ifndef ONLINE_JUDGE
    freopen("input.txt","r",stdin);
    freopen("output.txt","w",stdout);
  #endif
    ios_base::sync_with_stdio(0), cin.tie(0), cout.tie(0);
    int t=1,i;
    // cin>>t;
     while(t--) iluzn();
    return 0;
}
int mpow(int base, int exp) {
  base %= mod;
  int result = 1;
  while (exp > 0) {
    if (exp & 1) result = ((ll)result * base) % mod;
    base = ((ll)base * base) % mod;
    exp >>= 1;
  }
  return result;
}
bool isprime(ll n){
    if(n<=1)
        return false;
    if(n==2)
        return true;
    if(n%2==0)
        return false;
    ll rt = sqrt(n);
    for(ll i=3;i<rt;i+=2){
        if(n%i==0)
            return false;
    }
    return true;
}
ll gcd(ll a, ll b) 
{ 
    if (a == 0) 
        return b; 
    return gcd(b % a, a); 
} 
void ipgraph(int m){
  int u, v;
  while(m--){
    cin>>u>>v;
    g[u].pb(v);
    // g[v].pb(u);
  }
}

void DFS(int n)
{  ++nodes;
    vis[n] = 1;
    for(vector<int>::iterator i = g[n].begin(); i != g[n].end() ; i++)
    {
        if(!vis[*i])
            DFS(*i);
    }
}
void rstgraph(int n){
  int i;
  fo(i,n+1){
    g[i].clear();
    vis[i]=0;
  }
  nodes=0;
}

Measured memory_bytes: 10616
#include <stdio.h>
#include <iostream>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <queue>
#include <stack>
#include <functional>
#include <algorithm>
#include <cmath>
#include <iomanip>

using namespace std;

#define in(x) cin >> x
#define out(x) cout << x << endl

#define PI acos(-1)
#define pp push_back

#define Yes cout << "Yes" << endl
#define YES cout << "YES" << endl
#define No cout << "No" << endl
#define NO cout << "NO" << endl

#define vec2(type) vector<vector<type>>
#define vec3(type) vector<vector<vector<type>>>

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

#define Tcmp(X, Y) (abs(aryvec[i]->x) == X && abs(aryvec[i]->y) == Y)

template<typename T> void input(T *data, int n){
	For(i, n){
		cin >> data[i];
	}
}

template<typename T> void sort(vector<T> &ary){
	sort(ary.begin(), ary.end());
}

template<typename T> void rsort(vector<T> &ary){
	sort(ary.rbegin(), ary.rend());
}

void rstring(string &str){
	string temp = str;

	For(i, (int)str.size()){
		str[i] = temp[(str.size() - 1) - i];
	}
}

struct Vec{
	int x, y;
	Vec():
	x(0), y(0){}
};

int main(){

	int n;
	int c[20];
	int v[20];

	in(n);
	input(v, n);
	input(c, n);

	int val = 0;

	For(i, n){
		if(c[i] < v[i]){
			val += v[i] - c[i];
		}
	}

	out(val);
	
	return 0;

}

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

int W,Q;
vector<int> l;
bool input(){
  cin>>W>>Q;
  if(W==0&&Q==0)return false;
  l.clear();
  l.resize(W);
  for(int i=0;i<l.size();i++){
    l[i] = -1;
  }
  return true;
}

void s(){
  int a,b;
  cin>>a>>b;
  //cout<<"s"<<" "<<a<<" "<<b<<endl;
  int start = -1;
  for(int i=0;i<l.size();i++){
    if(start == -1) if(l[i] == -1) start = i;
    if(l[i] == -1){
      if(abs(start-i) >= b-1){
        for(int j=start;j<start+b;j++){
          l[j] = a;
        }
        cout<<start<<endl;
        return ;
      }
    }else{
      start = -1;
    }
  }
  cout<<"impossible"<<endl;
} 

void w(){
  int tmp = 0;
  cin>>tmp;
  //cout<<"w"<<" "<<tmp<<endl;;
  for(int i=0;i<l.size();i++){
    if(l[i] == tmp) l[i] = -1;
  }
}


int main(){
  while(input()){
    for(int i=0;i<Q;i++){
      char c;
      cin>>c;
      switch(c){
        case 's':
          s();
          break;
        case 'w':
          w();
          break;
      }
      //cout<<"lll::";for(auto i:l)cout<<i<<" ";cout<<endl;
    }
    cout<<"END"<<endl;
  }

}

Measured memory_bytes: 1200
#D
N,W=map(int,input().split())
w_list=[]
v_list=[]

for i in range(N):
    w1,v1=map(int,input().split())
    w_list.append(w1)
    v_list.append(v1)
inf=float("inf")
dp=[[-inf for i in range(W+1)] for j in range(N+1)]
for i in range(W+1): dp[0][i]=0

for i in range(N):
    for w in range(W+1):
        if w_list[i]<=w:
            dp[i+1][w]=max(dp[i][w-w_list[i]]+v_list[i],dp[i][w])
        else:
            dp[i+1][w]=dp[i][w]
print(dp[N][W])

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

using namespace std;
#define _overload3(_1,_2,_3,name,...) name
#define _rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define rep(...) _overload3(__VA_ARGS__,repi,_rep,)(__VA_ARGS__)

typedef long long ll;
typedef pair<ll, ll> P;
const ll INF = 1LL<<60;

ll gcd(ll a, ll b) {
  if(b == 0) return a;
  return gcd(b, a % b);
}

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

ll modpow(ll a, ll n, ll mod) {
  ll res = 1;
  while (n > 0) {
    if (n & 1) res = res * a % mod;
    a = a * a % mod;
    n >>= 1;
  }
  return res;
}

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

  ll H, W, N;
  cin >> H >> W >> N;

  set<pair<ll, ll>> st;

  rep(i, N){
    ll a, b;
    cin >> a >> b;
    a--;
    b--;
    st.insert(make_pair(a, b));
  }

  set<pair<ll, ll>> center_st;
  vector<ll> ans(10);
  rep(i, 10) ans[i] = 0;

  for(auto itr = st.begin(); itr != st.end(); itr++){

    ll a = itr->first;
    ll b = itr->second;

    // 中央の候補
    for(int i = -1; i < 2; i++){
      for(int j = -1; j < 2; j++){
        
        ll ca = a + i;
        ll cb = b + j;

        if(ca <= 0 || ca >= (H-1) || cb<= 0 || cb >= (W-1)) continue;
        if(center_st.find(make_pair(ca, cb)) != center_st.end()) continue;

        ll tmp = 0;
        for(int ii = -1; ii < 2; ii++){
          for(int jj = -1; jj < 2; jj++){
            if(st.find(make_pair(ca+ii, cb+jj)) != st.end()){
              tmp++;
            }
          }
        }
        center_st.insert(make_pair(ca, cb));
        // cout << "researched: " << ca << " " << cb << endl;
        ans[tmp]++;
      }
    }
  }

  ll anssum19 = 0;
  rep(i, 10){
    anssum19 += ans[i];
  }

  ans[0] = (H-2) * (W-2) - anssum19;

  rep(i, 10){
    cout << ans[i] << endl;
  }

  return 0;
}


Measured memory_bytes: 62720
import java.util.ArrayList;
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);

		int n = sc.nextInt();
		ArrayList<Integer>array = new ArrayList<Integer>();
		long ans = 0;

		for(int i=1 ; i<=n ; i++ ) {
			if(i%3 != 0 && i%5 != 0) {
				array.add(i);
			}
		}

		for(int i=0 ; i<array.size() ; i++) {
			ans += array.get(i);
		}

		System.out.println(ans);

		sc.close();


	}

}


Measured memory_bytes: 61404
#include <bits/stdc++.h>
using namespace std;
using ll=long long;
using vb=vector<bool>;
using vvb=vector<vb>;
using vd=vector<double>;
using vvd=vector<vd>;
using vi=vector<int>;
using vvi=vector<vi>;
using vl=vector<ll>;
using vvl=vector<vl>;
using pii=pair<int,int>;
using pll=pair<ll,ll>;
using tll=tuple<ll,ll>;
using tlll=tuple<ll,ll,ll>;
using vs=vector<string>;

#define all(a) a.begin(),a.end()
#define rall(a) a.rbegin(),a.rend()
#define rep(i,n) range(i,0,n)
#define rrep(i,n) for(int i=(n)-1;i>=0;i--)
#define range(i,a,n) for(int i=(a);i<(n);i++)

#define LINF ((ll)1ll<<60)
#define INF ((int)1<<30)
#define EPS (1e-9)
#define MOD (1000000007ll)
#define fcout(a) cout<<setprecision(a)<<fixed
#define fs first
#define sc second
#define PI 3.1415926535897932384

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

template<class T>bool chmax(T&a,T b){if(a<b){a=b; return true;}return false;}
template<class T>bool chmin(T&a,T b){if(a>b){a=b; return true;}return false;}
template<class S>S acm(vector<S>&a){return accumulate(all(a),S());}
template<class S>S max(vector<S>&a){return *max_element(all(a));}
template<class S>S min(vector<S>&a){return *min_element(all(a));}
void YN(bool b){cout<<(b?"YES":"NO")<<"\n";}
void Yn(bool b){cout<<(b?"Yes":"No")<<"\n";}
void yn(bool b){cout<<(b?"yes":"no")<<"\n";}

ll max(int a,ll b){return max((ll)a,b);} ll max(ll a,int b){return max(a,(ll)b);}
template<class T>void puta(T&&t){cout<<t<<"\n";}
template<class H,class...T>void puta(H&&h,T&&...t){cout<<h<<' ';puta(t...);}
template<class S,class T>ostream&operator<<(ostream&os,pair<S,T>p){os<<"["<<p.first<<", "<<p.second<<"]";return os;};
template<class S>auto&operator<<(ostream&os,vector<S>t){bool a=1; for(auto s:t){os<<(a?"":" ")<<s;a=0;} return os;}

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll k,x;
	cin>>k>>x;
	vl ans;
	for(int i=x-k+1;i<x+k;i++)ans.push_back(i);
	cout<<ans<<endl;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define SORT(x) sort(x.begin(),x.end())
#define ALL(x) x.begin(),x.end()
#define rep(i, n) for(int i = 0; i < n; i++)
#define reps(i, m, n) for(int i = m; i < n; i++)
#define repr(i, m, n) for(int i = m; i >= n; i--)
#define INF (1e9)
#define PI (acos(-1))
#define MOD 1000000007
using namespace std;
typedef long long ll;

void Main(){

  int M,N;

  cin>>N>>M;

  string A[N];
  string B[M];

  rep(i,N){
    string s;
    cin>>s;
    A[i]=s;
  }
  rep(i,M){
    string s;
    cin>>s;
    B[i]=s;
  }

  rep(i,N-M+1){
    rep(j,N-M+1){
      bool update=true;
      rep(k,M){
        rep(l,M){
          if(A[i+k][j+l]!=B[k][l]) update=false;
        }
      }
      if(update){
        cout << "Yes" <<"\n";
        return;
      }
    }
  }
  cout << "No" <<"\n";

}
//-----------------------------------
int main(){
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  cout << fixed << setprecision(15);
  Main();
}
//-----------------------------------


Measured memory_bytes: 256
ii = lambda : int(input())
mi = lambda : map(int,input().split())
li = lambda : list(map(int,input().split()))

n = ii()

cnt = 0
for i in range(n,16,-1):
    if(i % 2 == 0):
        continue

    cnt2 = 0
    for j in range(3,i+1):
        if(i%j == 0):
            cnt2 +=1
    
    if cnt2 == 7:
        cnt += 1

print(cnt)

Measured memory_bytes: 3064
#include "bits/stdc++.h"
// Begin Header {{{
#define all(x)          (x).begin(), (x).end()
#define rep(i, n)       for (i64 i = 0, i##_limit = (n); i < i##_limit; ++i)
#define reps(i, s, t)   for (i64 i = (s), i##_limit = (t); i <= i##_limit; ++i)
#define repr(i, s, t)   for (i64 i = (s), i##_limit = (t); i >= i##_limit; --i)
#define var(Type, ...)  Type __VA_ARGS__; input(__VA_ARGS__)
#ifndef DBG
#define trace(...)
#endif
using namespace std;
using i64 = int_fast64_t;
using pii = pair<i64, i64>;
template <class T, class U> inline bool chmax(T &a, const U &b) { return b > a && (a = b, true); }
template <class T, class U> inline bool chmin(T &a, const U &b) { return b < a && (a = b, true); }
inline i64  sigma(i64 n)            { return (n * (n + 1) >> 1); }
inline i64  updiv(i64 a, i64 b)     { return (a + b - 1) / b; }
inline i64  sqr(i64 n)              { return n * n; }
inline string to_string(char c)     { return string(1, c); }
constexpr int INF  = 0x3f3f3f3f;
constexpr i64 LINF = 0x3f3f3f3f3f3f3f3fLL;

template <class T>
inline vector<T> make_v(const T &initValue, size_t sz) {
    return vector<T>(sz, initValue);
}
template <class T, class... Args>
inline auto make_v(const T &initValue, size_t sz, Args... args) {
    return vector<decltype(make_v<T>(initValue, args...))>(sz, make_v<T>(initValue, args...));
}

inline void input() {}
template <class Head, class... Tail>
inline void input(Head &head, Tail&... tail) { cin >> head; input(tail...); }

inline void print() { cout << "\n"; }
template <class Head, class... Tail>
inline void print(Head &&head, Tail&&... tail) {
    cout << head;
    if (sizeof...(tail)) cout << ' ';
    print(forward<Tail>(tail)...);
}

template <class T>
inline ostream& operator<< (ostream &out, const vector<T> &vec) {
    static constexpr const char *delim[] = { " ", "" };
    for (const auto &e : vec) out << e << delim[&e == &vec.back()];
    return out;
}

template <typename Func>
struct FixPoint : Func {
    inline constexpr FixPoint(Func &&f) noexcept : Func(forward<Func>(f)) {}

    template <typename... Args>
    inline decltype(auto) operator()(Args &&... args) const {
        return Func::operator()(*this, forward<Args>(args)...);
    }
};

template< typename Func >
inline decltype(auto) makeFixPoint(Func &&f) {
    return FixPoint< Func >{forward< Func >(f)};
}
// }}} End Header

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

    var(int, N);

    cout << fixed << setprecision(12);
    print(double((N + 1) / 2) / N);

    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
int main() {
  int a, b, c, d;
  cin >> a >> b >> c >> d;
  if (a + b > c + d) {
    cout << "Left" << endl;
  }
  else if (a + b < c + d) {
    cout << "Right" << endl;
  }
  else {
    cout << "Balanced" << endl;
  }
}

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

int main() {
    int N;
    cin >> N;
    vector<pair<ll, int>> a(N);
    for (int i = 0; i < N; i++) {
        ll n;
        scanf("%lld", &n);
        a[i] = {n, i};
    }
    sort(a.begin(), a.end());
    ll low = 0;
    int high_index = 0;
    vector<bool> check(N, false);
    vector<ll> ans(N, 0);
    ll cnt = 0;
    for (int t = 0; t < N; t++) {
        int pos = a[t].second;
        ll h = a[t].first;
        check[pos] = true;
        cnt += h - low;
        if (pos == high_index) {
            ans[pos] += cnt;
            ans[pos] += (N-1-t)*(h-low);
            low = h;
            cnt = 0;
            while (check[high_index]) high_index++;
        }
    }
    
    for (int i = 0; i < N; i++) printf("%lld\n", ans[i]);
    
    return 0;
}

Measured memory_bytes: 3456
N = int(input())
L = list(map(int, input().split()))
ans = 0
for i in range(N):
    for j in range(i+1,N):
        for k in range(j+1,N):
            if L[i]+L[j]>L[k] and L[j]+L[k]>L[i] and L[k]+L[i]>L[j]:
                if L[i] != L[j] and L[j] != L[k] and L[k] != L[i]:
                    ans += 1
print(ans)

Measured memory_bytes: 68312
#include <iostream>
#include <string>
#include <vector>
#include <utility>
#include <functional>
#include <numeric>
#include <list>
#include <set>
#include <map>
#include <algorithm>
#include <cmath>
#include <limits>
#include <iomanip>
#include <bitset>
#include <queue>
#include <unordered_set>
#include <unordered_map>
#include <stdio.h>

#define rep(i,n) repi(i,0,n)
#define repi(i,a,b) for(int i=int(a);i<int(b);++i)
#define per(i,a,n) for (int i=n-1;i>=a;i--)
#define all(x) (x).begin(),(x).end()
#define SZ(x) ((int)(x).size())
#define INPUT1(n, a) for(int i##n = 0; i##n < n; i##n++) {cin >> a[i##n]; } //n = count, a = vector 
#define OUTPUT1(n, a) cout << "---count---" << endl << n << endl << "---content---" << endl; for(const auto b : a){cout << b << endl; }
#define INPUT2(x, y, field) for(int i##x = 0; i##x < y; i##x++) { for(int j##x = 0; j##x < x; j##x++) { cin >> field[i##x][j##x]; } }
#define OUTPUT2(x, y, field) cout << "---count---" << endl << x << " " << y << endl <<"---content---" << endl; for(int i##x = 0; i##x < y; i##x++) { cout << i##x << "   "; for(int j##x = 0; j##x < x; j##x++) { cout << field[i##x][j##x] << " "; } cout << endl; }

using namespace std;
using ll = long long;

const int INF = 1001001001;

int main()
{
	string s = "";
	int flag(0);
	
	cin>>s;
	
	if(s.length()%2 != 0 || s[0] != 'h'){
	    cout<<"No";
	    return 0;
	}else{
	    repi(i, 1, s.length()){
	        if(flag == 0){
	            if(s[i] != 'i'){
	                cout<<"No";
	                return 0;
	            }else{
	                flag = 1;
	            }
	        }else{
	            if(s[i] != 'h'){
	                cout<<"No";
	                return 0;
	            }else{
	                flag = 0;
	            }
	        }
	    }
	    
	    if(flag == 1){
	        cout<<"Yes";
	    }else{
	        cout<<"No";
	    }
	}
}


Measured memory_bytes: 256
// Author : MohamedSameh
#include <bits/stdc++.h>
typedef long long ll ;
#define pb push_back
#define f first
#define s second
#define all(v) v.begin(),v.end()
#define rall(v) v.rbegin(),v.rend()
#define SZ(a) (int)a.size()
#define IN(n) scanf("%d" , &n )
void fo (){fflush(stdout);}
using namespace std;
ll fact (int x ){return (x <= 1 ? 1 : 1LL * x * fact (x-1));}
string a [50], b[50] ;
int n , m ;
bool ok (int x , int y )
{
  for (int i = x , ro = 0 ; i - x < m ;ro++ , i++)
  {
    for (int j = y , col = 0 ; j - y < m ;col++ , j++)
    {
      if (a[i][j] != b[ro][col])return false ;
    }
  }
  return  true ;
}
int main ()
{
  cin >> n >> m ;
  for (int i =0 ; i < n ;i++)cin >> a[i];
  for (int i =0 ; i < m ;i++)cin >> b[i];

  for (int i =0 ; i + m <=  n ;i++)
  {
    for (int j =0 ; j + m <=  n ;j++)
    {
      if (ok(i , j ))
      {
        cout <<"Yes\n";
        return 0 ;
      }
    }
  }
  cout <<"No\n";
  cerr << 1000 * clock() / CLOCKS_PER_SEC << "ms\n";
  return 0;
}

Measured memory_bytes: 256
MOD = 10**9 + 7
def divisors(n)
  p = []
  2.upto((n**0.5)) do |i|
    break if i > n / i
    while n % i == 0
      p << i
      n /= i
    end
  end
  p << n if n != 1
  p
end
n = gets.to_i
bucket = Array.new(n+1,0)
2.upto(n) do |i|
  divisors(i).each do |x|
    bucket[x] += 1
  end
end
ans = 1
2.upto(n) do |i|
  ans *= (bucket[i]+1)
  ans %= MOD
end
puts ans

Measured memory_bytes: 14672
#include <iostream>
#include <assert.h>
#include <vector>
#include <unordered_map>
#include <queue>
#include <climits>
#include <cmath>
#include <algorithm>
using namespace std;
constexpr int64_t MOD = 1e9 + 7;

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

  int32_t N;
  cin >> N;
  string S;
  cin >> S;

  vector<int> R_idx;
  vector<int> G_idx;
  vector<int> B_idx;
  for (int i = 0; i < N; i++) {
    if (S[i] == 'R') {
      R_idx.push_back(i);
    } else if (S[i] == 'G') {
      G_idx.push_back(i);
    } else {
      B_idx.push_back(i);
    }
  }

  int64_t res = 0;
  for (int i = 0; i < N; i++) {
    for (int j = i + 1; j < N; j++) {
      char ci = S[i];
      char cj = S[j];
      if (ci == cj) continue;
      vector<int>* tgt_c;
      if (ci != 'R' && cj != 'R') {
        tgt_c = &R_idx;
      } else if (ci != 'G' && cj != 'G') {
        tgt_c = &G_idx;
      } else {
        tgt_c = &B_idx;
      }
      int num_k = tgt_c->end() - upper_bound(tgt_c->begin(), tgt_c->end(), j);
//      cout << i << "," << j << "," << num_k << endl;
      if (num_k == 0) continue;
      res += num_k;
      int diff = j - i;
      if (j + diff < N) {
        char exk_char = S[j + diff];
        if (exk_char != ci && exk_char != cj) res--;
      }
    }
  }
  cout << res << endl;

  return 0;
}


Measured memory_bytes: 3656
#include <bits/stdc++.h> 
using namespace std; 
#define io ios_base::sync_with_stdio(false); cin.tie(NULL); cout.tie(NULL);
#define rep(i,n) for (int i = 0; i < (n); ++i)

int main(void) {
    io;
    int a, b; cin >> a >> b;
    cout << (a + (b+1))/2;
    return 0;
}



Measured memory_bytes: 3608
#include <bits/stdc++.h>
#define pr(s) std::cout << s << std::endl
#define prb(s) std::cout << s
using namespace std;



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


  long long int n;
  long long int min = 9223372036854775807;
  cin >> n;
  for (int i = 0; i < 5; i++) {
    long long int buf;
    cin >> buf;
    if (buf < min) {
      min = buf;
    }
  }
  if (n % min == 0) pr(n / min + 4);
  else pr(n / min + 5);



  return 0;
}


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

typedef long long ll;
typedef pair<int, int> P;

#define pb push_back
#define in ,
#define rep(i, a, n) for(int i = (a); i < (n); i++)
#define dep(i, a, n) for(int i = (a); i >= (n); i--)
#define mod 1e9+7

__attribute__((constructor))
void initial() {
  cin.tie(0);
  ios::sync_with_stdio(false);
}

int main() {
  ll a, b, c;
  cin >> a >> b >> c;
  if(a % 2 == 0 || b % 2 == 0 || c % 2 == 0) {
    cout << 0 << endl;
    return 0;
  }

  cout << min(a * b, min(a * c, b * c)) << endl;
}


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

int main(){
  int H,W;
  cin >> H>>W;
  
  vector<string> A(H);
  rep(i,0,H) cin >>A[i];
  
  vector<bool> row(H, false);
  vector<bool> col(W, false);
  
  rep(i,0,H){
    rep(j,0,W){
      if(A[i][j]=='#'){
        row[i] = true;
        col[j] = true;
      }
    }
  }

  rep(i,0,H){
    if(row[i]){
      rep(j,0,W){
        if (col[j]) cout << A[i][j];
       }
      cout << endl;
    }
  }
}

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

#define INTINF 1999999999
#define REP(i,n) for(int i=0;i<n;i++)
#define REP1(i,n) for(ll i=1;i<=n;i++)
#define MODA 1000000007 

int main() {
	ll ans = INTINF;
	int tmp;
	int h, w, d;
	cin >> h >> w >> d;
	int mp[h][w], x[h*w+1], y[h*w+1], rui[h*w+1];
	REP(i, h){
		REP(j, w){
			cin >> mp[i][j];
			x[mp[i][j]] = i;
			y[mp[i][j]] = j;
		}
	}
	REP(i, h*w+1){
		if(i-d<0) rui[i] = 0;
		else rui[i] = rui[i-d] + abs(x[i-d] - x[i]) + abs(y[i-d] - y[i]);
	}
	int q, l, r;
	cin >> q;
	REP(i,q){
		cin >> l >> r;
		cout << rui[r] - rui[l] << endl;
	}
}


Measured memory_bytes: 5012
# -*- coding: utf-8 -*-
n = int(raw_input())
S = [raw_input() for i in xrange(n)]
cnt = [10**9]*28
for s in S:
    for i in xrange(27):
        cnt[i] = min(cnt[i], s.count(chr(ord("a") + i)))
for i in xrange(27):
    cnt[i] = cnt[i] if cnt[i] < 10**9 else 0
ans = ""
for i in xrange(27):
    ans += chr(ord("a") + i)*cnt[i]
print ans


Measured memory_bytes: 2568
#include <iostream>
#include <vector>
#include <string>
#include <algorithm>
#include <cmath>
#include <iomanip>
#include <map>

using namespace std;

int main() {
	int N;
	cin >> N;
	vector<int> B(N);
	for (int i = 0; i < N - 1; i++) cin >> B[i];
	int ans = B[0] + B[N - 2];
	for (int i = 1; i < N - 1; i++) {
		ans += min(B[i], B[i - 1]);
	}
	cout << ans << endl;
	return 0;
}

Measured memory_bytes: 3560
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> P;
const ll MOD = 1000000007;
const int IINF = INT_MAX;
const ll LLINF = LLONG_MAX;
const int MAX_N = int(5e5 + 5);
const double EPS = 1e-10;
const int di[] = {0, 1, 0, -1}, dj[] = {1, 0, -1, 0};
#define REP(i, n) for (int i = 0; i < n; i++)
#define REPR(i, n) for (int i = n; i >= 0; i--)
#define SORT(v) sort((v).begin(), (v).end())
#define ALL(v) (v).begin(), (v).end()

int main() {
    int n, m, ans=0;
    cin >> n;
    m = int(log10(n))+1;
    for(int i=3; i<=m; i++){
        int l=int(pow(3,i));
        REP(j,l){
            bool f[3]{}, ok = true;
            int b = 1, tmp=0;
            REP(k,i){
                tmp *= 10;
                if(j/b%3==0){
                    tmp += 3;
                    f[0] = true;
                }
                else if(j/b%3==1){
                    tmp += 5;
                    f[1] = true;
                }
                else{
                    tmp += 7;
                    f[2] = true;
                }
                b *= 3;
            }
            ok &= n>=tmp;
            REP(k,3) ok &= f[k];
            if(ok)ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
#define rep(i,a,b) for(int i=a;i<b;i++)
#define rrep(i,a,b) for(int i=a;i>=b;i--)
#define fore(i,a) for(auto &i:a)
#define all(x) (x).begin(),(x).end()
//#pragma GCC optimize ("-O3")
using namespace std; void _main(); int main() { cin.tie(0); ios::sync_with_stdio(false); _main(); }
typedef long long ll; const int inf = INT_MAX / 2; const ll infl = 1LL << 60;
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 MAX_N = 300;
const int MAX_A = 300;
const int MAX_L = MAX_A * MAX_N;
ll dp[MAX_N + 1][MAX_L + 1];
const ll MOD = 998244353;
//------------------------------------------------------------------------------
void Update(ll& a, const ll b)
{
    a = (a + b) % MOD;
}

void _main()
{
    int N;
    cin >> N;
    vector<int> a(N);
    int sum = 0;
    rep(i, 0, N)
    {
        cin >> a[i];
        sum += a[i];
    }

    ll ans = 1;
    rep(i, 0, N)
    {
        ans = (ans * 3) % MOD;
    }

    dp[0][0] = 1;
    rep(i, 0, N)
    {
        rep(j, 0, MAX_L + 1)
        {
            if (dp[i][j] == 0) continue;

            // R
            Update(dp[i + 1][j + a[i]], dp[i][j]);

            // G
            Update(dp[i + 1][j], dp[i][j]);

            // B
            Update(dp[i + 1][j], dp[i][j]);
        }
    }

    rep(i, (sum + 1) / 2, MAX_L + 1)
    {
        ans -= dp[N][i] * 3;
        while (ans < 0) ans += MOD;
    }

    if (sum % 2 == 0)
    {
        rep(i, 0, MAX_N + 1)
        {
            rep(j, 0, MAX_L + 1)
            {
                dp[i][j] = 0;
            }
        }

        dp[0][0] = 1;
        rep(i, 0, N)
        {
            rep(j, 0, MAX_L + 1)
            {
                if (dp[i][j] == 0) continue;
                
                // R
                Update(dp[i + 1][j + a[i]], dp[i][j]);

                // G
                Update(dp[i + 1][j], dp[i][j]);
            }
        }

        ans += dp[N][sum / 2] * 3;
        ans %= MOD;
    }

    cout << ans << endl;
}


Measured memory_bytes: 211968
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#pragma warning(disable:4996)
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <math.h>
#include <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <stack>
#include <queue>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <list>
#include <set>
#include <ctime>
#define rep(i,n) for (int i = 0; i < (n); ++i)
using namespace std;
typedef long long ll;

const int INF = 100000000;
const int MAX_M = 100000;



int main(int argc, char *args[]) {
	int n, m;
	cin >> n >> m;
	if (n >= m) {
		cout << 0 << endl;
		return 0;
	}
	int X[MAX_M];
	int y[MAX_M];
	for (int i = 0; i < m; i++) {
		cin >> X[i];
	}
	sort(X, X + m);
	for (int i = 0; i < m - 1; i++) {
		y[i] = X[i + 1] - X[i];
	}
	sort(y, y + m - 1, greater<int>());
	int ans = X[m - 1] - X[0];
	for (int i = 0; i < n - 1; i++) {
		ans -= y[i];
	}
	cout << ans << endl;

}

Measured memory_bytes: 1024
#include <cstdio>
#include <cstdint>
#include <cmath>
#include <iostream>
#include <algorithm>
#include <array>
#include <vector>
#include <unordered_map>

struct Node {
    Node() :
        parent(nullptr),
        id(0),
        depth(0),
        childs()
    {
    }

    Node* parent;
    int id;
    int depth;
    std::vector<Node*> childs;
};

void printNodes(const Node* nodes, int n)
{
    for (int i = 0; i < n; ++i) {
        const Node& node = nodes[i];
        std::printf("node %d: ", node.id);
        std::printf("parent = %d, ", (node.parent == nullptr) ? -1 : node.parent->id);
        std::printf("depth = %d, ", node.depth);
        if (node.parent == nullptr) {
            std::printf("root, ");
        } else if (node.childs.size() == 0) {
            std::printf("leaf, ");
        } else {
            std::printf("internal node, "); }

        std::printf("[");
        for (int j = 0; j < node.childs.size(); ++j) {
            if (j != 0) {
                std::printf(", ");
            }
            std::printf("%d", node.childs[j]->id);
        }

        std::printf("]\n");
    }
}

void setDepth(Node& node, int d)
{
    node.depth = d;
    for (int i = 0; i < node.childs.size(); ++i) {
        setDepth(*(node.childs[i]), d + 1);
    }
}

int main()
{
    int n;
    std::scanf("%d", &n);
    Node nodes[n];

    int id, k, c;
    for (int i = 0; i < n; ++i) {
        std::scanf("%d %d", &id, &k);
        nodes[id].id = id;
        for (int j = 0; j < k; ++j) {
            std::scanf("%d", &c);
            nodes[c].parent = &(nodes[id]);

            nodes[id].childs.push_back(&nodes[c]);
        }
    }

    for (int i = 0; i < n; ++i) {
        if (nodes[i].parent == nullptr) {
            setDepth(nodes[i], 0);
            break;
        }
    }

    printNodes(nodes, n);

    return 0;
}


Measured memory_bytes: 8312
#include<bits/stdc++.h>
using namespace std;
int main()
{long long n,x,t,y,i;
 cin>>n;long long a[n];y=0;
 for(i=0;i<n;i++){cin>>a[i];}x=a[0];
for(i=0;i<n;i++)
{if(a[i]>=x)x=a[i];
else y=y+x-a[i];}
cout<<y;
return 0;}

Measured memory_bytes: 5140
x=int(input())
if(x>=400 and x<=599):
  print("8")
elif(x>=600 and x<=799):
  print("7")
elif(x>=800 and x<=999):
  print("6")
elif(x>=1000 and x<=1199):
  print("5")
elif(x>=1200 and x<=1399):
  print("4")
elif(x>=1400 and x<=1599):
  print("3")
elif(x>=1600 and x<=1799):
  print("2")
elif(x>=1800 and x<=1999):
  print("1")
	


Measured memory_bytes: 9192
#include<bits/stdc++.h>
    #define int long long
    #define endl '\n'
    using namespace std;
    clock_t time_p = clock();
    void time()
    {
      time_p = clock() - time_p;
      cerr << "Time elapsed : " << (double)(time_p)/CLOCKS_PER_SEC <<endl;
    }
    bool sortbysec(pair<int,int>&a,pair<int,int>&b)
    {
         if(a.first!=b.first)
         return a.second<b.second;
       return a.first<b.first;
    }
    signed main()
    {
         ios_base::sync_with_stdio(false);
         cin.tie(NULL);
         cout.tie(NULL);
         int n;
         cin>>n;
         vector<pair<int,int> >v;
         for(int i=0;i<n;i++)
         {
             int x,l;
             cin>>x>>l;
             v.emplace_back(make_pair(x+l,x-l));
         }
         sort(v.begin(),v.end());
         int res=0;
         int current=-1e18;
         for(int i=0;i<n;i++)
         {
                if(current<=v[i].second)
                {
                       res++;
                       current=v[i].first;
                }
         }
         cout<<res<<endl;
         time();
         return 0;
    }

Measured memory_bytes: 2420
from collections import deque
import sys
sys.setrecursionlimit(10**6)
def dfs(x,y):
    c[x][y] = 0
    for dx in range(-1,2):
        for dy in range(-1,2):
            nx = x + dx
            ny = y + dy

            if 0 <= nx  <  h and 0 <= ny  < w and c[nx][ny] == 1:
                dfs(nx,ny)
    
while 1:
    w,h = map(int,input().split())
    if w == 0 and h == 0:
        break
    c = [list(map(int,input().split())) for i in range(h)]
    cnt = 0
    for i in range(h):
        for j in range(w):
            if c[i][j] == 1:
                dfs(i,j)
                cnt += 1
    print(cnt)


Measured memory_bytes: 8372
import java.util.*;

public class Main {
	
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		int n = sc.nextInt();
		ArrayList<String> list = new ArrayList<String>();
		char last = 'X';
		boolean flag = true;
		for (int i = 0; i < n; i++) {
			String s = sc.next();
			if (list.contains(s)) {
				flag = false;
				break;
			} else {
				list.add(s);
			}
			if (i != 0 && s.charAt(0) != last) {
				flag = false;
				break;
			}
			last = s.charAt(s.length() - 1);
		}
		if (flag) {
			System.out.println("Yes");
		} else {
			System.out.println("No");
		}
	}
	
}

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

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

    if (s[0] == s[1] && s[0] == s[2] || s[1] == s[2] && s[1] == s[3]) {
        cout << "Yes" << endl;
    } else {
        cout << "No" << endl;
    }

    return 0;
}

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

#define IOS ios_base::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define deb(x)	cout << #x << " " << x << endl;

typedef long long int ll;

vector<int> findAllPrimes(int N) {
	bool is_comp[N] = {0};
	vector<int> p;

	for (int i = 2; i*i < N; i++) {
		if (is_comp[i])
			continue;

		p.push_back(i);
		for (int k = 2; i*k < N; k++)
			is_comp[i*k] = true;
	}

	for (int x: p)
		cout << x << ", ";
	cout << endl;

	return p;
}


vector<int> get_factors(int n) {
	// deb(n);

	vector<int> f;
	if (n%2 == 0) {
		f.push_back(2);
		while (n%2 == 0)
			n /= 2;
	}

	for (int i = 3; i*i <= n; i+=2) {
		if (n%i == 0) {
			f.push_back(i);
			while (n%i == 0)
				n /= i;
		}
	}

	if (n > 2)
		f.push_back(n);

	// for (int x: f)
	// 	cout << x << ", ";
	// cout << endl;

	return f;
}

int main() {

	IOS

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

	int g = a[0];
	for (int i = 1; i < n && g > 1; i++)
		g = __gcd(g, a[i]);

	if (g > 1) {
		cout << "not coprime";

	} else {
		unordered_set<int> st;
		bool setws = false;

		for (int i = 0; i < n && !setws; i++) {
			for (auto &x: get_factors(a[i])) {
				if (st.find(x) != st.end()) {
					setws = true;
					break;
				}

				st.insert(x);
			}
		}	

		cout << (setws ? "setwise coprime" : "pairwise coprime");

	}

	return 0;
}

Measured memory_bytes: 7568
#define _CRT_SECURE_NO_WARNINGS
#include "bits/stdc++.h"
using namespace std;
#define rep(i, n) for(int i=0; i<(n); ++i)
#define FOR(i, m, n) for(int i=(m); i<(n); ++i)
#define sz(x) ((int)(x).size())
#define all(x) (x).begin(),(x).end()
#define mp make_pair
#define pb push_back
#define Cout(x) cout << (x) << endl
#define Cout2(x, y) cout << (x) << " " << (y) << endl
#define dump(x) cout << #x << " = " << (x) << endl;
#define forauto(i, a) for(auto i : a)cout << i << " "; puts("");
typedef long long LL;
typedef vector<int> VI;
typedef vector<LL> VL;
typedef vector<string> VS;
typedef vector<bool> VB;
typedef vector<vector<int>> VVI;
typedef pair<int, int> PII;
const int inf = 1e9;
const double pi = acos(-1.0);

int re(string s) {
	int ret = 0;

	int i = 0;
	while (i < sz(s)) {
		if (isdigit(s[i])) {
			int num = 0;
			while (i < sz(s) && isdigit(s[i])) {
				//cout << i << ":" << s[i] - '0' << endl;
				num = num * 10 + (s[i] - '0');
				i++;
			}
			ret += num;
		}
		else {
			i++;
		}
	}

	return ret;
}

int main() {
	int ans = 0;

	string s;
	while (cin >> s) {
		ans += re(s);
	}

	Cout(ans);
}


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

using namespace std;

typedef pair<int, int> II;
typedef vector<II> VII;
typedef vector<int> VI;
typedef vector<VI> VVI;

typedef long long int LL;

#define PB push_back
#define MP make_pair
#define F first
#define S second
#define SZ(a) (int)(a.size())
#define ALL(a) a.begin(), a.end()
#define SET(a, b) memset(a, b, sizeof(a))
#define si(n) scanf("%d", &n)
#define dout(n) printf("%d\n", n)
#define sll(n) scanf("%lld", &n)
#define lldout(n) printf("%lld\n", n)

#define TRACE

#ifdef TRACE
#define trace(...) __f(#__VA_ARGS__, __VA_ARGS__)
template <typename Arg1>
void __f(const char *name, Arg1 &&arg1) {
  cerr << name << " : " << arg1 << std::endl;
}
template <typename Arg1, typename... Args>
void __f(const char *names, Arg1 &&arg1, Args &&... args) {
  const char *comma = strchr(names + 1, ',');
  cerr.write(names, comma - names) << " : " << arg1 << " | ";
  __f(comma + 1, args...);
}
#else
#define trace(...)
#endif

#define fast_io                     \
  ios_base::sync_with_stdio(false); \
  cin.tie(NULL)

#define endl '\n'

int main() {
  fast_io;
  int n;
  cin >> n;
  vector<LL> x(n);
  for (int i = 0; i < n; i++) cin >> x[i];
  sort(ALL(x));
  LL a, b;
  a = b = -1;
  for (int i = n - 1; i >= 0;) {
    int cc = upper_bound(ALL(x), x[i]) - lower_bound(ALL(x), x[i]);
    int c = cc;
    if (c >= 2 && a == -1) a = x[i], c -= 2;
    if (c >= 2 && b == -1) b = x[i], c -= 2;
    i -= cc;
  }
  if (b < 0) a = 0;
  cout << a * b << endl;
  return 0;
}


Measured memory_bytes: 1024
#include <cstdio>
#include <vector>

long long magic = 1000 * 1000 * 1000 + 7;

int main()
{
  long long n;
  scanf("%lld\n", &n);
  std::vector<long long> table(256, 1);
  for (long long i = 0; i < n; i++) {
    char ch = getchar();
    table.at(ch)++;
  }
  long long res = 1;
  for (const auto& x : table) {
    res = (res * x) % magic;
  }
  printf("%lld\n", res-1);
  return 0;
}


Measured memory_bytes: 256
#include <stdio.h>
int main (void)
{
   int n,m,i,s;
   int a[10010];
   scanf("%d%d",&n,&m);
   for(i=0;i<m;i++)scanf("%d",&a[i]);
   s = 0;
   for(i=0;i<m;i++)s+=a[i];
   if(s>n){
      printf("-1\n");
   }
   else{
      printf("%d\n",n-s);
   }
   return 0;
}


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

int main() {
  vector<vector<int>> data(3,vector<int>(3,0));
  int b_1,b_2,b_3 = 0;
  int counter;
  bool information = false;


  for(int i = 0;i < 3;i++){
    for(int j = 0;j < 3;j++){
      cin >> data[i][j];
    }
  }

  for(int i = 0;i <= data[0][0];i++){
    b_1 = data[0][0] - i;
    b_2 = data[0][1] - i;
    b_3 = data[0][2] - i;
    for(int j = 1;j < 3;j++){
      if(data[j][0] - b_1 == data[j][1] - b_2 && data[j][1] - b_2 == data[j][2] - b_3)counter++;
    }
    if(counter == 2){
      information = true;
      break;
    }
    counter = 0;
  }

  if(information == true)cout<< "Yes" << endl;
  else cout << "No" <<endl;
 
}

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


#define f(i,a,b) for(int i=(int)(a);i<=(int)(b);i++)
#define char_f(i,a) for(int i=(int)(a);(char)s[i]!='\0';i++)
#define rf(i,a,b) for(int i=(int)(a);i>=(int)(b);i--)
#define llf(i,a,b) for(long long int i=(long long int)(a);i<=(long long int)(b);i++)
#define llrf(i,a,b) for(long long int i=(long long int)(a);i>=(long long int)(b);i--)



#define ll long long
#define fi first
#define se second
#define pb push_back
#define pob pop_back
#define mem(ara) memset((ara),0,sizeof(ara))
#define memn(ara) memset((ara),-1,sizeof(ara))
#define bb begin()
#define ee end()
#define em emplace
#define eb emplace_back





#define si set<int>
#define sd set<double>
#define sll set<long long int>
#define ss set<string>
#define sc set<char>

#define pii pair<int,int>
#define pli pair<long long int,int>
#define pil pair<int,long long int>
#define pll pair<long long int,long long int>
#define pci pair<char,int>
#define pic pair<int,char>
#define pcl pair<char,long long int>
#define plc pair<long long int,char>

#define pss pair<string,string>
#define pcc pair<char,char>

#define pis pair<int,string>
#define psi pair<string,int>
#define pls pair<long long int,string>
#define psl pair<string,long long int>
#define pdd pair<double,double>
#define pcs pair<char,string>
#define psc pair<string,char>



#define vi  vector<int>
#define vll vector<long long int>
#define vd vector<double>
#define vs vector<string>
#define vc vector<char>
#define vii vector<pii>



#define mod 1000000007
#define mx (1<<30)-1
#define llmx (1ll<<62)
#define n_size 100005
#define g_size 10000005
double PI=acos(-1);
#define eps 1e-9



///unsigned int uMAX=4294967295;
///unsigned ll int ullMAX=18446744073709551615;





int arr[g_size];



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

	int n,m,T,res;

	int maxi=-mx,mini=mx,count=0;

	int i,j,k;

	bool flag;

	string s1,s2;

	char s[100000];

	int ara[n_size],ara2[n_size];

	cin>>n>>m>>k>>res;

	f(i,0,n){
        f(j,0,m)
        {
            f(l,0,k){
                if(i*500+j*100+l*50==res) count++;
            }
        }
	}

    cout<<count<<endl;

}


Measured memory_bytes: 256