akhauriyash/Code-Regression huggingface dataset:
// i hope i get better                                                           
#include <bits/stdc++.h>
#define mp make_pair
#define pb push_back
#define f first
#define s second
#define all(x) x.begin(), x.end()
using namespace std;
typedef long long ll;
typedef pair<int,int> pii;
typedef pair<ll,ll> pll;
const int sz=4e3+9;
int n;
string s;
int cs[30][sz];
int r='R'-'A';
int g='G'-'A';
int b='B'-'A';
ll ans;

int main(){
	cin>>n>>s;
	for(int i=n-1;i>=0;i--){
		int c=s[i]-'A';
		cs[r][i]=cs[r][i+1]+(c==r);
		cs[b][i]=cs[b][i+1]+(c==b);
		cs[g][i]=cs[g][i+1]+(c==g);		
	}
	for(int i=0;i<n;++i){
		int ci=s[i]-'A';
		for(int j=i+1;j<n;++j){
			int cj=s[j]-'A';
			int k=j+(j-i);
			if(cj==ci) continue;
			if(ci!=r&&cj!=r) ans+=cs[r][j]-(s[k]=='R');
			else if(ci!=g&&cj!=g) ans+=cs[g][j]-(s[k]=='G');
			else ans+=cs[b][j]-(s[k]=='B');
		}
	}
	cout<<ans;
	return 0;
}

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

using namespace std;

//#define MD 10

int main(){
    int h,w;
    cin>>h>>w;
    char v[110][110]={'\0'};
    for(int i=1;i<=h;i++){
        for(int j=1;j<=w;j++){
            cin>>v[i][j];
        }
    }
    
    for(int i=1;i<=2*h;i++){
        for(int j=1;j<=w;j++){
            cout<<v[(i+1)/2][j];
        }
        cout<<endl;
    }
        
    return 0;
}

Measured memory_bytes: 256
def main():
    m = int(input())
    s = set()
    for _ in range(m):
        a,b = map(int,input().split())
        if a == 0:
            s.add(b)
            print (len(s))
        else:
            if b in s:print (1)
            else     :print (0)


if __name__ == '__main__':
    main()




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

int main() {
    int N, i;
    cin >> N;
    vector<int> num(N);
    vector<int> order(N);
    for (i = 0; i < N; i++) {
        cin >> num.at(i);
        order.at(num.at(i) - 1) = i + 1;
    }
    for (i = 0; i < N; i++) {
        cout << order.at(i) << " ";
    }
    cout << endl;
}

Measured memory_bytes: 1664
N = int(input())
s = set()
word = input()
s.add(word)
tmp = word[-1]
is_ng = False
for i in range(N-1):
    word = input()
    if word[0] != tmp:
        is_ng = True
        break
    if word in s:
        is_ng = True
        break
    tmp = word[-1]
    s.add(word)
print('YNeos'[is_ng::2])

Measured memory_bytes: 3064
#include <stdio.h>
int main(){
  int a,b;
  scanf("%d%d",&a,&b);
  if( (a+b)%2 ){ printf( "%d", ((a+b)/2)+1 ); }
  else		   { printf( "%d",  (a+b)/2    ); }
  return 0;
}


Measured memory_bytes: 1736
#include <stdio.h>
#include <string.h>
#include <ctype.h>

int main(void)
{
	int a;
	char *p;
	char w[11],t[1001];
	a=0;
	scanf("%s",w);
	for(p=w;*p;p++)
	*p=toupper(*p);
	while(1)
	{
		scanf("%s",t);
		if(strcmp(t,"END_OF_TEXT")==0)
		{
			break;
		}
		for(p=t;*p;p++)
		*p=toupper(*p);
		
		if(strcmp(w,t)==0)
		{
			a=a+1;
		}
	}
	printf("%d\n",a);
	return 0;
}

Measured memory_bytes: 548
#include <stdio.h>
#define Max 100000

int main()
{
  int i,j,k,l=0,m,n,a,b,c;
  int A[Max];

  scanf("%d",&n);
  
  for(i=0;i<n;i++) scanf("%d",&A[i]);

  j=A[n-1];

  k=l-1;
  
  for(m=l;m<n-1;m++)
    {
      if(A[m]<=j)
	{
	  k++;
	  b=A[k];
	  A[k]=A[m];
	  A[m]=b;
	}
    }

  b=A[k+1];
  A[k+1]=A[n-1];
  A[n-1]=b;

  for(i=0;i<n;i++)
    {
      if(i>0)printf(" ");
      if(i==k+1) printf("[");
      printf("%d",A[i]);
      if(i==k+1) printf("]");
    }
  printf("\n");

  return 0;
}

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

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

