akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <iomanip>
#include <string>
#include <cmath>
#include <numeric>
#include <climits>
#include <vector>
#include <list>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <stack>
#include <queue>
#include <deque>
#include <algorithm>
#include <functional>
#include <utility>
#include <cctype>
#include <iterator>
////////////////////////////////////////////////
#define REP(i, n) for (int i = 0; i < (int)n; i++)
#define FOR(i, m, n) for (int i = (int)m; i < (int)n; i++)
#define REPvec(itr, mp) for (auto itr = mp.begin(); itr != mp.end(); itr++)
#define REPe(e, mp) for (auto& e : mp)
#define all(x) x.begin(), x.end()
#define MOD 1000000007  // 1e9+7
using namespace std;
using ll = long long int;
using vecint = vector<int>;
using vecll = vector<ll>;
using vec2int = vector<vector<int>>;
using P = pair<int, int>;
////////////////////////////////////////////////
////////////////////////////////////////////////
int main() {
  ////////////////////////////////////////////////
  cin.tie(nullptr);
  ios_base::sync_with_stdio(false);
  ////////////////////////////////////////////////
  int n;
  cin >> n;
  if (n % 2 == 0) {
    int i = n;
    int j = n;
    int k = n / 2;
    cout << i << " " << j << " " << k << endl;
    return 0;
  }
  FOR(i, 1, 3501) {
    FOR(j, i, 3501) {
      ll x = (ll)n * (ll)i * (ll)j;
      ll y = 4LL * (ll)i * (ll)j - (ll)n * (ll)i - (ll)n * (ll)j;
      if (y > 0 && x / y > 0 && x % y == 0) {
        ll k = x / y;
        cout << i << " " << j << " " << k << endl;
        return 0;
      }
    }
  }
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
  int n,m,a,sum=0;
  cin>>n>>m;

  for(int i=0; i<m; i++){
    cin>>a;
    sum+=a;
  }
  if(sum>n)cout<<-1<<'\n';
  else cout<<n-sum<<'\n';
  
  return 0;
}


Measured memory_bytes: 3592
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Numerics;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using static System.Math;
public static class P
{
    public static void Main()
    {
        long n = int.Parse(Console.ReadLine()) - 1;

        long res = (n + 1) * (n * n + 5 * n + 6) / 6;
        for (int i = 0; i < n; i++)
        {
            var st = Console.ReadLine().Split().Select(x => int.Parse(x) - 1).OrderBy(x => x).ToArray();
            long lLength = st[0] + 1;
            long rLength = n - st[1] + 1;
            res -= lLength * rLength;
        }
        Console.WriteLine(res);
    }
}


Measured memory_bytes: 41596
def solve(m_list):
    min_val = m_list[0]
    # time O(N log(A))
    for m in m_list:
        min_val = min(min_val, gcd(min_val, m))
    return min_val


def gcd(a, b):
    while b:
        a, b = b, a % b
    return a


def main():
    n = int(input())
    m_list = list(map(int, input().split()))

    ans = solve(m_list)
    print(ans)


main()


Measured memory_bytes: 14252
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <cmath>
#include <stdio.h>
#include <queue>
#include <stack>
#include <climits>
#include <map>
#include <set>

using namespace std;

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

const ll mod = 1000000007;
const int inf = 1e9;
const long long INF = 1LL << 60;


