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

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; }

using ll = long long;
using Graph = vector<vector<ll>>;
vector<int> color;
bool dfs(const Graph &g, ll v, int cur = 0) {
  color[v] = cur;
  for(auto nv: g[v]){
    if(color[nv]!=-1){
      if(color[nv]==color[v]) return false;
      continue;
    }
    if(!dfs(g,nv,1-cur)) return false;
  }
  return true;
}

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

int main() {
  ll N, M;
  cin >> N>> M;
  color.assign(N,-1);
  Graph g(N);
  for(ll i = 0LL; i< M; i++) {
    ll x, y;
    cin >> x >> y;
    g.at(x-1LL).push_back(y-1LL);
    g.at(y-1LL).push_back(x-1LL);
  }
  ll cnt=0LL;
  if(!dfs(g,0LL)) cnt = (N*(N-1LL))/2LL;
  else {
    ll t=0LL;
    ll s = 0LL;
    for(auto i: color) {
      if(i==0) t++;
      if(i==1) s++;
    }
    cnt = s*t;
  }
  cout<<cnt-M<<endl;
}
      

Measured memory_bytes: 7040
import java.util.Scanner;

class Main{
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
		String[] line = sc.nextLine().split(" ");
		int n =Integer.parseInt(line[0]);
		int m =Integer.parseInt(line[1]);
		int l =Integer.parseInt(line[2]);
		int[][] a =new int[n][m];
		int[][] b =new int[m][l];
		long[][] c =new long[n][l];
	//A
		for(int i=0;i<n;i++){
			String[] input = sc.nextLine().split(" ");
			for(int j=0;j<m;j++){
				a[i][j]=Integer.parseInt(input[j]);
			}
		}
	//B
		for(int i=0;i<m;i++){
			String[] input= sc.nextLine().split(" ");
			for(int j=0;j<l;j++){
				b[i][j]=Integer.parseInt(input[j]);
			}
		}
	//C
		for(int i=0;i<n;i++){
			for(int j=0;j<l;j++){
				c[i][j]=0;
				for(int k=0;k<m;k++){
					c[i][j]=c[i][j]+a[i][k]*b[k][j];
				}
			}
		}
	//System.out
		for(int i=0;i<n;i++){
			for(int j=0;j<l-1;j++){
				System.out.print(c[i][j]+" ");
			}
			System.out.println(c[i][l-1]);
		}
	}
}

Measured memory_bytes: 38256
#include <iostream>
#include <cstdio>
#include <string>
using namespace std;

int main()
{
    int n;
    cin>>n;
    string S,T;
    cin>>S>>T;
    int i;
    int max=0;
    for(i=1;i<=T.length()&&i<=S.length();i++){
        if(S.substr(S.length()-i,i)==T.substr(0,i))
            max=i;
    }
    cout<<T.length()+S.length()-(max)<<endl;

    return 0;
}


Measured memory_bytes: 256
#define ll				long long
#define MOD				1000000007

#include <float.h>
#include <limits.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>

typedef struct data {
	int a;
	int b;
} data;

FILE *in, *ans;
int tno;

int out(const char *s) {
#ifdef TEST
	char buf[8192];
	fgets(buf, sizeof(buf), ans);
	if (strcmp(buf, s)) {
		printf("err\n");
	}
#else
	printf(s);
#endif
	return 0;
}

int outi(int i) {
	char s[128];
	sprintf(s, "%d\n", i);
	out(s);
	return 0;
}

int outd(double d) {
	char s[128];
	sprintf(s, "%.10lf\n", d);
	out(s);
	return 0;
}

int outll(ll l) {
	char s[128];
	sprintf(s, "%lld\n", l);
	out(s);
	return 0;
}

int geti() {
	int i;
	fscanf(in, "%d", &i);
	return i;
}

ll getll() {
	ll l;
	fscanf(in, "%lld", &l);
	return l;
}

int getstr(char *s) {
	fscanf(in, "%s", s);
	return 0;
}

double d[100000];

int fnc() {

	int i;
	int n = geti();
	int k = geti();

	for (i = k - 1; i > 0; i--) {
		if (i * 2 >= k) {
			d[i] = 0.5;
		}
		else {
			d[i] = d[i * 2] * 0.5;
		}
	}

	double sum = 0;
	for (i = 1; i <= n; i++) {
		if (i < k) {
			sum += d[i];
		}
		else {
			sum += 1.0;
		}
	}

	outd(sum / (double)n);

	return 0;
}

int main() {

#ifdef TEST
	for (tno = TEST_SNO; tno <= TEST_ENO; tno++) {
		char str[128];
		sprintf(str, "test%d.txt", tno);
		in = fopen(str, "r");
		sprintf(str, "ans%d.txt", tno);
		ans = fopen(str, "r");
		fnc();
		fclose(in);
		fclose(ans);
	}
	printf("end\n");
#else
	in = stdin;
	fnc();
#endif

	return 0;
}


Measured memory_bytes: 896
import java.io.DataInputStream;
import java.io.FileInputStream;
import java.io.IOException;
import java.util.*;

import javax.sound.sampled.ReverbType;

public class Main {

	 static Scanner scan=new Scanner(System.in);
	 static int cnt=0;
	 static int M=(int)1e9+7;
	static boolean issamedi(int i,int j){
		if(i>0&&j<0)
			return false;
		if(i>0&&j>0&&i>j)
			return false;
		return true;
		
		
	}

	
		static boolean isvowel(char c) {
			return c=='a'||c=='e'||c=='i'||c=='o'||c=='u';
			
		}
	 public static int maxVowels(String s, int k) {
	        int i=0;
	        ArrayList<Integer>lenghts=new ArrayList<Integer>();
	        for(int j=0;j<s.length();j++) {
	        	if(i==k)
	        		i=0;
	        	if(!isvowel(s.charAt(j)))
	        		i=0;
	        	if(isvowel(s.charAt(j))) {
	        		i++;
	        		lenghts.add(i);
	        		}
	        	
	        }
	        try {
	        return Collections.max(lenghts);
	        }
	        catch (NoSuchElementException e) {
	        return 0;}
	    }
	
	 static int convert(int n) {
		 String s=String.valueOf(n);
		 String s1="";
		 s1+=s.charAt(0);
		 int c=0;
		 for(int i=1;i<s.length();i++)
		 s1+='0';
		 return Integer.parseInt(s1);
	 }
	 static  boolean ispositive(ArrayList<Integer>ar) {
		 for(int i=0;i<ar.size();i++) {
			 if(ar.get(i)>0)
				 return true;
			 }
		 return false;
		 
	 }
	public static void main(String[] args) throws IOException {
int sum=0;
		for(int i=0;i<5;i++) {
			int a=scan.nextInt();
			sum+=a;
			
		}
		System.out.println((5*(5+1)/2)-sum);
		
		
 }




	
	

	
	

	

	
}