#define pb push_back
#define eb emplace_back
#define mp make_pair
#define fi first
#define se second
#define rep(i,n) rep2(i,0,n)
#define rep2(i,m,n) for(int i=m;i<(n);i++)
#define ALL(c) (c).begin(),(c).end()

const int maxn = 3010;

int N;
vi g[maxn];
int A[maxn];
bool state[maxn];

void dfs(int v, int p) {
	bool w = 0;
	for (int to : g[v]) if (to != p) {
		dfs(to, v);
		if (!state[to] && A[v] > A[to]) {
			w = 1;
		}
	}
	state[v] = w;
}

int main() {
	cin >> N;
	rep(i, N) cin >> A[i];
	rep(i, N-1) {
		int a, b;
		cin >> a >> b;
		--a; --b;
		g[a].pb(b); g[b].pb(a);
	}

	bool hd = 1;

	rep(i, N) {
		dfs(i, -1);
		if (state[i]) {
			if (!hd) {
				printf(" ");
			}
			hd = 0;
			printf("%d", i + 1);
		}
	}
	puts("");

	return 0;
}

Measured memory_bytes: 640
#include<iostream>
#include<cstdio>
#include<cstring>
using namespace std;
const int N=45;
int n;
int a[N][N];
long long dp[N][N][N];
long long dfs(int l,int mid,int r)
{
	if(dp[l][mid][r]!=-1) return dp[l][mid][r];
	if(l==r) return 1;
	if(l==mid||mid==r) return 0;
	long long res=0;
	for(int j=l;j<mid;j++)
		for(int k=mid+1;k<=r;k++)
			if(a[j][k])
				for(int p=j;p<mid;p++)
					for(int q=mid+1;q<=k;q++)
						res+=dfs(l,j,p)*dfs(p+1,mid,q-1)*dfs(q,k,r);
	return dp[l][mid][r]=res;
}
int main()
{
	scanf("%d",&n);
	for(int i=1;i<=n*2;i++)
		for(int j=1;j<=n*2;j++)
			scanf("%1d",&a[i][j]);
	memset(dp,-1,sizeof(dp));
	long long ans=0;
	for(int i=2;i<=n*2;i++)
		if(a[1][i]) ans+=dfs(2,i,2*n);
	printf("%lld",ans);
	return 0;
}

Measured memory_bytes: 4536
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <iostream>
#include <algorithm>       // for next_permutation
#include <vector>
#include <cstdlib>
#define INF 998244353

using namespace std;
typedef long long int ll;
typedef pair<ll, ll> pi;

const ll MOD = 1e9+7;

static long gcd(long a, long b) {
    if (b == 0) {
        return a;
    }
    return gcd(b, a % b);
}
/*
long long int facctorialMethod(int k){//階乗
    int sum = 1;
    for (int i = 1; i <= k; ++i)
    {
        sum *= i;
    }
    return sum;
}*/

long long int tousasum(long long int n){//等差数列
    return n*(n+1)/2;
}

unsigned GetDigit(unsigned num){//桁数
    unsigned digit=0;
    while(num!=0){
        num /= 10;
        digit++;
    }
    return digit;
}

bool IsPrime(int num)//素数判定
{
    if (num < 2) return false;
    else if (num == 2) return true;
    else if (num % 2 == 0) return false; // 偶数はあらかじめ除く

    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            // 素数ではない
            return false;
        }
    }

    // 素数である
    return true;
}

map< ll, ll > prime_factor(ll n) {//素因数分解
    map< ll, ll > ret;
    for(ll i = 2; i * i <= n; i++) {
        while(n % i == 0) {
            ret[i]++;
            n /= i;
        }
    }
    if(n != 1) ret[n] = 1;
    return ret;
}

ll calcNumOfCombination(ll n, ll r){
    ll num = 1;
    for(ll i = 1; i <= r; i++){
        num = num * (n - i + 1) / i;
    }
    return num;
}

