akhauriyash/Code-Regression huggingface dataset:
#include <stdio.h>
#include <string>
#include <iostream>
#include <vector>
#include <queue>
#include <list>
#include <algorithm>
#include <map>
#include <iterator>
#include <limits>
#include <numeric>
#include <type_traits>
#include <cmath>
#include <cstdlib>
#define rep(i,n) for(int (i)=0;(i)<(n);(i)++)
using namespace std;

#define ALL(v) (v).begin(), (v).end()
#define endl "\n"
typedef long long int ll;

template<typename T>
ostream& operator << (ostream& os, vector<T>& vec) {
	for (int i = 0; i<vec.size(); i++) {
		os << vec[i] << (i + 1 == vec.size() ? "" : " ");
	}
	return os;
}

int SumDigitValues(int x)
{
	int sum = 0;
	while (x)
	{
		sum += x % 10;
		x = x / 10;
	}

	return sum;
}

int Factorial(int n)
{
	if (n < 0) return 0;
	if (n == 0) return 1;
	return n * Factorial(n - 1);
}

int factorial(int n)
{
	if (n > 1)
	{
		return n * factorial(n - 1);
	}
	else
	{
		return 1;
	}
}

int gcd(int x, int y)
{
	if (y == 0)
		return x;
	else 
		return gcd(y, x % y);
}

vector<int> Divisors(int x)
{
	vector<int> divisors;
	divisors.push_back(1);
	for (int a = 2; a <= x; a++)
	{
		if (x % a == 0) divisors.push_back(a);
	}
	return divisors;
}

vector<int> CommonDivisors(int a, int b)
{
	vector<int> divisorsA = Divisors(a);
	vector<int> divisorsB = Divisors(b);
	vector<int> commonDivisors;
	set_intersection(divisorsA.begin(), divisorsA.end(), divisorsB.begin(), divisorsB.end(), std::back_inserter(commonDivisors));
	return commonDivisors;
}

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

	int n; cin >> n;
	double denomirator = (double)((n + 1) / 2);
	double numerator = (double)(n);
	printf("%.10f\n", denomirator / numerator);
}

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

#define int long long

#define ii pair<int,int>
#define fi first
#define sc second
#define lwb lower_bound
#define upb upper_bound
#define all(x) (x).begin(),(x).end()

signed main() {
#ifdef _DEBUG
  freopen("in", "r", stdin);
#endif
  ios::sync_with_stdio(0); cin.tie(0);
  int n, m;
  cin >> n >> m;
  for (int i = 0; i < m; i++) {
    int t; cin >> t;
    n -= t;
  }
  cout << max(n, -1LL) << '\n';
}


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


/// File input & output /////
#define fRead(x)        freopen("x.txt","r",stdin)
#define fWrite(x)       freopen ("x.txt","w",stdout)


#define ld              long double
#define ll              long long
#define ull             unsigned long long
#define ff              first
#define ss              second
#define pb              push_back
#define INF             2e16
#define PI              acos(-1.0)
#define mp              make_pair
#define pii             pair<int,int>
#define pll             pair<LL,LL>


#define min3(a,b,c)     min(a,min(b,c))
#define max3(a,b,c)     max(a,max(b,c))
#define min4(a,b,c,d)   min(a,min(b,min(c,d)))
#define max4(a,b,c,d)   max(a,max(b,max(c,d)))
#define SQR(a)          ((a)*(a))
#define FOR(i,a,b)      for(int i=a;i<=b;i++)
#define ROF(i,a,b)      for(int i=a;i>=b;i--)
#define REP(i,b)        for(int i=0;i<b;i++)
#define MEM(a,x)        memset(a,x,sizeof(a))
#define ABS(x)          ((x)<0?-(x):(x))

#define SORT(v)         sort(v.begin(),v.end())
#define REV(v)          reverse(v.begin(),v.end())


#define FASTIO        ios_base::sync_with_stdio(0);cin.tie(nullptr);




///..................Sort by second element in a pair in decending order............. ///
bool SortbySecDesc(const pair<long long,long long > &a, const pair<long long,long long > &b)
{
    return a.second>b.second;
}

///.........................first element of pair in descending order..........................//////
bool sortinrev(const pair<int,int> &a,
               const pair<int,int> &b)
{
       return (a.first > b.first);
}