Measured memory_bytes: 35516
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=1e5+5,M=2e4+5,inf=0x3f3f3f3f,mod=1e9+7;
#define mst(a,b) memset(a,b,sizeof a)
#define lx x<<1
#define rx x<<1|1
#define reg register
#define PII pair<int,int>
#define fi first
#define se second
#define pb push_back
#define il inline
int r[N];
struct edge{
	int u,v,w;
	bool operator<(const edge& e)const{
		return w<e.w;
	}
}e[N<<1];
struct point{
	int x,y,id;
}a[N];
bool cmp1(point a,point b){
	return a.x<b.x;
}
bool cmp2(point a,point b){
	return a.y<b.y;
}
int find(int x){
	return r[x]==x?x:r[x]=find(r[x]);
}
int main(){
	int n;cin>>n;
	for(int i=1;i<=n;i++){
		cin>>a[i].x>>a[i].y;
		a[i].id=r[i]=i;
	}
	sort(a+1,a+n+1,cmp1);
	int s=0;
	for(int i=2;i<=n;i++){
		e[s++]={a[i-1].id,a[i].id,a[i].x-a[i-1].x};
	}
	sort(a+1,a+n+1,cmp2);
	for(int i=2;i<=n;i++){
		e[s++]={a[i-1].id,a[i].id,a[i].y-a[i-1].y};
	}
	sort(e,e+s);
	int tot=0;
	ll ans=0;
	for(int i=0;i<s;i++){
		int u=e[i].u,v=e[i].v;
		u=find(u),v=find(v);
		if(u!=v){
			r[u]=v;
			tot++;
			ans+=e[i].w;
		}
		if(tot==n-1) break;
	} 
	cout<<ans<<endl; 
	return 0;
}

Measured memory_bytes: 7540
w,h,n = map(int,input().split())

x = [int(i) for i in range(w+1)]
y = [int(i) for i in range(h+1)]

for i in range(n):
    x_i, y_i, a = map(int,input().split())
    if a == 1:
        x = [int(j) for j in x if j >= int(x_i)]
    elif a == 2:
        x = [int(j) for j in x if j <= int(x_i)]
    elif a == 3:
        y = [int(j) for j in y if j >= int(y_i)]
    elif a == 4:
        y = [int(j) for j in y if j <= int(y_i)]
if len(x) == 0 or len(y) == 0:
    print('0')
else:
    print((max(x)-min(x)) * (max(y)-min(y)))

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

typedef long long ll;

using namespace std;

#define rep(i,n) for(int i=0;i<(n);i++)
#define reps(i,l,n) for(int i=(l);i<(n);i++)

int main(){
    string s;
    cin >> s;
    string res = s;
    reverse(res.begin(),res.end());
    if(s == res){
        string s2 = s.substr(0,(s.size()-1)/2);
        string res2 = s2;
        reverse(res2.begin(),res2.end());
        if(s2 == res2){
            string s3 = s.substr((s.size()+3)/2-1);
            string res3 = s3;
            reverse(res3.begin(),res3.end());
            if(s3 == res3){
                cout << "Yes" << endl;
                return 0;          
            }
        }
    }
    cout << "No" << endl;
    return 0;
}


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

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef vector<pair<int, int> > vpii;
typedef vector<pair<ll, ll> > vpll;

#define pll pair<ll,ll>
#define pii pair<int, int>
#define all(x) x.begin(), x.end()
#define F first
#define S second
#define rep(i,n) for (int i = 0; i < n; ++i) 
#define REP(i,k,n) for (int i = k; i <= n; ++i) 
#define REPR(i,k,n) for (int i = k; i >= n; --i)
#define pb push_back
#define watch(x) cout << (#x) << " is " << (x) << endl
#define sz(a) int((a).size())
#define endl '\n' // remove for interactive

const int INF = 1e9;
const ll mod = 1e9 + 7;
ll powmod(ll a,ll b) {ll res=1;a%=mod; assert(b>=0); for(;b;b>>=1){if(b&1)res=res*a%mod;a=a*a%mod;}return res;}

const int N = 2e3 + 10;

int pref[N][N];

int dp[N][N];


void solve()
{
    int n; cin>>n;
    REP(i, 1, 2e3) {
        dp[i][0] = 1;
        pref[i][0] = 1;
        dp[1][i] = 1;
        pref[1][i] = (pref[1][i-1]+dp[1][i])%mod;
        pref[i][0] = 1;
    }
    REP(i, 2, 2e3) {
        REP(j, 1, 2e3) {
            dp[i][j] = pref[i-1][j];
            pref[i][j] = (pref[i][j-1] + dp[i][j]) % mod;
        }
    }
    ll ans = 0;
    int cnt = 1;
    while(1) {
        if(cnt*3 > n) break;
        ans = (ans+dp[cnt][n-3*cnt]) % mod;
        cnt++;
    }
    // watch(dp[3][1]);
    // watch(pref[2][1]);
    cout<<ans<<endl;
    
}

int main()
{
    // clock_t start, end;
    // start = clock();
    ios_base::sync_with_stdio(0); //cant use scanf, printf
    cin.tie(0);cout.tie(0); // no longer auto flush cout before each cin, remove for interactive
    int t = 1;
    // cin>>t;
    REP(i, 1, t)
    {
        solve();
        
    }
    // end = clock();
    // double time_taken = double(end - start) / double(CLOCKS_PER_SEC); 
    // watch(time_taken);
    ll x = INF; x++;
    return 0;
    
}



/*before sub
TEST: 0(1 by 1 too), 1, equal, -ve, bounds(random and ez)
ERR/WA: loop vars, out of bounds, endl, finish taking inputs, large doubles, larger INF, corr mod, t, early/late mod
RE: double dec, integer overflow(ll or 1LL mult)
*/





Measured memory_bytes: 35048
#include <iostream>
#include <cstdio>
#include<cstring>
#include <algorithm>
#include <cmath>
typedef  long long LL;
using namespace std;
LL po(LL n)
{
    LL k=1;
    for(LL i=0;i<n;i++)
        k=k*2;
    return k;
}

int main()
{
    //cout<<po(5);
   LL n,m;
   cin>>m>>n;
  cout<<((m-n)*100+1900*n)*po(n)<<endl;
    return 0;
}


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

void bubble(int P[], int N) {
    bool flag = 1;
    while(flag) {
        flag = 0;
        for(int i = N - 1; i > 0; i--) {
            if(P[i] < P[i - 1]) {
                swap(P[i], P[i - 1]);
                flag = 1;
            }
        }
    }
}

int main() {
    int P[10000], N, K;
    cin >> N >> K;
    for(int i = 0; i < N; i++) cin >> P[i];

    bubble(P, N);
    
    int total = 0;
    for(int i = 0; i < K; i++) {
        total += P[i];
    }

    cout << total << endl;

    return 0;
}

Measured memory_bytes: 3648
#include<bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp> 
#include <ext/pb_ds/tree_policy.hpp> 
#define ll long long
#define ld long double
#define mk make_pair
#define fi first
#define se second
#define vll vector<ll>
#define pii pair<ll,ll>
#define vvll vector< vector<ll> >
#define pb push_back
#define sz(v) (v).size()
#define inf 1e18
#define md 1000000007
#define all(v) (v).begin(),(v).end()
#define rep(i,a,b) for(ll i=a;i<b;++i)
#define tel(a){cout<<a<<"\n";}
#define tell(a,b){cout<<a<<" | "<<b<<"\n";}
#define telll(a,b,c){cout<<a<<" | "<<b<<" | "<<c<<"\n";}
#define teln(v,n){cout<<"v- ";rep(i,0,n)cout<<v[i]<<" ";cout<<"\n";}
#define IOS ios_base::sync_with_stdio(false);cin.tie(0);cout.tie(0); 