int bubblesort(vector<int> array,int size){//バブルソート　転倒数
    int kaisu = 0;
    for(int i = 0; i < size; i++){
        for(int j = i + 1; j < size; j++){
            if(array[i] > array[j]){
                int number = array[i];
                array[i] = array[j];
                array[j] = number;
                kaisu++;
            }
        }
    }
    return kaisu;
}

ll facctorialMethod(ll k){
    ll sum = 1;
    for (ll i = 1; i <= k; ++i)
    {
        sum = (sum * i)%MOD;
    }
    return sum;
}

// nPnの順列に対して処理を実行する
void foreach_permutation(int n, std::function<void(int *)> f) {
    int indexes[n];
    for (int i = 0; i < n; i++) indexes[i] = i;
    do {
        f(indexes);
    } while (std::next_permutation(indexes, indexes + n));
}



int main() {
 string S,T;
 cin >> S >> T;
 cout << T+S << endl;

}













Measured memory_bytes: 256
s=list(input())
a=s[0]
b=s[1]
c=s[2]
e=s[3]

for i in range(8):
    d=0
    x=[a,b,c,e]
    for j in range(3):
        if (i >> j)&1:
            x.insert(-j-1-d,'+')
            d+=1
        else:
            x.insert(-1-j-d,'-')
            d+=1
    q="".join(x)
    f=int(a)
    g=int(b)
    h=int(c)
    k=int(e)
    if q[1]=="-":
        g=-g
    if q[3]=="-":
        h=-h
    if q[5]=="-":
        k=-k
    if f+g+h+k==7:
        ans=q+"=7"
        print(ans)
        exit()
    
            


Measured memory_bytes: 3188
#include <iostream>
#include <algorithm>
#include <tuple>
#include <vector>
#include <string>
#include <queue>
#include <cmath>
#include <set>
#include <map>
#include <cassert>

using namespace std;
using ll = long long;

int main()
{
    ll n, a, b;
    cin >> n >> a >> b;
    ll mx = a + b * (n-1);
    ll mi = a * (n-1) + b;
    ll ans = mx -mi+1;
    if(ans < 0){
        cout << 0 << endl;
    }else cout << ans << endl;
    return 0;
}

Measured memory_bytes: 3588
#include <bits/stdc++.h>
using namespace std;
typedef long long lint;
#define rep(i,n) for(lint (i)=0;(i)<(n);(i)++)
#define repp(i,m,n) for(lint (i)=(m);(i)<(n);(i)++)
#define repm(i,n) for(lint (i)=(n-1);(i)>=0;(i)--)
#define INF (1ll<<60)
#define all(x) (x).begin(),(x).end()
const lint MOD =1000000007;
const lint MAX = 1000000;
using Graph =vector<vector<lint>>;
typedef pair<lint,lint> P;
 
 
lint fac[MAX], finv[MAX], inv[MAX];
 
void COMinit() 
{
    fac[0] = fac[1] = 1;
    finv[0] = finv[1] = 1;
    inv[1] = 1;
    for (lint i = 2; i < MAX; i++)
    {
        fac[i] = fac[i - 1] * i % MOD;
        inv[i] = MOD - inv[MOD % i] * (MOD / i) % MOD;
        finv[i] = finv[i - 1] * inv[i] % MOD;
    }
}
 
long long COM(lint n, lint k)
{
    if (n < k)
        return 0;
    if (n < 0 || k < 0)
        return 0;
    return fac[n] * (finv[k] * finv[n - k] % MOD) % MOD;
}
 
lint primary(lint num)
{
    if (num < 2) return 0;
    else if (num == 2) return 1;
    else if (num % 2 == 0) return 0;
 
    double sqrtNum = sqrt(num);
    for (int i = 3; i <= sqrtNum; i += 2)
    {
        if (num % i == 0)
        {
            return 0;
        }
    }
 
    return 1;
}
   long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}
    lint lcm(lint a,lint b){
        return a/__gcd(a,b)*b;
    }
     lint gcd(lint a,lint b){
        return __gcd(a,b);
    } 

  int main(){      
     set<string> st;
     lint n;
     cin>>n;
     rep(i,n){
         string s;
         cin>>s;
         st.emplace(s);
     }
        cout<<st.size();
          }
  
     


Measured memory_bytes: 19352