int main()
{
    int n;
    cin >> n;
    vector<int> b;
    for(int i = 0; i < n; i++){
        int k; cin >> k;
        b.push_back(k);
    }
    vector<int> ans;
    for(int i = 0; i < n; i++){
        int s = b.size();
        bool change = false;
        for(int j = s-1; j >= 0; j--){
            if(b[j] == j+1){
                change = true;
                ans.push_back(b[j]);
                b.erase(b.begin()+j);
                break;
            }
        }
        if(!change){
            cout << -1 << endl;
            return 0;
        }
    }
    reverse(ans.begin(),ans.end());
    for(int i = 0; i < n; i++){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define f first
#define s second
using namespace std;
const int inf=1e18;
int32_t main(){
	if(fopen("input.txt", "r"))
	freopen("input.txt", "r", stdin),
	freopen("output.txt", "w", stdout);
	ios::sync_with_stdio(0),cin.tie(0);
	int h,w,k;
	cin >> h >> w >> k;
	string m[h];
	for(int i=0;i<h;i++)
		cin >> m[i];
	int ans=inf;
	for(int mask=0;mask<(1<<(h-1));mask++){
		int x=__builtin_popcount(mask);
		int a[x+1]={0},ok=1,cnt=x;
		for(int j=0;j<w;j++){
			int c[x+1]={0},p=0,mx=0;
			for(int i=0;i<h;i++){
				c[p]+=(int)(m[i][j]-'0');
				mx=max(mx,c[p]);
				if(mask&(1<<i))p++;
			}
			if(mx>k){ok=0;break;}
			mx=0;
			for(int i=0;i<=x;i++)
				mx=max(a[i]+c[i],mx);
			if(mx>k)memset(a,0,sizeof a),cnt++;
			for(int i=0;i<=x;i++)a[i]+=c[i];
		}
		if(ok)ans=min(ans,cnt);
	}
	cout << ans;
}

Measured memory_bytes: 256
#include<stdio.h>
int main(void){
    int A,B,C;
    scanf("%d %d %d",&A,&B,&C);
    if((A==B)&&(A!=C)&&(B!=C)||(A==C)&&(A!=B)&&(B!=C)||(B==C)&&(A!=C)&&(A!=B)){
        printf("Yes\n");
    }else if((A==B)||(A==C)||(B==C)||(A!=B)||(A!=C)&&(B!=C)){
        printf("No\n");
        }
    }

Measured memory_bytes: 128
from itertools import product
N = int(input())
ans = 0
for l in range(1, 11):
    for p in product("357", repeat=l):
        v = "".join(p)
        if "3" in v and "5" in v and "7" in v and int("".join(p)) <= N:
            ans += 1
print(ans)

Measured memory_bytes: 3060
#include<ctime>
#include<cmath>
#include<cstdio>
#include<cstring>
#include<iostream>
#include<algorithm>
#include<queue>
#include<vector>
#define file(x)freopen(x".in","r",stdin);freopen(x".out","w",stdout)
#define rt register int
#define l putchar('\n')
#define ll long long
#define r read()
using namespace std;
inline ll read(){
    ll x=0;char zf=1;char ch=getchar();
    while(ch!='-'&&!isdigit(ch))ch=getchar();
    if(ch=='-')zf=-1,ch=getchar();
    while(isdigit(ch))x=x*10+ch-'0',ch=getchar();return x*zf;
}
void write(ll y){if(y<0)putchar('-'),y=-y;if(y>9)write(y/10);putchar(y%10+48);}
void writeln(const ll y){write(y);putchar('\n');}
int k,m,n,x,y,z,cnt;
struct ed{
	int x,y;
}e[400010];
int fa[400010],size[400010];
ll ans[400010],now;
int ask(int x){
	return (x==fa[x])?x:(fa[x]=ask(fa[x]));
}
void unite(int x,int y){
	int p=ask(x),q=ask(y);
	if(p==q)return ;
	now-=1ll*size[p]*size[q];
	fa[p]=q;size[q]+=size[p];
}
int main(){
	n=r;m=r;
	for(rt i=1;i<=m;i++){
		e[i].x=r;e[i].y=r;
	}
	ans[m]=now=1ll*n*(n-1)/2;
	for(rt i=1;i<=n;i++)fa[i]=i,size[i]=1;
	for(rt i=m;i>=1;i--){
		unite(e[i].x,e[i].y);
		ans[i-1]=now;
	}
	for(rt i=1;i<=m;i++)writeln(ans[i]);
	return 0;
}


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

int main() {
	long a,b,x;
	cin >> a >> b >> x;
	double k,ans,pi=2*acos(0.0);
	cout << fixed << setprecision(8);
	if(x<=a*a*b/2){
		k=2.0*double(x)/double(a*b);
		cout << 90.0-(atan(k/b)*180.0/pi);
	}else{
		x=a*a*b-x;
		k=2.0*double(x)/double(a*a);
		cout << (atan(k/a)*180.0/pi);
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <algorithm>
#include <numeric>
typedef long long ll;
using namespace std;
int main(void){
  int n;
  while(cin>>n,n){
    vector<ll> c(n);
    for(int i=0;i<n;++i) cin>>c[i];
    sort(c.begin(),c.end());
    ll a,b;a=b=0;
    for(int i=0;i<n;++i){
    	a+=b;
    	b+=c[i];
    }
    cout<<a<<endl;
  }
  return 0;
}

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

int main(){
    int k;
    cin>>k;
    vector<ll> a;
    for(int i=1;i<=9;i++) a.push_back(i);

    while(1){
        if(k<=(int)a.size()){
            cout<<a[k-1]<<endl;
            return 0;
        }
        k-=(int)a.size();
        vector<ll> v;
        swap(v,a);
        for(ll x : v){
            for(int i=-1;i<=1;i++){
                int d=x%10+i;
                if(d<0||d>9) continue;
                a.push_back(x*10+d);
            }
        }
    }
}

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

#define repd(i,a,b) for (int i=(a);i<(b);i++)
#define rep(i,n) repd(i,0,n)
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; }
typedef long long ll;

const long long INF = 1LL << 60;

ll reflect(ll a, ll b) {
    if (a > b) swap(a, b);
    if (b % a == 0) {
        return (2 * (b / a) - 1) * a;
    }
    else {
        return 2 * (b / a) * a + reflect(a, b % a);
    }
}

int main()
{
    ll N, X;
    cin >> N >> X;

    cout << N + reflect(N - X, X) << endl;

    return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ll long long 
int main()
{
    //int t;
    //cin>>t;
    //while(t--)
    //{
      ll a,k,d;
    cin>>a>>k>>d;
    ll x=abs(a);
    ll ans=x/d;
    if(ans>=k)
    cout<<x-(k*d);
    else if(ans<k)
    {
        ll ans1=min(x-(d*ans),abs(x-(d*(ans+1)))),m;
        if(ans1==(x-(d*ans)))
        m=ans;
        else
        m=ans+1;
        if((k-m)%2==0)
        cout<<ans1;
        else
        cout<<abs(abs(ans1)-d);
    }
    //}
    
    
}

Measured memory_bytes: 3616
#include <stdio.h>
#include <stdlib.h>

int main()
{
    int a,b;
    scanf("%d %d",&a,&b);

    if(a > b)
       printf("a > b\n");
    else if(a < b)
       printf("a < b\n");
    else if(a == b)
        printf("a == b\n");
    return 0;
}



Measured memory_bytes: 2060
# -*- coding: utf-8 -*-
def inpl(): return list(map(int, input().split()))
N, C, K = inpl()
T = sorted([int(input()) for _ in range(N)])
ans = 1
b, c = T[0], 1
for t in T[1:]:
    if (t > b+K) or (C <= c):
        ans += 1
        b, c = t, 1
    else:
        c += 1
print(ans)

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

typedef long long ll;
const int INF = 1e9;

using namespace std; 

#define REP(inc, bgn, end) for (int inc = bgn; inc < end; inc++)

int main() {
    int n, d[110];
    cin >> n;
    REP(i, 0, n) cin >> d[i];

    int total = 0;
    REP(i, 0, n - 1) {
        REP(j, i + 1, n) {
            total += d[i] * d[j];
        }
    }

    cout << total << endl;
}

Measured memory_bytes: 256
#include <iostream>
#include <stdlib.h>
#include <algorithm>
#include <queue>
#include <stack>
#include <vector>
#include <utility>
#include <string.h>
#include <string>
#include <cmath>
#include <cstdio>
#include <functional>
#include <map>
#include <typeinfo>
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pi;
typedef pair<double, double> pd;
typedef pair<ll, ll> pl;

vector<int> powers;
int counts[200001];//파워가 x 이상인 사람
ll sums[100001];//i명 합 최대치

int main()
{
  int n;
  ll m;
  scanf("%d %lld", &n, &m);

  for(int i = 0; i < n; i++)
  {
    int num;
    scanf("%d\n", &num);
    powers.push_back(num);
  }

  sort(powers.begin(), powers.end(), greater<int>());

  for(int i = 0; i < n; i++)
    counts[powers[i]]++;

  for(int i = 100000; i > 0; i--)
    counts[i-1] += counts[i];

  int f = 1, b = 200001;

  while(f < b)
  {
    int mid = (f+b)/2;
    ll s = 0;

    for(int i = 0 ; i < n; i++)
      s += counts[max(0, mid-powers[i])];
    
   // printf("%lldaa%d\n", s, mid);

    if (s >= m)
      f = mid+1;
    else
      b = mid;
  }

  ll s = 0;

  for(int i = 0 ; i < n; i++)
    s += counts[max(0, f-powers[i])];

  if (s < m)
    f--;
  
  //printf("%daa\n", f);

  for(int i = 0; i < n; i++)
    sums[i+1] = sums[i] + powers[i];
  
  ll shake_sum = 0;
  ll happiness = 0;

  for(int i = 0; i < n; i++)
  {
    int pattern = max(0, f+1-powers[i]);
    ll shakes = max(0LL, min((ll)m - shake_sum, (ll)counts[pattern]));
    happiness += sums[shakes] + (powers[i] * shakes);
    shake_sum += shakes;
  }
  
  happiness += f * (m - shake_sum);
  
  printf("%lld\n", happiness);

  return 0;
}


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



void solve(){
    char c;
    cin >> c;
    string ans = "consonant";
    if(c=='a'||c=='i'||c=='u'||c=='e'||c=='o'){
        ans = "vowel";
    } 
    cout << ans << endl;
}

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

Measured memory_bytes: 256
import kotlin.math.abs
import kotlin.math.min

fun main() {
    val n = nextInt()
    val X = mutableListOf<Long>()
    val Y = mutableListOf<Long>()
    val P = mutableListOf<Long>()
    repeat(n) {
        val (x, y, p) = nextLongList()
        X.add(x)
        Y.add(y)
        P.add(p)
    }
    val xsel = Array(1 shl n) { Array(n) { 0L } }
    val ysel = Array(1 shl n) { Array(n) { 0L } }
    (0 until (1 shl n)).forEach { i ->
        (0 until n).forEach { j ->
            xsel[i][j] += abs(X[j])
            ysel[i][j] += abs(Y[j])
            (0 until n).forEach { k ->
                if ((i shr k) and 1 == 1) {
                    xsel[i][j] = min(xsel[i][j], abs(X[j] - X[k]))
                    ysel[i][j] = min(ysel[i][j], abs(Y[j] - Y[k]))
                }
            }
        }
    }
    (0 until (1 shl n)).forEach { i ->
        (0 until n).forEach { j ->
            xsel[i][j] *= P[j]
            ysel[i][j] *= P[j]
        }
    }

    val ans = sizedArray(n + 1, Long.MAX_VALUE)
    (0 until (1 shl n)).forEach { i ->
        val count = (0 until n).count {
            i shr it and 1 == 1
        }
        var j = i
        while (j >= 0) {
            j = j and i
            var cost = 0L
            (0 until n).forEach { k ->
                    cost += min(xsel[j][k], ysel[i - j][k])
            }
            ans[count] = min(ans[count], cost)
            j--
        }
//        ans.forEach(::println)
//        return
    }
    ans.forEach(::println)
}

// # Utils
// ## Input
fun next() = readLine()!!
fun nextInt() = next().toInt()
fun nextLong() = next().toLong()
fun nextDouble() = next().toDouble()
fun nextList() = next().split(" ")
fun nextIntList() = next().split(" ").map(String::toInt)
fun nextLongList() = next().split(" ").map(String::toLong)
fun nextDoubleList() = next().split(" ").map(String::toDouble)

// ## Array
inline fun <reified T> sizedArray(size: Int, default: T) = Array(size) { default }

// ## mod^-1
//    [NOTE] CANNOT use this for 0, mod, 2mod, 3mod ...(return wrong value)
fun modinv(num: Long, mod: Long): Long {
    var a = num
    var b = mod
    var u = 1L
    var v = 0L
    while (b > 0) {
        val t = a.div(b)
        a -= t * b
        a = b.also { b = a } // swap a and b
        u -= t * v
        u = v.also { v = u } // swap u and v
    }
    u %= mod
    if (u < 0) u += mod
    return u
}

Measured memory_bytes: 91496
import math

def a():
    x = list(map(int, input().split()))
    print(x.index(0) + 1)


def b():
    x, y = map(int, input().split())
    if x * 2 <= y <= x * 4 and y % 2 == 0:
        print('Yes')
    else:
        print('No')



def c():
    x, n = map(int, input().split())
    p = list(map(int, input().split()))
    for i in range(100):
        temp = x - i
        if temp >= 0 and temp not in p:
            print(temp)
            break
        temp = x + i
        if temp not in p:
            print(temp)
            break



def d():
    print('')


c()

Measured memory_bytes: 9212
#include <iostream>
#include <numeric>
#include <string>
#include <vector>
#include <algorithm>
#include <sstream>
#include <iterator>
#include <math.h>
#include <cmath>
#include <set>   
#include <bitset>
//#include <boost/math/common_factor_rt.hpp>

#define ll long long

using namespace std;

int main()
{
	ll n, x;
	ll ans = 0;
	cin >> n >> x;
	ll a[100500] = {};
	
	for (int i = 0; i < n; i++)
	{
		cin >> a[i];
	}
	
	for (int i = 1; i < n; i++)
	{
		if (a[i - 1] + a[i] > x) {
			ans += a[i - 1] + a[i] - x;
			a[i] = a[i] - (a[i - 1] + a[i] - x);
			if (a[i] < 0) {
				a[i] = 0;
			}
		}
	}
	/*for (int i = 0; i < n; i++)
	{
		cout << a[i];
	}*/

	cout << ans << endl;
	
}

int dsum(ll a) {
	int ans = 0;
	while (a != 0) {
		ans += a % 10;
		a /= 10;
	}
	return ans;
}


Measured memory_bytes: 1024
#include <stdio.h>
int main(void){
	int a,b,x;
	scanf("%d%d%d",&a,&b,&x);
	if(x-a>=0){
		if(b-(x-a)>=0){
			printf("YES");
		}else{
			printf("NO");
		}
	}else{
		printf("NO");
	}
	return 0;
}

Measured memory_bytes: 128
#include<bits/stdc++.h>
#define rep(i,n) for(i=1;i<=n;i++)
using namespace std;
const int maxn=400;
const int maxm=100000;
int n,m,size=1,S,T,R;
int fir[maxn],Next[maxm],End[maxm],dis[maxn],tag[maxm],w[maxm],ot[maxm];
int mp[400][400];
queue<int>que;
class zz
{
public:
 	int x,y;  
	zz(int a,int b){x=a,y=b;}   
};

bool operator <(const zz &one, const zz &other)
{
		if(one.x<other.x || (one.x == other.x && one.y<other.y))return 1;
        return false;
}
map<zz,int>ed;
void addedge(int x,int y,int z)
{
	size++;
	Next[size]=fir[x];	fir[x]=size;	End[size]=y;	w[size]=1;
	Next[size^1]=fir[y];	fir[y]=size^1;	End[size^1]=x;	w[size^1]=0;
	size++;
}
bool bfs()
{
	memset(dis,-1,sizeof(dis));
	dis[S]=1;
	while(!que.empty())que.pop();
	que.push(S);
	while(!que.empty())
	{
		int top=que.front();
		que.pop();
		if(top == T)return 1;
		for(int u=fir[top];u;u=Next[u])
		{
			int en=End[u];
			if(w[u] && dis[en] == -1)
			{
				dis[en]=dis[top]+1;
				que.push(en);
			}
			if(!w[u] && !tag[u] && dis[en] == -1 && mp[top][en]==-1)
			{
				dis[en]=dis[top]+1;
				que.push(en);
				swap(w[u],w[u^1]);
				zz p(en,top);
				ot[++R]=ed[p];
			}
		}
	}
	return 0;
}
int dfs(int now,int maxf)
{
	if(now == T || !maxf)return maxf;

	int ret=0,f;
	for(int u=fir[now];u;u=Next[u])
	{
		int en=End[u];

		if(!tag[u] && dis[en] ==dis[now]+1 && w[u])
		{
			f=dfs(en,min(maxf-ret,1));
			if(f)
			{
				w[u]-=1;
				w[u^1]+=1;
				tag[u]=tag[u^1]=1;
				ret+=f;
			}
		}
	}
	if(!ret) dis[now]=-1;
	return ret;
}
int main()
{
	int i,j;
	scanf("%d%d",&n,&m);
	rep(i,m)
	{
		int x,y;
		scanf("%d%d",&x,&y);
		addedge(x,y,1);
		mp[x][y]=1;
		mp[y][x]=-1;
		zz p(x,y);
		ed[p]=i;
	}
	scanf("%d%d",&S,&T);
	int ans=0;
	while(bfs())
	{
		ans+=dfs(S,(1<<30));
	}
	cout<<ans<<endl<<R<<endl;
	sort(ot+1,ot+R+1);
	rep(i,R)
		printf("%d\n",ot[i]);
}

Measured memory_bytes: 1836
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();
    //String str = sc.next();
    int[] d = new int[n];
    for(int i = 0; i< n; i++){
    	d[i] = sc.nextInt();
    }
    ArrayList<Integer> di = new ArrayList<>();

    for(int i : d){
    	if(i > 0) {
    		di.add(i);
    	}
    }

    ArrayList<Integer> sa = new ArrayList<>();
    ArrayList<Integer> ka = new ArrayList<>();
    ka = (ArrayList<Integer>) di.clone();

    for(int i = 0; i < di.size();i++){
    	ka.remove(0);
    	for(int j =0; j  < ka.size(); j++) {
    		sa.add(di.get(i) * ka.get(j));
        	}
    	}

    int ans = 0;
	for(int a:sa) {
		ans += a;
	}
	System.out.println(ans);
  }
}

Measured memory_bytes: 21844
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
#define pb push_back
#define mp make_pair
#define rep(i,n) for(int i=0;i<(n);++i)

int main(){
	cin.tie(0);
	ios::sync_with_stdio(false);
	ll n,m,d;cin >> n >> m >> d;
	double ans;
	if(d==0) ans=(m-1)/(double)n;
	else ans=(m-1)*2*(n-d)/((double)n*n);
	cout << fixed << setprecision(20) << ans << endl;
}

Measured memory_bytes: 256
a = [int(input()) for _ in range(5)]
cnt = []
ans = 0
for i in a:
    amari = (i%10)
    if amari != 0:
        cnt.append(amari)
        ans += i//10 + 1
    else:
        ans += i//10
        
ans *= 10
if len(cnt) != 0:
    ans -= 10
    ans += min(cnt)

print(ans)

Measured memory_bytes: 3064
#include<stdio.h>
int main()
{
    int h, n, i, sum;
    sum = 0;
    int a[100000];
    scanf("%d%d", &h, &n);
    for (i = 0;i < n;i++)
    {
        scanf("%d", &a[i]);
    }
    for (i = 0;i < n;i++)
    {
        sum += a[i];
    }
    if (sum >= h)
    {
        printf("Yes");
    }
    else
    {
        printf("No");
    }
    return 0;
}

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


int main()
{
    int a, b;
    
    cin >> a >> b;
    
    for(int i = min(a, b); i <= max(a, b); i++)
    {
        if(i * a * b & 1)
        {
            cout << "Yes";
            return 0;
        }
    }
    
    cout << "No";
    
    return 0;
}



Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <cstring>
#include <cstdio>
#include <algorithm>
#include <vector>
#include <set>
#include <map>
#include <queue>
#include <numeric>
#include <cmath>

#define FOR(i, f, n) for(int (i) = (f); (i) < (n); (i)++)
#define RFOR(i, f, n) for(int (i) = (f); (i) >= (n); (i)--)
#define rep(i, n) for(int (i) = 0; (i) < (n); (i)++)
#define rrep(i, n) for(int (i) = (n); (i) >= 0; (i)--)
#define step(i, f, n, a) for(int (i) = (f); (i) < (n); (i)+=a)
#define rstep(i, f, n, a) for(int (i) = (f); (i) >= (n); (i)-=a)
#define p(...) printf(__VA_ARGS__); cout << endl;
#define gets(x) x; cin >> x;
#define puts(x) x; cout << x << endl;
#define list_input(x, n) x[(n)]; for(int (i) = 0; (i) < (n); (i)++) cin >> x[i];
#define lambda(a, b, c) [](const a, const b){ return c ;}
#define key(t, x, compare) [](const t& a, const t& b){ return a x compare b x ;}

using namespace std;

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

const int nmax = 40, abmax = 10, inf = 1000000;
int a[nmax], b[nmax], c[nmax]; // それぞれの薬品
int dp[nmax+1][nmax*abmax+1][nmax*abmax+1]; //dp

int main(){
	int n, ma, mb;
	cin >> n >> ma >> mb;
	rep(i, n){
		cin >> a[i] >> b[i] >> c[i];
	}
	rep(i, n+1){
		rep(j, nmax*abmax+1){
			rep(k, nmax*abmax+1){
				dp[i][j][k] = inf; //大きな数で初期化
			}
		}
	}
	dp[0][0][0] = 0;
	
	rep(i, n){
		rep(j, nmax*abmax+1){
			rep(k, nmax*abmax+1){
				if (dp[i][j][k] == inf){
						continue;
				}
				dp[i+1][j][k] = min(dp[i+1][j][k], dp[i][j][k]); //選ばない
				dp[i+1][j+a[i]][k+b[i]] = min(dp[i+1][j+a[i]][k+b[i]], dp[i][j][k]+c[i]); //選ぶ
			}
		}
	}
	int result = inf;
	FOR(i, 1, nmax*abmax+1){
		FOR(j, 1, nmax*abmax+1){
			if (i*mb == j*ma){ //比率が正しいなら
				result = min(result, dp[n][i][j]);
			}
		}
	}
	if (result == inf){
		result = -1;
	}
	puts(result)
}


Measured memory_bytes: 25984
#include <iostream>
#include <string>
#include <list>
using namespace std;

int main()
{
	long n = 0, u = 0;
	string st;
	list<int> a;
	list<int>::iterator it;

	cin >> n;
	
	for (int i = 0; i < n; i++) {
		cin >> st;
		if (st == "insert"){
			cin >> u;
			a.push_front(u);
		}
		else if (st == "delete") {
			cin >> u;
			for (it = a.begin(); it != a.end(); it++) {
				if (*it == u) {
					a.erase(it);
					break;
				}
			}
		}
		else if (st == "deleteFirst")
			a.pop_front();
		else if (st == "deleteLast")
			a.pop_back();
	}

	cout << a.front();
	a.pop_front();

	while (!a.empty()) {
		cout << " " << a.front();
		a.pop_front();
	}

	cout << endl;

	return 0;
}

Measured memory_bytes: 34344
#include <bits/stdc++.h>
#define lli long long int
using namespace std;
#define mod 1000000007
#define MOD 1000000037
#define mod1 998244353
#define fastio ios_base::sync_with_stdio(false);cin.tie(NULL);cout.tie(NULL); 
#define INF 2e9

int main()
{
    string s;
    cin >> s;
    for(int i=0;i<s.length();i++)
    {
        if(s[i]=='?')
            s[i]='D';
    }
    cout << s << endl;
}

Measured memory_bytes: 3752
#include <stdio.h>
#include <math.h>

int main(void) {
	int data_num,cur_data;
	double qr,rp,pq;
	int n,i;
	int p,q,r;
	int ap,aq,ar;
	double x[30];
	double y[30];
	double z[30];
	double nqr,nrp,npq;
	scanf("%d",&data_num);
	for(cur_data=0;cur_data<data_num;cur_data++) {
		scanf("%lf%lf%lf",&qr,&rp,&pq);
		scanf("%d",&n);
		for(i=0;i<n;i++)scanf("%lf%lf%lf",&x[i],&y[i],&z[i]);
		ap=aq=ar=0;
		for(p=0;p<n;p++) {
			for(q=0;q<n;q++) {
				if(p==q)continue;
				for(r=0;r<n;r++) {
					if(p==r || q==r)continue;
					nqr=sqrt((x[q]-x[r])*(x[q]-x[r])+
						(y[q]-y[r])*(y[q]-y[r])+
						(z[q]-z[r])*(z[q]-z[r]));
					nrp=sqrt((x[r]-x[p])*(x[r]-x[p])+
						(y[r]-y[p])*(y[r]-y[p])+
						(z[r]-z[p])*(z[r]-z[p]));
					npq=sqrt((x[p]-x[q])*(x[p]-x[q])+
						(y[p]-y[q])*(y[p]-y[q])+
						(z[p]-z[q])*(z[p]-z[q]));
					if(fabs(nrp/nqr-rp/qr)<=0.0001 &&
							fabs(npq/nrp-pq/rp)<=0.0001 &&
							fabs(nqr/npq-qr/pq)<=0.0001) {
						ap=p;aq=q;ar=r;
					}
				}
			}
		}
		printf("%d %d %d\n",ap+1,aq+1,ar+1);
	}
	return 0;
}

Measured memory_bytes: 0
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long
#define MP make_pair
#define PB push_back
#define F first
#define S second
#define endl "\n"
#define pi 3.14159265358979323846264338327950288
#define MOD 1000000007
#define INF -100000000000000
#define ordered_set tree<pair< ll int ,ll  int>, null_type,less<pair<ll int, ll int>>, rb_tree_tag,tree_order_statistics_node_update> 
#define fast ios_base::sync_with_stdio(0);cin.tie(NULL);cout.tie(NULL);
using namespace std;
#define lld long double
using namespace __gnu_pbds;
int main()
{
    fast;
    ll int n;
    cin>>n;ll int i,j,x,y,mn=INT_MIN,mx=INT_MIN,mx1=INT_MAX,mn1=INT_MAX;
    ll int ind1=0,ind2=0,ind3=0,ind4=0;
    ll int val=0;
    vector<pair<ll int,ll int>> v;ll int w,q;
    for(i=1;i<=n;i++)
    {
    	cin>>x>>y;
    	v.PB(MP(x,y));
    }
    for(i=0;i<n;i++)
    {
    	x=v[i].F;y=v[i].S;
    	w=x+y;
    	q=x-y;
    	if(w>mx)
    	{
    		mx=w;ind1=i-1;
    	}
    	if(q>mn)
    	{
    		mn=q;ind2=i-1;
    	}
    	if(w<mx1)
    	{
    		mx1=w;ind3=i-1;
    	}
    	if(q<mn1)
    	{
    		mn1=q;ind4=i-1;
    	}


    }
    cout<<max(val,max(abs(mx-mx1),abs(mn-mn1)));
}

Measured memory_bytes: 7364
def B():
    from numpy import zeros
    s = input()
    r = zeros((26,), dtype='int32')
    ord_a = ord('a')
    for c in s:
        r[ord(c)-ord_a] += 1
    for i in r:
        if i > 1:
            print('no')
            exit()
    print('yes')

B()

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

#define rep(i, n) for(int i = 0; i<(n); i++)
#define chmax(x, y) x = max(x, y)
#define chmin(x, y) x = min(x, y)
using namespace std;
typedef long long ll;

// auto mod int
// https://youtu.be/L8grWxBlIZ4?t=9858
// https://youtu.be/ERZuLAxZffQ?t=4807 : optimize
// https://youtu.be/8uowVvQ_-Mo?t=1329 : division
const int mod = 1000000007;

struct mint {
    ll x; // typedef long long ll;
    mint(ll x = 0) : x(x % mod) {}

    mint &operator+=(const mint a) {
        if ((x += a.x) >= mod) x -= mod;
        return *this;
    }

    mint &operator-=(const mint a) {
        if ((x += mod - a.x) >= mod) x -= mod;
        return *this;
    }

    mint &operator*=(const mint a) {
        (x *= a.x) %= mod;
        return *this;
    }

    mint operator+(const mint a) const {
        mint res(*this);
        return res += a;
    }

    mint operator-(const mint a) const {
        mint res(*this);
        return res -= a;
    }

    mint operator*(const mint a) const {
        mint res(*this);
        return res *= a;
    }

    mint pow(ll t) const {
        if (!t) return 1;
        mint a = pow(t >> 1);
        a *= a;
        if (t & 1) a *= *this;
        return a;
    }

    // for prime mod
    mint inv() const {
        return pow(mod - 2);
    }

    mint &operator/=(const mint a) {
        return (*this) *= a.inv();
    }

    mint operator/(const mint a) const {
        mint res(*this);
        return res /= a;
    }
};

struct combination {
    vector<mint> fact, ifact;

    combination(int n) : fact(n + 1), ifact(n + 1) {
        fact[0] = 1;
        for (int i = 1; i <= n; ++i) fact[i] = fact[i - 1] * i;
        ifact[n] = fact[n].inv();
        for (int i = n; i >= 1; --i) ifact[i - 1] = ifact[i] * i;
    }

    mint operator()(int n, int k) {
        if (k < 0 || k > n) return 0;
        return fact[n] * ifact[k] * ifact[n - k];
    }
} comb(100005);

mint f(int n, int k) {
    if (n < 0) return 0;
    // nPk = nCk * k!
    mint res = comb(n, k);
    res *= comb.fact[k];
    return res;
}

int main() {
    int N, K;
    cin >> N >> K;
    vector<ll> A(N);
    rep(i, N) cin >> A[i];
    sort(A.begin(), A.end());

    mint ans = 0;
    rep(i, N) {
        if (i >= K - 1) {
            ans += mint(A[i]) * comb(i, K - 1); // max
        } else {
           // ans += mint(A[i]) * comb(i, K - 1); // max
          //mint tmp = mint(A[i]) * comb(i, K - 1);
          //if(tmp.x) {
          //cerr << "i:" << i << " K:" << K << " tmp:" << tmp.x << " comb" << comb(i, K - 1).x << endl;
          //}
        }

        ans -= mint(A[i]) * comb(N - 1 - i, K - 1); // min
    }

    cout << ans.x % mod << endl;
}


Measured memory_bytes: 2560
//#pragma comment(linker, "/stack:200000000")
//#pragma GCC optimize("Ofast")
//#pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
//#pragma GCC optimize("unroll-loops")
 
#include <iostream>
#include <stdlib.h>
#include <cmath>
#include <algorithm>
#include <vector>
#include <queue>
#include <deque>
#include <set>
#include <map>
#include <unordered_map>
#include <unordered_set>
#include <random>
#include <assert.h>
#include <memory.h>
#include <time.h>
#include <bitset>
#include<iomanip>
 
#define uint unsigned int
#define ll long long
#define ull unsigned long long
#define ld long double
#define rep(i, l, r) for (int i = (l); i < (r); i++)
#define repb(i, r, l) for (int i = (r); i > (l); i--)
#define sz(a) (int)a.size()
#define fi first
#define se second
#define pii pair<int,int>
#define pli pair<ll,int>
#define pll pair<ll,ll>
#define mp(a, b) make_pair(a, b)
#define mt(a,b,c) make_tuple(a,b,c)
#define rank qwertyuio
#define next dfghjk
#define plus fsghsf
#define minus ytryr
#define pb push_back
using namespace std;
 
inline bool setmin(int &x, int y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(int &x, int y) { return (y > x) ? x = y, 1 : 0; }
inline bool setmin(ll &x, ll y) { return (y < x) ? x = y, 1 : 0; }
inline bool setmax(ll &x, ll y) { return (y > x) ? x = y, 1 : 0; }
 
const int N = 100000;
const int inf = (int)1e9 + 1;
const ll big = (ll)1e18 + 1;
const int P = 239;
const int P1 = 31;
const int P2 = 57;
const int mod = (int)1e9 + 7;
const int mod1 = (int)1e9 + 9;
const int mod2 = 998244353;
const int mod3 = (int)1e6+3;
const ld eps = 1e-12;
const double pi = atan2(0, -1);
const int ABC = 26;
bool lexi(string& a,string& b){
    return lexicographical_compare(a.begin(),a.end(),b.begin(),b.end());
}
 
int main()
{
    //freopen("a.in", "r", stdin);
    //freopen("a.out", "w", stdout);<<" "
    string s,t;
    cin>>s>>t;
    cout<<t<<s;
    return 0;
             
    
}

Measured memory_bytes: 256
#include<iostream>
#include<string>
#include<cstdio>
#include<vector>
#include<cmath>
#include<algorithm>
#include<functional>
#include<iomanip>
#include<queue>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
using namespace std;
typedef long long ll;
typedef unsigned int ui;
const ll mod = 1000000007;
typedef long double ld;
const ll INF = 1e+14;
typedef pair<int, int> P;
#define stop char nyaa;cin>>nyaa;
#define rep(i,n) for(int i=0;i<n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define Rep(i,sta,n) for(int i=sta;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per1(i,n) for(int i=n;i>=1;i--)
#define Rep1(i,sta,n) for(int i=sta;i<=n;i++)
typedef complex<ld> Point;
const ld eps = 1e-8;
const ld pi = acos(-1.0);
typedef pair<ld, ld> LDP;
typedef pair<ll, ll> LP;
#define fr first
#define sc second
#define all(c) c.begin(),c.end()
#define pb push_back
 
void Yes(){
	cout<<"Yes"<<endl;
	exit(0);
}
 
void No(){
	cout<<"No"<<endl;
	exit(0);
}
int main(){
  ll N; cin>>N;
  ll Q; cin>>Q;
  string S; cin>>S;
  ll L[Q];
  ll R[Q];
  rep(i,Q){
    ll a,b;
    cin>>a>>b;
    L[i]=a; R[i]=b;
  }
  
  vector<ll> A;
  rep(i,N-1){
    if(S[i]=='A'&&S[i+1]=='C') A.push_back(i);
    else continue;
  }
  
  ll count=0;
  ll count1=0;
  ll B[N];
  rep(i,N){
    B[i]=0;
  }
  rep(i,N){
    if(A.empty()) break;
    B[i]=count;
    if(A[count1]==i){
      count++;
      count1++;
    }
  }
  
  rep(i,Q){
    ll a=L[i]-1;
    ll b=R[i]-1;
    ll ans=B[b]-B[a];
    cout<<ans<<endl;
  }
}
    
  
  

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

int main()
{
	int a[4];
	int b[4];
	while (cin >> a[0])
	{
		for (int i = 1; i < 4; i++) cin >> a[i];
		for (int i = 0; i < 4; i++) cin >> b[i];

		int hit = 0;
		int blow = 0;

		for (int i = 0; i < 4; i++)
		{
			for (int j = 0; j < 4; j++)
			{
				if (a[i] != b[j])
					continue;
				if (i == j)
					hit++;
				else
					blow++;
			}
		}
		cout << hit << ' ' << blow << endl;
	}
	return 0;
}

Measured memory_bytes: 1160
#include <algorithm>
#include <iomanip>
#include <iostream>
#include <vector>
int main() {
    std::cin.tie(nullptr);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(5);
    //-----------------------------------------------
    int n;
    std::cin >> n;
    std::vector<int> buka(n + 1);
    std::fill(buka.begin(), buka.end(), 0);
    for (int i = 2; i <= n; ++i) {
        int a;  // joushiNum
        std::cin >> a;
        buka.at(a) += 1;
    }

    for (int i = 1; i <= n; ++i) {
        std::cout << buka.at(i) << std::endl;
    }

    return 0;
}

Measured memory_bytes: 3916
#include <iostream>
#include <queue>
#include <vector>
#include <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
#include <functional>
#include <cmath>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <map>
using ll=long long;
using namespace std;
//const int INF = 7+(1e+9);
ll GCD(ll x, ll y)
{
    if (y == 0)
    {
        return x;
    }
    else
    {
        return GCD(y, x % y);
    }
}
ll LCM(ll x, ll y)
{
    return x / GCD(x, y) * y;
}
struct UnionFind {
    vector<int> par; // par[i]:iの親の番号　(例) par[3] = 2 : 3の親が2

    UnionFind(int N) : par(N) { //最初は全てが根であるとして初期化
        for(int i = 0; i < N; i++) par[i] = i;
    }

    int root(int x) { // データxが属する木の根を再帰で得る：root(x) = {xの木の根}
        if (par[x] == x) return x;
        return par[x] = root(par[x]);
    }

    void unite(int x, int y) { // xとyの木を併合
        int rx = root(x); //xの根をrx
        int ry = root(y); //yの根をry
        if (rx == ry) return; //xとyの根が同じ(=同じ木にある)時はそのまま
        par[rx] = ry; //xとyの根が同じでない(=同じ木にない)時：xの根rxをyの根ryにつける
    }

    bool same(int x, int y) { // 2つのデータx, yが属する木が同じならtrueを返す
        int rx = root(x);
        int ry = root(y);
        return rx == ry;
    }
};
int main(){
  int n,m;cin>>n>>m;
  vector<int> vec(m);
  for(int i=0;i<m;i++){
      cin>>vec[i];
  }
  vector<int> dp(n*10,n);
  dp[0]=0;
  for(int i=0;i<=n+1;i++){
      for(int j=0;j<m;j++){
          dp[i+vec[j]]=min(dp[i]+1,dp[i+vec[j]]);
      }
  }
  cout<<dp[n]<<endl;
}


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

typedef unsigned long ul;
typedef unsigned long long ull;
typedef long long ll;
typedef vector<ll> vint;
typedef vector< vector<ll> > vvint;
typedef vector< vector< vector<ll> > > vvvint;
typedef vector<string> vstring;
typedef vector< vector<string> > vvstring;
typedef vector<char> vchar;
typedef vector< vector<char> > vvchar;
typedef vector<long double> vdouble;
typedef vector< vector<long double> > vvdouble;
typedef vector< vector< vector<long double> > > vvvdouble;
typedef pair<ll,ll> pint;
typedef vector<pint> vpint;
typedef vector<bool> vbool;

#define rep(i,n) for(ll i=0;i<n;i++)
#define repf(i,f,n) for(ll i=f;i<n;i++)
#define repr(i,n) for(ll i=n-1;i>=0;i--)
#define mp make_pair
#define mt make_tuple
#define pb push_back
#define pf push_front
#define fi first
#define se second
#define ALL(obj) (obj).begin(), (obj).end()
// #define LLONG_MAX 9223372036854775806
#define MOD 1000000007
const double PI=3.14159265358979323846;
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; }
template<typename T> T Ceil(T a, T b){return (a+b-1)/b;}

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

void printv(vint &v){
    for(auto e:v) cout<<e<<" ";
        cout<<endl;
    }

int main() {
    cout<<fixed<<setprecision(10);

    ll n; cin>>n;
    vpint a(n); rep(i,n){ll x; cin>>x; a[i] = mp(x, i);}

    sort(ALL(a), greater<pint>());

    vvint dp(n+1, vint(n+1, 0));

    rep(i,n){
        rep(l, i+1){
            ll r = i - l;
            chmax(dp[r+1][l], dp[r][l] + a[i].first*abs(r-a[i].second));
            chmax(dp[r][l+1], dp[r][l] + a[i].first*abs((n-1) - l - a[i].second));
        }
    }

    ll ans = 0;
    rep(i,n+1)rep(j,n+1) chmax(ans, dp[i][j]);

    cout<<ans<<endl;


    return 0;

}

Measured memory_bytes: 34684
using System;
    class Program
    {
        static void Main(string[] args)
        {
            int s = int.Parse(Console.ReadLine());
            int d, h, sh, sd;
            sd = s % (60 * 60);
            d = (s - sd) / (60 * 60);
            sh = sd % 60;
            h = (sd - sh) / 60;
            Console.WriteLine(d + ":" + h + ":" + sh);
        }
    }

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

using namespace std;

int main(){
	int n;
	cin>>n;
	int a=0, b=0, c=0;
	for(int i=0; i<n; i++){
		int p;
		cin>>p;
		if(p%4==0) a++;
		else if(p&1) c++;
		else b++;
	}

	if(n==1){
		if(a) cout<<"Yes\n";
		else cout<<"No\n";
	}else{
		if(c==0) cout<<"Yes\n";
		else{
			if(c<=a){
				cout<<"Yes\n";
			}else if(c==a+1){
				if(b==0) cout<<"Yes\n";
				else cout<<"No\n";
			}else{
				cout<<"No\n";
			}
		}
	}
}

Measured memory_bytes: 256
const lineList = require('fs').readFileSync('/dev/stdin','utf8').trim().split('\n')
const n = parseInt(lineList[0])
const hList = lineList[1].split(' ').map(e => parseInt(e))

var answer = 'Yes'
var mi = 0 // index of max value
for(var i in hList) {
  if(hList[mi] <= hList[i]) {
    mi = i
  }

  if(hList[mi] - hList[i] >= 2) {
    answer = 'No'
  }
}

console.log(answer)


Measured memory_bytes: 31668
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define For(i,n,k) for(ll i=(n);i<(k);i++)
ll n,m,ans=-100;
int s[200][200];
const ll MOD = 1000000007;
bool bfs(int t,vector<ll> &group){
    queue<int> q;
    group.at(t)=1;
    q.push(t);
    while(!q.empty()){
        int i=q.front();
        int nowdist=group.at(i);
        q.pop();
        For(j,0,n){
            if(s[i][j]==1){
                if(group.at(j)==nowdist){
                    return false;
                }
                if(group.at(j)==0){
                    q.push(j);
                    if(group.at(j)==nowdist){
                        return false;
                    }
                    group.at(j)=group.at(i)+1;
                }
            }
        }
    }
    return true;
}

ll count(ll t){
    vector<ll> group(n,0);
    bool flag=bfs(t,group);
    if(!flag) return -1;
    ll kazu=-1;
    For(i,0,n){
        kazu=max(kazu,group.at(i));
    }
    return kazu;
}
void Main(){    
    cin>>n;
    For(i,0,n){
        string x;cin>>x;
        For(j,0,n){
            s[i][j]=x.at(j)-'0';
        }
    }
    For(t,0,n){
        ll cnt=count(t);
        ans=max(ans,cnt);
    }
    cout<<ans<<endl;
}
int main(){
    Main();
    return 0;
}


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

using namespace std;

int n;
vector<int> G[200005];
int dist[200005];

void dfs(int v, int p, int d)
{
	dist[v] = d;
	for(int i = 0; i < G[v].size(); i++){
		if(G[v][i] == p) continue;
		dfs(G[v][i], v, d+1);
	}
}

int main(void)
{
	cin >> n;
	int u, v;
	for(int i = 0; i < n-1; i++){
		cin >> u >> v;
		G[u].push_back(v);
		G[v].push_back(u);
	}
	
	dfs(1, -1, 0);
	int root, mx = -1;
	for(int i = 1; i <= n; i++){
		if(mx < dist[i]){
			mx = dist[i];
			root = i;
		}
	}
	
	dfs(root, -1, 0);
	mx = -1;
	for(int i = 1; i <= n; i++) mx = max(mx, dist[i]);
	
	if(mx%3 == 1) cout << "Second" << endl;
	else cout << "First" << endl;
	
	return 0;
}

Measured memory_bytes: 24448
#include <algorithm>
#include <bitset>
#include <complex>
#include <cstdio>
#include <deque>
#include <exception>
#include <fstream>
#include <functional>
#include <iomanip>
#include <ios>
#include <iosfwd>
#include <iostream>
#include <istream>
#include <iterator>
#include <limits>
#include <list>
#include <locale>
#include <map>
#include <memory>
#include <new>
#include <numeric>
#include <ostream>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <stdexcept>
#include <streambuf>
#include <string>
#include <typeinfo>
#include <utility>
#include <valarray>
#include <vector>
#if __cplusplus >= 201103L
#include <array>
#include <atomic>
#include <chrono>
#include <condition_variable>
#include <forward_list>
#include <future>
#include <initializer_list>
#include <mutex>
#include <random>
#include <ratio>
#include <regex>
#include <scoped_allocator>
#include <system_error>
#include <thread>
#include <tuple>
#include <typeindex>
#include <type_traits>
#include <unordered_map>
#include <unordered_set>
#endif

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

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

int lcm(int a, int b) {
    return a * b / gcd(a, b);
}

int bitCount(long bits) {
    bits = (bits & 0x55555555) + (bits >> 1 & 0x55555555);
    bits = (bits & 0x33333333) + (bits >> 2 & 0x33333333);
    bits = (bits & 0x0f0f0f0f) + (bits >> 4 & 0x0f0f0f0f);
    bits = (bits & 0x00ff00ff) + (bits >> 8 & 0x00ff00ff);
    return (bits & 0x0000ffff) + (bits >>16 & 0x0000ffff);
}

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int a, b, k;  cin >> a >> b >> k;
    if (b - a < k * 2) {
      int x = a;
      while (x <= b) {
        cout << x << '\n';
        ++x;
      }
    } else {
      rep(i, k) {
        cout << a + i << '\n';
      }
      for (int i = k - 1; i >= 0; --i) {
        cout << b - i << '\n';
      }
    }

    return 0;
}


Measured memory_bytes: 256
from sys import exit, stdin
K, N = [int(_) for _ in stdin.readline().rstrip().split()]
A = [int(_) for _ in stdin.readline().rstrip().split()]
distances = []
for i in range(N-1):
    distances.append(A[i+1]-A[i])
distances.append(A[0]+K-A[N-1])
print(K-max(distances))

Measured memory_bytes: 26444
#include <stdio.h>

int main(int argc, const char * argv[]) {
    // insert code here...
    int W,H,i,j;
    
    while(1){
        scanf("%d %d",&H ,&W);
        if(W==0 && H==0){
            break;
        }
        for(i=0; i<H; i++){
            for(j=0; j<W; j++){
                if(j%2 == 0){
                    if(i%2 == 0){
                        printf("#");
                    }else{
                        printf(".");
                    }
                }else{
                    if(i%2 == 1){
                        printf("#");
                    }else{
                        printf(".");
                    }
                }
            }
            printf("\n");
        }
        printf("\n");
    }
    return 0;
}


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

int main()
{
    int N;
    cin >> N;
    vector<int> v(N);
    int left = 0;
    int right = 0;
    for (int i = 0; i < N; i++)
    {
        cin >> v[i];
        right += v[i];
    }
    int res = 100000;
    rep0(i, N)
    {
        if (abs(left - right) < res)
        {
            res = abs(left - right);
        }
        left += v[i];
        right -= v[i];
    }
    cout << res;
}


Measured memory_bytes: 3536
//55
#include<iostream>
#include<algorithm>

using namespace std;

int main(){
  for(int n,m;cin>>n>>m,n|m;){
    int c[16];
    for(int i=0;i<m;i++){
      cin>>c[i];
    }
    static int ls[20001][256];
    fill(ls[0],ls[20001],1<<30);
    ls[0][128]=0;
    for(int i=0;i<n;i++){
      int x;
      cin>>x;
      for(int j=0;j<256;j++){
	for(int k=0;k<m;k++){
	  int n=min(255,max(0,j+c[k]));
	  ls[i+1][n]=min(ls[i+1][n],ls[i][j]+(x-n)*(x-n));
	}
      }
    }
    cout<<*min_element(ls[n],ls[n+1])<<endl;
  }
  return 0;
}

Measured memory_bytes: 21160
#include <iostream>
#include <iomanip>
#include <stdio.h>
using namespace std;

int n;
long double dp[301][301][301];

long double Cal(int N, int ones, int twos, int threes)
{
    if (ones == 0 && twos == 0 && threes == 0)
    {
        return 0.0;
    }
    if (dp[ones][twos][threes] != 0.0)
    {
        return dp[ones][twos][threes];
    }
    int nonEmptyPlates = ones + twos + threes;
    long double p_wasted = 1.0 - (long double)nonEmptyPlates / N;
    long double p1 = 0.0, p2 = 0.0, p3 = 0.0;
    if (ones > 0)
    {
        p1 = (long double)ones / nonEmptyPlates * Cal(N, ones - 1, twos, threes);
    }
    if (twos > 0)
    {
        p2 = (long double)twos / nonEmptyPlates * Cal(N, ones + 1, twos - 1, threes);
    }
    if (threes > 0)
    {
        p3 = (long double)threes / nonEmptyPlates * Cal(N, ones, twos + 1, threes - 1);
    }
    dp[ones][twos][threes] = p1 + p2 + p3 + p_wasted / (1 - p_wasted);
    return dp[ones][twos][threes];
}

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    cout.tie(0);
    cin >> n;
    int ones = 0, twos = 0, threes = 0;
    int x;
    for (int i = 0; i < n; i++)
    {
        cin >> x;
        ones += (x == 1);
        twos += (x == 2);
        threes += (x == 3);
    }
    cout << fixed << setprecision(9) << ones + twos * 2 + threes * 3 + Cal(n, ones, twos, threes) << '\n';
    return 0;
}