using namespace std;
using namespace __gnu_pbds;

template<typename T>
using o_set=tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;

#define M 1000010

int main(){
	IOS;
	ll n;cin>>n;
	ll p[n],f[M]={0},sum=0;
	rep(i,0,n){cin>>p[i];f[p[i]]++;}
	ll ans=0,val=0;
	rep(i,0,M)sum+=f[i];
	rep(i,0,M){
		val+=f[i];
		if(val==(sum-val))ans++;
	}
	cout<<ans;
	
	
	return 0;
}



Measured memory_bytes: 8832
from collections import deque

row, col = map(int, input().split())
graph = [list(input()) for i in range(row)]

ans = 0
dx = [1, 0, -1, 0]
dy = [0, 1, 0, -1]

seen = deque([])
finished = deque([])

for i in range(row):
  for j in range(col):
    if graph[i][j] == "#":
      finished.append([i, j])
      
while True:

  while len(finished) > 0:
    v = finished.popleft()
    for j in range(4):
      next_y, next_x = v[0]+dy[j], v[1]+dx[j]
      if not 0 <= next_y < row or not 0 <= next_x < col:
        continue
      if graph[next_y][next_x] == '#':
        continue 

      graph[next_y][next_x] = "#"
      seen.append([next_y, next_x])
  
  if len(seen) == 0:
    break
  seen, finished = deque([]), seen
  ans += 1
      
print(ans)

Measured memory_bytes: 168540
#include<bits/stdc++.h>
#define REP(x,y,z) for(int x=y;x<=z;x++)
#define MSET(x,y) memset(x,y,sizeof(x))
#define M 
using namespace std;
int main()
{
    int a,b,c;
    while (~scanf("%d %d %d", &a,&b,&c)) {
        printf("%d\n", a*b/2);
    }
    return 0;
}


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

using namespace std;

const int N=1e6+3;

#define pb push_back
#define all(x) (x).begin(),(x).end()
typedef long long ll;

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

const int inf=1e9;

int n,m,a[N],b[N],k,q,u,v,x,y,tc,c,l,r,ans,sz[N];

char s[N];

void IO(){
	#ifndef ONLINE_JUDGE
		freopen("test.txt","r",stdin);
	#endif
}

ll dp[55][55][2600];

ll solve(int idx,int cnt,int sum){
	if (idx>=n)
			return sum && (cnt*k == sum);
	ll &r=dp[idx][cnt][sum];
	if (r!=-1)
		return r;
	r=0;
	r+=solve(idx+1,cnt+1,sum+a[idx]);
	r+=solve(idx+1,cnt,sum);
	return r;
}

int main(){
	//IO();
	memset(dp,-1,sizeof dp);
	scanf("%d%d",&n,&k);
	for(int i=0;i<n;i++)
		scanf("%d",&a[i]);
	printf("%lld",solve(0,0,0));
}


Measured memory_bytes: 67840
#include<iostream>
#include<vector>
#include<bits/stdc++.h>
#define lli long long int
#define mod 1000000007
#define pb push_back
#define mk make_pair
#define fastio ios_base::sync_with_stdio(false); cout.tie(NULL);
using namespace std;

int main()
{
	fastio;
	lli a,b,n,x,mx;
	cin>>a>>b>>n;
	x=a/b;
	if(x>0)
	{
		if(n<b)
			cout<<(a*n)/b;
		else
			cout<<(a*(b-1))/b;
	}
	else
	{
		if(n<b)
			cout<<(n*a)/b;
		else
			cout<<(a*(b-1))/b;
	}
	return 0;
}


Measured memory_bytes: 3624
#include <bits/stdc++.h>
using namespace std;
#define modulo 998244353
#define mod(mod_x) ((((long long)mod_x+modulo))%modulo)
#define Inf 100000000000000000



int main(){
	
	string S;
	cin>>S;
	
	int ans = S.size();
	
	for(int i=0;i<S.size()-1;i++){
		if(S[i]==S[i+1])continue;
		int k = max(i+1,(int)S.size()-(i+1));
		ans = min(k,ans);
	}
	
	cout<<ans<<endl;
	
    return 0;
}


Measured memory_bytes: 512
#include<bits/stdc++.h>
using namespace std;
int n,k,a[101];
int main(){
  while(cin>>n>>k,n){
    for(int i=0;i<n;i++)cin>>a[i];
    int t=0,s=0;
    for(int i=0;i<n;i++){
      int x=1;
      for(int j=i,p=0;p<k&&j<n;p++,j++)
        x*=a[j];
      t=max(t,x);
    }
    for(int i=0;i<n;i++)
      for(int j=0;j<n;j++){
        swap(a[i],a[j]);
        for(int q=0;q<n;q++){
          int y=1;
          for(int w=q,p=0;p<k&&w<n;w++,p++)
            y*=a[w];
          s=max(s,y);
        }
        swap(a[j],a[i]);
      }
    if(t<s)cout<<s-t<<endl;
    else cout<<0<<endl;
  }
}

Measured memory_bytes: 3088
#include<bits/stdc++.h>
using namespace std;
const int N=100005;
int a[N],l,x,y,fi[N],ne[N],tot,zz[N],n,dp[N];
void jb(int x,int y){
	ne[++tot]=fi[x];
	fi[x]=tot;
	zz[tot]=y;
}
void down(int x){
	int i=x;
	if (x*2<=l&&a[x]>a[x*2])i=x*2;
	if (x*2<l&&a[i]>a[x*2+1])i=x*2+1;
	if (i!=x){
		swap(a[x],a[i]);
		down(i);
	}
}
void up(int x){
	if (x==1)return;
	if (a[x]<a[x/2]){
		swap(a[x],a[x/2]);
		up(x/2);
	}
}
void dfs(int x){
	for (int i=fi[x];i;i=ne[i])dfs(zz[i]);
	int l=0;
	for (int i=fi[x];i;i=ne[i])a[++l]=dp[zz[i]];
	sort(a+1,a+l+1);
	for (int i=1;i<=l;i++)dp[x]=max(a[i]+l-i+1,dp[x]);
}
int main(){
	scanf("%d",&n);
	for (int i=2;i<=n;i++){
		scanf("%d",&x);
		jb(x,i);
	}
	dfs(1);
	printf("%d\n",dp[1]);
}

Measured memory_bytes: 6528
#include<iostream>
#include<vector>
#include<string>
#include<algorithm>
#include<cmath>
#include<cstdlib>
#include<tuple>
#define int long long
using namespace std;

signed main() {
	string S;
	cin >> S;
	if(S.at(0) == S.at(1) && S.at(2) == S.at(3) && S.at(0) != S.at(3)) {
		cout << "Yes" << endl;
	}
	else if(S.at(0) == S.at(2) && S.at(1) == S.at(3) && S.at(0) != S.at(1)) {
		cout << "Yes" << endl;
	}
	else if(S.at(0) == S.at(3) && S.at(1) == S.at(2) && S.at(0) != S.at(1)) {
		cout << "Yes" << endl;
	}
	else {
		cout << "No" << endl;
	}
}