///.............................................................TEMPLATE................................................./////


int main()
{
    FASTIO;


    ll n;


    cin >> n;


    double ans = (log(n)/log(2));
    //cout << ans << endl;




    ll ans1 = ans + 1;


    ll sum = 0;

    for(int i=0; i<ans1; i++)
    {
        sum += pow(2,i);
    }

    cout << sum << endl;





    return 0;
}



Measured memory_bytes: 256
#include "bits/stdc++.h"
#define rep(i,n) for(int i = 0; i < (n); ++i)
using namespace std;
typedef long long int ll;
typedef pair<int, int> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

const ll INF = 1e18;

int main(){
    cin.tie(0);
    ios::sync_with_stdio(false);
    int n, m;
    cin >> n >> m;
    vector<vector<ll>> a(n, vector<ll>(3));
    rep(i,n) cin >> a[i][0] >> a[i][1] >> a[i][2];
    ll ans = 0;
    rep(S,(1<<3)){
        vector<ll> v;
        rep(i,n){
            ll b = 0;
            rep(j,3){
                if(S>>j & 1) b += a[i][j];
                else b -= a[i][j];
            }
            v.push_back(b);
        }
        sort(v.rbegin(), v.rend());
        ll cmp = 0;
        rep(i,m) cmp += v[i];
        chmax(ans, cmp);
    }
    cout << ans << endl;
	return 0;
}

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

int main()
{
	int n = 3;
	string s;
	char a, b, c;
	
		cin >> s;
		a = s.at(0);
		
		cin >> s;
		b = s.at(0);
		
		cin >> s;
		c = s.at(0);

	cout << a << b << c << endl;
}

Measured memory_bytes: 256
n=int(input())
a_dict={}
for i in range(n):
    a=input()
    if a not in a_dict:
        a_dict[a]=0
    else:
        a_dict[a]+=1
# moji=[i for i,j in a_dict.items() if j==max(a_dict.values()) ]
moji=[]
j=max(a_dict.values())
for i,k in a_dict.items():
    if k==j:
        moji.append(i)
moji=sorted(moji)
for i in moji:
    print(i)

Measured memory_bytes: 32988
IDENTIFICATION DIVISION.
PROGRAM-ID. 099C.
*>
DATA DIVISION.
WORKING-STORAGE SECTION.
01 INP        PIC  X(14).
01 N          PIC  9(6) COMP.
01 K          PIC  9(6) COMP.
01 OUT        PIC  Z(5)9.
*>
PROCEDURE DIVISION.
  ACCEPT INP.
  UNSTRING INP DELIMITED BY ' '
      INTO N K.
*>
  COMPUTE OUT = (N - 2) / (K - 1) + 1.
  DISPLAY FUNCTION TRIM(OUT).
*>
  STOP RUN.


Measured memory_bytes: 384
input = raw_input
k, n = map(int, input().split(" "))
a_list = map(int, input().split(" "))

#dists = []
for i in range(n-1):
    d = a_list[i+1] - a_list[i]
    if i == 0:
        maxd = d
    else:
        maxd = max(d, maxd)
    #dists.append(d)

#dists.append(k- a_list[n-1])
maxd = max(k-a_list[n-1]+a_list[0], maxd)
out = k-maxd
print(out)

Measured memory_bytes: 43480
from heapq import heapify, heappop, heappush

N = int(input())
v = list(map(int, input().split()))

heapify(v)

for _ in range(N - 1):
    x = heappop(v)
    y = heappop(v)
    heappush(v, (x + y) / 2)
    
print(sum(v))

Measured memory_bytes: 3060
/**
 *    author:  otera    
**/
#include<iostream>
#include<string> 
#include<cstdio>
#include<cstring>
#include<vector>
#include<cmath>
#include<algorithm> 
#include<functional>
#include<iomanip>
#include<queue>
#include<deque>
#include<ciso646>
#include<random>
#include<map>
#include<set>
#include<complex>
#include<bitset>
#include<stack>
#include<unordered_map>
#include<utility>
#include<cassert>
using namespace std;

//#define int long long
typedef long long ll;
typedef unsigned long long ul;
typedef unsigned int ui;
typedef long double ld;
const int inf=1e9+7;
const ll INF=1LL<<60 ;
const ll mod=1e9+7 ;
#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<int, int> P;
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
#define debug(x)  cerr << #x << " = " << (x) << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }

void solve() {
	int k; cin >> k;
    string s; cin >> s;
    int n = (int)s.size();
    if(n <= k) {
        cout << s << endl;
    } else {
        cout << s.substr(0, k) << "..." << endl;
    }
}

signed main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	//cout << fixed << setprecision(10);
	//int t; cin >> t; rep(i, t)solve();
	solve();
    return 0;
}

Measured memory_bytes: 3640
//C
#include<cstdio> 
#include<iostream>
#include<cstring>
using namespace std;
char s[100010];
int main()
{
	int k=100010,len;
	scanf("%s",s);
	len=strlen(s);
	for(int i=0;i<len;i++)
	{
		if(s[i]!=s[i+1])
		{
			k=min(k,max(i+1,len-1-i));
		}
	}
	printf("%d",k);
}

Measured memory_bytes: 384
#include<bits/stdc++.h>
#define ll long long int
#define fip ios_base::sync_with_stdio(false); cin.tie(NULL) 
#define reptUsual(b) for(i=0; i<b; ++i)
#define reptArIn(i,a,b,ar) for( i=a; i<b; ++i) cin>>ar[i];
#define rept(i,a,b) for(i=a; i<b; ++i)
#define maX(a,b)    ( (a) > (b) ? (a) : (b))
#define miN(a,b)    ( (a) < (b) ? (a) : (b))
#define pb(a) push_back(a)
using namespace std;

int main()
{
    fip;
    int n,i,sum=0,a,diff;
    cin>>n;
    int ar[n];
    reptUsual(n)
    {
        cin>>ar[i];
        sum+=ar[i];
        ar[i]=sum;
    }
    int min=100000;
    reptUsual(n)
    {
        a=(sum-ar[i]);
        diff = (int)(abs(a-ar[i]));
        if(diff < min)
            min=diff;
    }
    cout<<min;
    
    return 0;

}

Measured memory_bytes: 256
import java.util.*;

public class Main{
	public static void main(String args[]){
		Scanner sc = new Scanner(System.in);
		int N = sc.nextInt();
		int[] order = new int[N];
		for(int i = 0; i < N; i++){
			order[sc.nextInt() - 1] = i + 1;
		}
		for(int i = 0; i < N; i++){
			System.out.print(order[i] + ((i != N - 1)?" ":""));
		}
		System.out.println();
	}
}

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

using namespace std;

int main()	{
  int n, m;
  cin >> n;
  int t[n];
  for (int i = 0; i < n; i++)	{
    cin >> t[i];
  }
  cin >> m;
  vector<pair<int, int>> power;
  int tmp1, tmp2;
  for (int i = 0; i < m; i++)	{
    cin >> tmp1 >> tmp2;
    power.push_back(make_pair(tmp1 - 1, tmp2));
  }
  long long times[m];
  for (int i = 0; i < m; i++)	{
    times[i] = 0;
    for (int j = 0; j < n; j++)	{
      tmp1 = t[j];
      if (j == power[i].first)	{
        t[j] = power[i].second;
      }
      times[i] += t[j];
      t[j] = tmp1;
    }
  }
  for (int i = 0; i < m; i++)	
    cout << times[i] << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <bits/stdc++.h>
using namespace std;
 
int main() {

int n,k;
cin >> n>>k;
vector<int> p(n);
  for(int i=0;i<n;i++){int a;cin>>a;p.at(i)=a;}
  sort(p.begin(),p.end());
  int t=0;
  for(int i=0;i<k;i++){t=t+p.at(i);}
cout<<t<<endl;
}

Measured memory_bytes: 3632
#include <iostream>

using namespace std;

const int MAXN = 100 + 10;
const int MAXW = 1e5 + 10;
long long v[MAXN];
int w[MAXW];
long long dp[MAXW];

int main()
{
    int N, W;
    cin >> N >> W;

    for (int i = 1; i <= N; i++)
        cin >> w[i] >> v[i];

    for (int i = 1; i <= N; i++) {
        for (int j = W; j >= 1; j--) {
            if (j >= w[i])
                dp[j] = max(dp[j], dp[j-w[i]] + v[i]);
        }
    }

    cout << dp[W];
    return 0;
}

Measured memory_bytes: 1024