Measured memory_bytes: 212796
import math
A, B, H, M = map(int, input().split())
c = math.radians(M * 6)
t = math.radians(H * 30 + M * 0.5)
a = c - t
d = math.sqrt(A**2 + B**2 - 2*A*B*math.cos(a))
print(d)

Measured memory_bytes: 9436
n,m = (int(i) for i in input().split())
l = 1
a = [input().split()for i in range(n)]
b = [input().split() for i in range(m)]
al = [[0 for i in range(l)]for j in range(n)]
for i in range(n):
    for j in range(m):
        al[i][l-1] += int(a[i][j]) * int(b[j][l-1])
    else:
        print(al[i][l-1])


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

using namespace std;

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

typedef long long ll;

const int Inf = 1e9;
const double EPS = 1e-9;

int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, k;
    int ans = 0;
    cin >> n >> k;
    vector<int> a(n);
    rep (i, n) cin >> a[i];

    rep (l, k + 1) {
        rep (r, k + 1 - l) {
            if (l + r > n) break;
            int d = k - l - r;
            int tmp = 0;
            vector<int> s;
            rep (i, l) {
                tmp += a[i];
                s.push_back(a[i]);
            }
            FOR (i, n - r, n) {
                tmp += a[i];
                s.push_back(a[i]);
            }
            sort(s.begin(), s.end());
            rep (i, d) {
                if (i >= s.size()) break;
                if (s[i] >= 0) break;
                tmp -= s[i];
            }
            ans = max(ans, tmp);
        }
    }
    cout << ans << endl;
    
    return 0;
}



Measured memory_bytes: 256
n = input()
n = int(n)

if n >= 1 and n <= 104:
    print(0)

elif n >= 105 and n <= 134:
    print(1)

elif n <= 164:
    print(2)

elif n <= 188:
    print(3)

elif n <= 194:
    print(4)

else:
    print(5)


Measured memory_bytes: 2940