Measured memory_bytes: 256
#include <iostream>
#include <vector>
#include <cstdlib>

void funcD() {
  int n, x, y;
  std::cin >> n >> x >> y;
  x--;
  y--;
  std::vector<int> sum(n, 0);
  for (int i = 0; i < n; i++) {
    for (int j = i + 1; j < n; j++) {
      int a = j - i;
      int b = std::abs(x-i)+std::abs(y-j)+1;
      a < b ? sum[a]++ : sum[b]++;
    }
  }
  for (int i = 1; i < n; i++)std::cout << sum[i]<<"\n";
}

int main(void) {
  funcD();
  return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define endl "\n"
#define se second
#define ls( s) (s&(-s))
#define ll long long
#define inf 0x3f3f3f3f
const ll N = 200030;
#define rep(i, begin, end) for (__typeof(end) i = (begin) - ((begin) > (end)); i != (end) - ((begin) > (end)); i += 1 - 2 * ((begin) > (end)))
const ll mod =    1e9+7;
int h,w;
string s[25];
bool valid(int x,int y)
{
	if(x>=0&&x<h&&y>=0&&y<w)
	return true;
	return false;
}
int main()
{ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
cin>>h>>w;
rep(i,0,h)
cin>>s[i];
int mx=0;
for(int i=0;i<h;i++)
{
	for(int j=0;j<w;j++)
	{
		if(s[i][j]=='.')
		{
			bool bo[30][30];
			memset(bo,false,sizeof(bo));
			queue<pair<int,int> > q;
			q.push({i,j});
             bo[i][j]=true;
			q.push({-1,-1});
			int cnt=0;
			while(!q.empty())
			{

				pair<int,int> p;
				p=q.front();
					q.pop();
				if(p.fi==-1){

				cnt++;

				if(q.size()==0)
				break;
				q.push({-1,-1});}
				else
				{

				
			
				int a[4]={-1,0,1,0};
				int b[4]={0,-1,0,1};
				bool g=false;
				
				for(int k=0;k<4;k++)
				{
					if(valid(p.fi+a[k],p.se+b[k])&&s[p.fi+a[k]][p.se+b[k]]!='#')
					if(bo[p.fi+a[k]][p.se+b[k]]==false){
					 g=true;
                      bo[p.fi+a[k]][p.se+b[k]]=true;
					q.push({p.fi+a[k],p.se+b[k]});
					}
				}
}
			}
   mx=max(mx,cnt-1);
			cnt=0;
		}
	}
}
cout<<mx;

}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (int)(n); i++)
#define all(vec) vec.begin(), vec.end()
#define END return 0
typedef int64_t ll;
const int mod7 = 1e9 + 7;
const int mod9 = 1e9 + 9;
const int inf = 1 << 30;
const ll INF = 1LL << 60;
template<typename T> T gcd(T a, T b) {return b ? gcd(b, a % b) : abs(a);}
template<typename T> T lcm(T a, T b) {return a / gcd(a, b) * b;}
template<typename T> bool chmax(T &a, T b) {if (a < b) {a = b; return true;} return false;}
template<typename T> bool chmin(T &a, T b) {if (a > b) {a = b; return true;} return false;}
template<typename A, size_t N, typename T> void Fill(A (&array)[N], const T &val) {fill((T*)array, (T*)(array+N), val);}

int main() {
    int n;
    cin >> n;
    int x[n];
    rep(i, n) cin >> x[i];
    int ans = inf;
    for(int i = 1; i <= 100; i++){
        int score = 0;
        rep(j, n) score += (i - x[j]) * (i - x[j]);
        chmin(ans, score);
    }
    cout << ans << endl;
}

Measured memory_bytes: 256
use std::io::*;

fn read<T: std::str::FromStr>() -> T {
    let mut s = String::new();
    stdin().read_line(&mut s).ok();
    s.trim().parse().ok().unwrap()
}

fn main() {
    two_colors_card_game();
}

fn two_colors_card_game() {
    let n: i64 = read();
    let mut s: Vec<String> = vec![];
    for i in 0..n {
        let si: String = read();
        s.push(si);
    }
    let m: i64 = read();
    let mut t: Vec<String> = vec![];
    for i in 0..m {
        let ti: String = read();
        t.push(ti);
    }
    let mut diffs: Vec<i64> = vec![];
    for si in &s {
        diffs.push(same(&s, &si) - same(&t, &si));
    }
    println!("{}", max_vec(diffs));
}

fn same(v: &Vec<String>, s: &String) -> i64 {
    let mut m: i64 = 0;
    for vi in v {
        if vi == s {
            m += 1;
        }
    }
    return m
}

fn max_i64(n: i64, m: i64) -> i64 {
    let diff = n - m;
    match diff {
        diff if diff < 0 => m,
        _                => n
    }
}

fn max_vec(v: Vec<i64>) -> i64 {
    let mut m = 0;
    for vi in v {
        m = max_i64(m, vi);
    }
    return m
}

Measured memory_bytes: 4352
// SeeAlso: 

#include <bits/stdc++.h>

using namespace std;

typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;

#define MAX 100000

typedef int _loop_int;
#define REP(i,n) for(int i = 0; i < n; i++)
#define FOR(i,a,b) for(_loop_int i=(_loop_int)(a);i<(_loop_int)(b);++i)
#define FORR(i,a,b) for(_loop_int i=(_loop_int)(b)-1;i>=(_loop_int)(a);--i)

#define DEBUG(x) cout<<#x<<": "<<x<<endl
#define DEBUG_VEC(v) cout<<#v<<":";REP(i,v.size())cout<<" "<<v[i];cout<<endl
#define ALL(a) (a).begin(),(a).end()

#define CHMIN(a,b) a=min((a),(b))
#define CHMAX(a,b) a=max((a),(b))

// 最大公約数
inline constexpr ll gcd(ll a,ll b){if(!a||!b)return 0;while(b){ll c=b;b=a%b;a=c;}return a;}
// 最小公倍数
inline constexpr ll lcm(ll a,ll b){if(!a||!b)return 0;return a*b/gcd(a,b);}

#define print2D(h, w, arr) REP(i, h) { REP(j, w) cout << arr[i][j] << " "; cout << endl; }
template<class T> void print(const T& x){cout << setprecision(12) << x << endl;}
template<class T, class... A> void print(const T& first, const A&... rest) { cout << first << " "; print(rest...); }

float T,X;

int main() {
    cin >> T >> X;
    float t;
    t =  T / X;
    print(t);    
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<climits>
#include<math.h>
#include<vector>
#include<algorithm>
#include<cstdio>
#include<cstring>
#include<stdio.h>
#include <string>
#include <complex>
#include <functional>
#include <map>
#include <queue>
using namespace std;
using ll = long long;
//typedef pair<string,string> P;
//double dat[100][100];
//int dp[6][1010];//動的計画法
//int prime[100001];
//char str[1010][1010];
//typedef pair<ll,ll> A;
//vector<A> pc;
//int ABS(int a){return max(a,-a);}
int main() {
  int n,r=0,b=0;
  string s;
  cin>>n;
  cin>>s;
  for(int i=0;i<n;i++){
    if(s[i]=='R') r++;
    else b++;
  }
  if(r>b) cout<<"Yes"<<endl;
  else cout<<"No"<<endl;
  return 0;
}

Measured memory_bytes: 256
from collections import Counter


n, m = map(int, input().split())
a = list(map(int, input().split()))
x = Counter(a)

for i in range(m):
    b, c = map(int, input().split())
    x[c] += b

y = list(zip(x.keys(), x.values()))
y.sort(reverse=True)

ans = 0
k = 0
for z in y:
    if k + z[1] <= n:
        ans += z[0] * z[1]
        k += z[1]
    else:
        ans += z[0] * (n - k)
        k = n
        break
print(ans)


Measured memory_bytes: 44452
#include<iostream>

using namespace std;
int mtrx[500][500];
const int inf=1e8;

int main(){
    while(1){
        int n, m;
        cin>> n>> m;
        if(n==0&&m==0) break;
        int a[m], b[m];
        for(int i=0; i<m; i++){
            cin>> a[i]>> b[i];
            a[i]--; b[i]--;
        }

        fill(mtrx[0], mtrx[500], inf);
        for(int i=0; i<m; i++){
            mtrx[a[i]][b[i]]=mtrx[b[i]][a[i]]=1;
        }
        for(int k=0; k<n; k++)
            for(int i=0; i<n; i++)
                for(int j=0; j<n; j++)
                    mtrx[i][j]=min(mtrx[i][j], mtrx[i][k]+mtrx[k][j]);
        int ans=0;
        for(int i=0; i<n; i++){
            if(i==0) continue;// myself
            if(mtrx[0][i]==1||mtrx[0][i]==2) ans++;
        }

        cout<< ans<< endl;
    }

    return 0;
}

Measured memory_bytes: 4148
#include <bits/stdc++.h>
#include <math.h>
#define uint unsigned long long
#define ll long long
#define db double
#define ls rt << 1
#define rs rt << 1 | 1
#define pb push_back
#define mp make_pair
#define pii pair<int, int>
#define X first
#define Y second
#define pcc pair<char, char>
#define vi vector<int>
#define vl vector<ll>
#define rep(i, x, y) for(int i = x; i <= y; i ++)
#define rrep(i, x, y) for(int i = x; i >= y; i --)
#define ept 1e-9

using namespace std;
inline int read()
{
    int x = 0, f = 1; char ch = getchar();
    while (ch < '0' || ch > '9') { if (ch == '-') f = -1; ch = getchar(); }
    while (ch >= '0' && ch <= '9') { x = x * 10 + ch - '0'; ch = getchar(); }
    return x * f;
}
const int mod = 1e9 + 7;
const int N = 100010;
int n;
int a[N], po[N];

int main()
{
    po[0] = 1;
    for(int i = 1; i < N; i++)
	    po[i] = po[i - 1] * 2 % mod;

    n = read();
    rep(i, 0, n - 1) a[i] = read();

    sort(a, a + n);

    if(n % 2)
    {
    	rep(i, 0, n - 1)
            if(a[i] != ((i + 1) / 2) * 2)
            {
                printf("0");
                return 0;
            }
    }
    else
    {
    	rep(i, 0, n - 1)
            if(a[i] != (i / 2) * 2 + 1)
            {
                printf("0");
                return 0;
            }
    }
    printf("%d", po[n / 2]);
    return 0;
}


Measured memory_bytes: 1024
//You tube解説放送
 #include <bits/stdc++.h>
 using namespace std;
 #define rep(i,N) for(int i=0;i<int(N);++i)
 using ll = long long;

vector<int> to[100005];

int main() {
    int n,m;
    cin >> n >> m;
    for(int i=0;i<m;i++){
        int a,b;
        cin >> a >> b;
        //デクリメント忘れない
        --a;--b;
        //連結リスト
        to[a].push_back(b);
        to[b].push_back(a);
    }
    //dist と preを求める BFS
    vector<int> dist(n,-1); //キョリ
    vector<int> pre(n,-1); //直前の頂点
    queue<int> que;
    dist[0] = 0;
    que.push(0);
    while(!que.empty()){
        int now = que.front();
        que.pop();
        for(int u:to[now]){
            if(dist[u]!=-1) continue;
            dist[u] = dist[now]+1;
            pre[u] = now;
            que.push(u);
        }
    }
    cout << "Yes" << endl;
    for(int i=0;i<n;i++){
        if(i==0) continue;
        int ans = pre[i];
        ++ans;
        cout << ans << endl;
    }
    return 0;
}


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

// types
typedef long long ll;
typedef long double ld;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
typedef pair<ld,ld> pdd;
typedef vector<ll> vll;

// macros
#define ALL(a) a.begin(),a.end()
#define SZ(a) ((int)a.size())
#define FI first
#define SE second
#define REP(i,n) for(int i=0;i<((int)n);i++)
#define REP1(i,n) for(int i=1;i<((int)n);i++)
#define FOR(i,a,b) for(int i=(a);i<(b);i++)
#define PB push_back
#define EB emplace_back
#define MP(a,b) make_pair(a,b)
#define SORT_UNIQUE(c) (sort(c.begin(),c.end()), c.resize(distance(c.begin(),unique(c.begin(),c.end()))))
#define GET_POS(c,x) (lower_bound(c.begin(),c.end(),x)-c.begin())
#define Decimal fixed<<setprecision(20)
#define INF 1000000000
#define LLINF 1000000000000000000LL

// constants
const int inf = 1e9;
const ll linf = 1LL << 50;
const double eps = 1e-10;
const int MOD = 1e9 + 7;
const int dx[4] = {-1, 0, 1, 0};
const int dy[4] = {0, -1, 0, 1};

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

  ll n,x;
  cin >> n >> x;

  vll m(n);
  REP(i, n)
    cin >> m[i];

  ll remain = x;
  REP(i, n)
    remain -= m[i];

  ll ans = n + remain / *min_element(m.begin(), m.end());
  cout << ans << endl;
  
  
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
using ll = int64_t;
int main(){
    ll N, M;
    ll INF = 1145148931919810;
    cin >> N >> M;
    pair<ll, ll> a[M];
    for(ll i = 0; i < M; i++){
        cin >> a[i].first >> a[i].second;
    }
    sort(a, a + M);
    ll ans = 1;
    ll left = a[0].first, right = a[0].second;
    for(ll i = 1; i < M; i++){
        if(a[i].first < right){
            right = min(right, a[i].second);
            left = a[i].first;
        }else{
            left = a[i].first;
            right = a[i].second;
            ans++;
        }
    }
    cout << ans << endl;
    return 0;
}


Measured memory_bytes: 1792
a, b, c, k = input().strip().split()
a, b, c, k = [int(a), int(b),int(c), int(k)]
total = 0
k2 = 0
if a > k:
  total = k
else:
  k2 = k-a
  total = a
if k2 > 0:
  if b > k2:
    k2 = 0
  else:
    k2 = k2 - b
if k2 > 0:
  if c > k2:
    total = total +(k2 * -1)
  else:
    total = total +(c * -1)
print(total)



Measured memory_bytes: 9204
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const long long INF = 1LL << 60;
const int mod = 1e9 + 7;

int gcd(int a, int b)
{
    return b ? gcd(b, a % b) : a;
}

int main()
{
    int k;
    cin >> k;
    ll ans = 0;
    for (int i = 0; i < k; i++)
    {
        for (int j = 0; j < k; j++)
        {
            ll max = gcd(i + 1, j + 1);
            for (int l = 0; l < k; l++)
            {
                ans += gcd(l + 1, max);
            }
        }
    }

    cout << ans << endl;

    return 0;
}

Measured memory_bytes: 3644
#include<cstdio>
int n,m,i,j,k,x,y,a[200005],st[400005],en[400005],last[200005],nxt[400005];
void build(int x,int y)
{
	k++,st[k]=x,en[k]=y,nxt[k]=last[x],last[x]=k;
}
void go(int x,int fa)
{
	for (int i=last[x];i;i=nxt[i])
	if (en[i]!=fa)
	{
		a[en[i]]+=a[x];
		go(en[i],x);
	}
}
int main()
{
	scanf("%d%d",&n,&m);
	for (i=1;i<n;i++)
	{
		scanf("%d%d",&x,&y);
		build(x,y);
		build(y,x);
	}
	for (i=1;i<=m;i++)
	{
		scanf("%d%d",&x,&y);
		a[x]+=y;
	}
	go(1,0);
	for (i=1;i<=n;i++)
	printf("%d ",a[i]);
	return 0;
}

Measured memory_bytes: 17920
import std.stdio, std.string, std.conv;
import std.range, std.algorithm, std.array;


void main() {
    int n;
    scan(n);
    writeln(n*(n + 1) / 2);
}



void scan(T...)(ref T args) {
    import std.stdio : readln;
    import std.algorithm : splitter;
    import std.conv : to;
    import std.range.primitives;

    auto line = readln().splitter();
    foreach (ref arg; args) {
        arg = line.front.to!(typeof(arg));
        line.popFront();
    }
    assert(line.empty);
}



void fillAll(R, T)(ref R arr, T value) {
    static if (is(typeof(arr[] = value))) {
        arr[] = value;
    }
    else {
        foreach (ref e; arr) {
            fillAll(e, value);
        }
    }
}


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

#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <string>
#include <functional>
#include <math.h>

typedef long long ll;
typedef unsigned long long ull;

#define FOR(i,a,b) for(int i=(a);i<(b);++i)
#define RFOR(i,a,b) for(int i=(b-1);i>=(a);--i)
#define REP(i,n)   FOR(i,0,n)
#define RREP(i,n)   RFOR(i,0,n)

const int INF = 1e9;
const int MOD = 1e9+7;

using namespace std;

template <typename _Ty>
ostream& operator << (ostream& ostr, const vector<_Ty>& v) {if (v.empty()) {ostr << "{ }"; return ostr;}
    ostr << "{" << v.front(); for (auto itr = ++v.begin(); itr != v.end(); itr++) {ostr << ", " << *itr;}
    ostr << "}";
    return ostr;}

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


int main(void){
  ios::sync_with_stdio(false);

  ll N, Q;
  cin >> N >> Q;
  string S;
  cin >> S;

  vector<ll> l(Q), r(Q);
  REP(i, Q){
    cin >> l[i];
    cin >> r[i];
  l[i]--;
  r[i] --;}

  vector<ll> val(N);
    ll count = 0;
  FOR(i, 1, N){
    if (S[i - 1] == 'A' && S[i] == 'C'){
      count++;
      val[i] = count;}
    else {val[i] = count;}
//      cout << val << endl;
    }

  REP(i, Q){
    ll ans;
    ans = val[r[i]] - val[l[i]];
    cout << ans << endl;
  }



  return 0;
}



Measured memory_bytes: 3536
#include <stdlib.h>
#include <stdio.h>
int compare_int(const void *a, const void *b)
{
    return *(int*)a - *(int*)b;
}

main()
{ int N,H,flag;
	scanf("%d%d",&N,&H);
    int a[100000];
   int b[100000];
    int i,j,k;
    long long int sum,tmp;
    for(k=0;k<=N-1;k++){
    	scanf("%d%d",&a[k],&b[k]);
    }
    sum=0;
    tmp=0;
    j=0;
    flag=0;
    qsort(a, N, sizeof(int), compare_int);
    qsort(b, N, sizeof(int), compare_int);
    
    for (i = N-1; i>=0 ; i--) {
    	if(b[i]>=a[N-1]){
    		sum+=b[i];
    		j++;
    		if(sum>=H){
    			printf("%d",j);
    			flag=1;
    			break;}}}
    if(flag==0){
    	if((H-sum)%a[N-1]!=0)
    k=1+(H-sum)/a[N-1];
    else
    k=(H-sum)/a[N-1];
    		printf("%d",j+k);
    		}
  
}

Measured memory_bytes: 1396
#include <iostream> // cin, cout, cerr, clog
#include <algorithm> // minmax, sort, swap
#include <numeric> // iota, accumulate, inner_product
#include <cstdio> // printf, scanf
#include <climits> // INT_MIN, LLONG_MIN
#include <cmath> // long, trig, pow
#include <string> // string, stoi, to_string
#include <vector> // vector
#include <queue> // queue, priority_queue
#include <deque> // deque
#include <stack> // stack
#include <map> // key-value pairs sorted by keys
#include <set> // set
#include <unordered_map> // hashed by keys
#include <unordered_set> // hashed by keys
#include <iomanip> // cout<<setprecision(n)
#include <functional> // std::function<void(int)>

#define rep(i,n) for(int i = 0; i < (n); i++)
#define ENDL '\n'
#define print(i) std::cout << (i) << '\n'

#define int long long // at least int64 > 9*10^18
#define all(v) (v).begin(), (v).end()
/* libraries */

signed main() {
	int n,k,q;
	std::cin >> n >> k >> q;
	std::vector<int> a(q);
	rep(i,q) std::cin >> a[i];

	int base = k-q;
	std::vector<int> points(n+1,base);
	for(int i:a) points[i]++;

	for(int i=1;i<=n;i++) {
		if(points[i]>0) print("Yes");
		else print("No");
	}

	return 0;
}


Measured memory_bytes: 2176
n,k=map(int,input().split())
lst=[0]*n
for i in range(k):
  d=int(input())
  #snackはお菓子を受け取る人のリスト
  snack=list(map(int,input().split()))
  for j in snack:
    lst[j-1]+=1
    
print(lst.count(0))

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

struct Dice {
  vector<int> num;
  void roll_north() {
    int t = num.at(0);
    num.at(0) = num.at(1);
    num.at(1) = num.at(5);
    num.at(5) = num.at(4);
    num.at(4) = t;
  }
  void roll_south() {
    int t = num.at(0);
    num.at(0) = num.at(4);
    num.at(4) = num.at(5);
    num.at(5) = num.at(1);
    num.at(1) = t;
  }
  void roll_east() {
    int t = num.at(0);
    num.at(0) = num.at(3);
    num.at(3) = num.at(5);
    num.at(5) = num.at(2);
    num.at(2) = t;
  }
  void roll_west() {
    int t = num.at(0);
    num.at(0) = num.at(2);
    num.at(2) = num.at(5);
    num.at(5) = num.at(3);
    num.at(3) = t;
  }
  void spin() {
    int t = num.at(1);
    num.at(1) = num.at(2);
    num.at(2) = num.at(4);
    num.at(4) = num.at(3);
    num.at(3) = t;
  }
  int get_top() {
    return num.at(0);
  }
  int get_front() {
    return num.at(1);
  }
  int get_right() {
    return num.at(2);
  }
  int get_left() {
    return num.at(3);
  }
};

int main() {
  int n;
  cin >> n;
  vector<Dice> d(n);
 
  rep(i, n) {
    rep(j, 6) {
      int num;
      cin >> num;
      d.at(i).num.push_back(num);
    }
  }

  rep(i, n) {
    rep(j, n) {
      if (i == j) continue;
      
      if (d.at(i).get_top() == d.at(j).get_left()) {
        d.at(j).roll_east();
      }

      if (d.at(i).get_top() == d.at(j).get_right()) {
        d.at(j).roll_west();
      }

      bool find = false;
      
      rep(k, 4) {
        if (d.at(i).get_top() == d.at(j).get_top()) {
          find = true;
          break;
        }

        d.at(j).roll_north();
      }
      
      if (find) {
        rep(k, 4) {
          find = true;
          
          rep(cnt, 6) {
            if (d.at(i).num.at(cnt) != d.at(j).num.at(cnt)) {
              find = false;
              break;
            }
          }
          if (find) {
            break;
          }
          else {
            d.at(j).spin();
          }
        }
      }

      if (find) {
        cout << "No" << endl;
        return 0;
      }
    }
  }

  cout << "Yes" << endl;
}


Measured memory_bytes: 3140
using System;
using System.Linq;
using System.Collections.Generic;
using static System.Console;
using System.Text;
using System.IO;
using static System.Math;
using System.Numerics;

namespace AtCoder
{
    public class Program
    {
        public static void Main(string[] args)
        {
            //SetOut(new StreamWriter(OpenStandardOutput()) { AutoFlush = false });
            Solve();
            //Out.Flush();
            Read();
        }

        static void Solve()
        {
            var (a, b) = Slice2<long>();
            if (a * b % 2 == 0)
                WriteLine("Even");
            else
                WriteLine("Odd");
        }
        static long Mod = 998244353;
        static public long[] Sarray() { return ReadLine().Split().Select(long.Parse).ToArray(); }
        static public List<long> Slist() { return ReadLine().Split().Select(long.Parse).ToList(); }
        static public (T1 a, T2 b) Slice<T1, T2>()
        {
            var t = ReadLine().Split();
            return (
            (T1)Convert.ChangeType(t[0], typeof(T1)),
            (T2)Convert.ChangeType(t[1], typeof(T2)));
        }
        static public (T a, T b) Slice2<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)));
        }
        static public (T a, T b, T c) Slice3<T>()
        {
            var t = ReadLine().Split();
            return (
            (T)Convert.ChangeType(t[0], typeof(T)),
            (T)Convert.ChangeType(t[1], typeof(T)),
            (T)Convert.ChangeType(t[2], typeof(T)));
        }
    }
}

Measured memory_bytes: 27292
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<iostream>
#include<algorithm>
#include<queue>
using namespace std;

int n,ans;
char a[1000005],t[1000005];
int pre;

queue<int>Q;

int same(){
	for(int i=1;i<=n;i++){
		if(a[i]!=t[i])return 0;
	}return 1;
}

int main(){
	scanf("%d",&n);
	scanf("%s",a+1);
	for(int i=1;i<=n;i++)a[i]-='a'-1;
	scanf("%s",t+1);
	for(int i=1;i<=n;i++)t[i]-='a'-1;
	if(same()){
		printf("0\n");
		return 0;
	}int i=n,pre=0;
	
	for(int j=n;j;j--){
		i=min(i,j);
		while(i&&a[i]!=t[j])i--;
		if(i==0){printf("-1");return 0;}
		if(i==pre)continue;
		else pre=i;
		while((!Q.empty())&&j<=Q.front()-Q.size())Q.pop();
		Q.push(pre);
		ans=max(ans,(int)Q.size());
	}printf("%d\n",ans);
	return 0;
}

Measured memory_bytes: 6272
#include <iostream>
#include <string>

using namespace std;

int main(){
	int X;
	cin >> X;
	if(X >= 400 && X <= 599) {
		cout << 8 << '\n';
	}
	else if(X >= 600 && X <= 799) {
		cout << 7 << '\n';
	}
	else if(X >= 800 && X <= 999) {
		cout << 6 << '\n';
	}
	else if(X >= 1000 && X <= 1199) {
		cout << 5 << '\n';
	}	
	else if(X >= 1200 && X <= 1399) {
		cout << 4 << '\n';
	}	
	else if(X >= 1400 && X <= 1599) {
		cout << 3 << '\n';
	}			
	else if(X >= 1600 && X <= 1799) {
		cout << 2 << '\n';
	}		
	else
	{
		cout << 1 << '\n';		
	}
				
	return 0;
}

Measured memory_bytes: 3632
#include<iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <tuple>
#include <cmath>
#include <queue>
#include <vector>
#include <map>
using namespace std;

#define ll int64_t
const long MOD = 1e9 + 7;



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

  string s="";
  for (int i = 0; i < a.size(); ++i)
  {
    if (a[i]=='0')s+="0";
    if (a[i]=='1')s+="1";
    if (a[i]=='B')if (s.size()!=0)s.pop_back();
  }

  cout << s << endl;

  return 0;
}


Measured memory_bytes: 256
import java.io.*;
 
class Main {
    static void call(int n){
        StringBuilder output = new StringBuilder();
        for(int i=3; i<=n; i++) {
            int x=i;
            if(x%3==0) {
                output.append(" "+i);
                continue;
            }
            do{
                if(x%10==3) {
                    output.append(" "+i);
                    break;
                }
                x/=10;
            }while(x!=0);
        }
        System.out.println(output);
    }
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
        int n = Integer.parseInt(br.readLine());
        call(n);
    }
}

Measured memory_bytes: 19956
main :: IO ()                                                                                                              
main = do                                                                                                                  
  n <- read <$> getLine                                                                                                    
  print $ f n                                                                                                              
                                                                                                                           
f :: Int -> Int                                                                                                            
f n                                                                                                                        
  | n >= 64 = 64                                                                                                           
  | n >= 32 = 32                                                                                                           
  | n >= 16 = 16                                                                                                           
  | n >= 8 = 8                                                                                                             
  | n >= 4 = 4                                                                                                             
  | n >= 2 = 2                                                                                                             
  | otherwise = 1

Measured memory_bytes: 508
#include<bits/stdc++.h>
#define ll long long
#define fast ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
 
int main()
{
    int array1[9],n,array3[9];
 
    for (int i = 0; i < 9; i++)
    {
    	array3[i] = 0;
    }
 
    for (int i = 0; i < 9; i++)
    {
    	cin >> array1[i];
    }
 
    cin >> n;
 
    int array2[n];
 
    for (int i = 0; i < n; i++)
    {
        cin >> array2[i];
    }
 
    for (int i = 0; i < 9; i++)
    {
    	for (int j = 0; j < n; j++)
    	{
    		if (array1[i] == array2[j]) 
    		{
    			array3[i] = 1;
    		}
    	}
    }
 
    string s = "No";
    
    if (array3[0] == 1 && array3[1] == 1 && array3[2] == 1)
    {
    	s = "Yes";
    }
    else if  (array3[3] == 1 && array3[4] == 1 && array3[5] == 1)
    {
    	s = "Yes";
    } 
    else if  (array3[6] == 1 && array3[7] == 1 && array3[8] == 1)
    {
    	s = "Yes";
    }
    else if  (array3[0] == 1 && array3[3] == 1 && array3[6] == 1)
    {
    	s = "Yes";
    }
    else if  (array3[1] == 1 && array3[4] == 1 && array3[7] == 1)
    {
    	s = "Yes";
    }
    else if  (array3[2] == 1 && array3[5] == 1 && array3[8] == 1)
    {
    	s = "Yes";
    }
    else if  (array3[0] == 1 && array3[4] == 1 && array3[8] == 1)
    {
    	s = "Yes";
    }
    else if  (array3[2] == 1 && array3[4] == 1 && array3[6] == 1)
    {
    	s = "Yes";
    }
 
    cout << s;

	return 0;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
inline int_fast64_t read(){int_fast64_t x=0,f=1;char c=getchar();while(c<'0'||c>'9'){if(c=='-')f=-1;c=getchar();}while(c>='0'&&c<='9')x=x*10+c-'0',c=getchar();return x*f;}
inline string read_s(){string s="";char c=getchar();while(c<'!'||c>'~'){c=getchar();}while(c>='!'&&c<='~'){s+=c;c=getchar();}return s;}
void Main(){
    int N = read(), L = read();
    int ans = N*(N+2*L-1)/2;
    if (L*(L+N-1) > 0) {
        ans -= L > 0 ? L : L+N-1;
    }
    printf("%d\n", ans);
}
int main(){cin.tie(nullptr);ios::sync_with_stdio(false);Main();return 0;}

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

#define rep(i, n) for (int i = 0; i < int(n); i++)
#define rrep(i, n) for (int i = int(n) - 1; i >= 0; i--)
#define reps(i, n) for (int i = 1; i <= int(n); i++)
#define rreps(i, n) for (int i = int(n); i >= 1; i--)
#define repc(i, n) for (int i = 0; i <= int(n); i++)
#define rrepc(i, n) for (int i = int(n); i >= 0; i--)
#define repi(i, a, b) for (int i = int(a); i < int(b); i++)
#define repic(i, a, b) for (int i = int(a); i <= int(b); i++)
#define each(x, y) for (auto &x : y)
#define all(a) (a).begin(), (a).end()
#define bit(b) (1ll << (b))
#define uniq(v) (v).erase(unique(all(v)), (v).end())

using namespace std;

using i32 = int;
using i64 = long long;
using f80 = long double;
using vi32 = vector<i32>;
using vi64 = vector<i64>;
using vf80 = vector<f80>;
using vstr = vector<string>;

inline void yes() { cout << "Yes" << '\n'; exit(0); }
inline void no() { cout << "No" << '\n'; exit(0); }
inline i64 gcd(i64 a, i64 b) { if (min(a, b) == 0) return max(a, b); if (a % b == 0) return b; return gcd(b, a % b); }
inline i64 lcm(i64 a, i64 b) { return a / gcd(a, b) * b; }
void solve(); int main() { ios::sync_with_stdio(0); cin.tie(0); cout << fixed << setprecision(16); solve(); return 0; }
template <typename T> class pqasc : public priority_queue<T, vector<T>, greater<T>> {};
template <typename T> class pqdesc : public priority_queue<T, vector<T>, less<T>> {};
template <typename T> inline void amax(T &x, T y) { if (x < y) x = y; }
template <typename T> inline void amin(T &x, T y) { if (x > y) x = y; }
template <typename T> inline T power(T x, i64 n, T e = 1) { T r = e; while (n > 0) { if (n & 1) r *= x; x *= x; n >>= 1; } return r; }
template <typename T> istream& operator>>(istream &is, vector<T> &v) { each(x, v) is >> x; return is; }
template <typename T> ostream& operator<<(ostream &os, vector<T> &v) { rep(i, v.size()) { if (i) os << ' '; os << v[i]; } return os; }
template <typename T, typename S> istream& operator>>(istream &is, pair<T, S> &p) { is >> p.first >> p.second; return is; }
template <typename T, typename S> ostream& operator<<(ostream &os, pair<T, S> &p) { cout << p.first << ' ' << p.second; return os; }

void solve() {
  string s; cin >> s;
  if (s[0] == s[1] || s[1] == s[2] || s[2] == s[3]) {
    cout << "Bad" << '\n';
  } else {
    cout << "Good" << '\n';
  }
}


Measured memory_bytes: 764
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <iostream>
#include <vector>
using namespace std;
constexpr int MOD = 998244353;

int main() {
	int n, s;
	scanf("%d %d", &n, &s);
	vector<int> a(n);
	for (int i = 0; i < n; ++i) scanf("%d", &a[i]);

	vector<vector<int>> dp(3, vector<int>(s + 1));
	dp[0][0] = 1;
	for (int i = 0; i < n; ++i) {
		vector<vector<int>> next(3, vector<int>(s + 1));
		for (int j = 0; j <= s; ++j) {
			(next[0][j] += dp[0][j]) %= MOD;
			(next[1][j] += (dp[0][j] + dp[1][j]) % MOD) %= MOD;
			(next[2][j] += ((dp[0][j] + dp[1][j]) % MOD + dp[2][j]) % MOD) %= MOD;
			if (j + a[i] <= s) {
				(next[1][j + a[i]] += (dp[0][j] + dp[1][j]) % MOD) %= MOD;
				(next[2][j + a[i]] += (dp[0][j] + dp[1][j]) % MOD) %= MOD;
			}
		}
		dp = next;
	}
	printf("%d", dp[2][s]);
	return 0;
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define M 100007
using namespace std;
int n,a[M];
void solve(){
	a[1]--;
	for(int i=2;i<=n;i++){
		if(a[i]<a[i-1]){puts("No");return;}
		if(a[i]==a[i-1])continue;
		a[i]--;
	}
	puts("Yes");
	return;
}
int main(){
	scanf("%d",&n);
	for(int i=1;i<=n;i++)
		scanf("%d",&a[i]);
	solve();
	return 0;	
}

Measured memory_bytes: 640
package main

import "fmt"

func main() {
	var n, m int
	fmt.Scan(&n, &m)
	bs := make([][]int, m)
	p := make([]int, m)

	var k int
	for i := 0; i < m; i++ {
		fmt.Scan(&k)
		bs[i] = make([]int, k)
		for j := 0; j < k; j++ {
			fmt.Scan(&bs[i][j])
			bs[i][j]--
		}
	}
	for i := range p {
		fmt.Scan(&p[i])
	}

	ans := 0
	for i := uint(0); i < (1 << uint(n)); i++ {
		ok := true
		for j := 0; j < m; j++ {
			cnt := 0
			for _, s := range bs[j] {
				if (i >> uint(s) & 0x1) == 1 {
					cnt++
				}
			}
			if cnt%2 != p[j] {
				ok = false
				break
			}
		}
		if ok {
			ans++
		}
	}
	fmt.Println(ans)
}


Measured memory_bytes: 512