akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <algorithm>
#include <map>
#include <numeric>
#include <string>
#include <cstdio>
#include <cstring>
#include <queue>
#include <stack>
#include <set>
#include <cmath>
#include <bitset>

typedef long long ll;
typedef unsigned long long ull;
using namespace std;

#define FALSE printf("false\n");
#define TRUE printf("true\n");
#define all(x) (x).begin(),(x).end()
#define rep(i,n) for(int i = 0;(i) < ((int)(n));++(i))
#define pb push_back
#define mp make_pair
#define fi first
#define se second
#define UNIQUE(v) v.erase( unique(v.begin(), v.end()), v.end() );
#define log(a) cout<<"line:"<<__LINE__<<"["<<(#a)<<": "<<(a)<<"]"<<endl

const int INF = 1e9+7;
const ll INFL = 9*1e18;

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

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

ll inline digit(ll num){int tmp = 0;while(num){tmp++;num/=10;}return tmp;} // 桁数
template<typename T>inline void print(T&& x){cout<<x<<endl;}// 改行付き出力
template<typename T>inline T SUM(vector<T> vec){return accumulate(all(vec),(T)0);} // vectorの中身を全部足す
template<typename T>inline T digitSum(T num){T sum = 0;while(num){sum+=num%10;num/=10;}return sum;} // 各桁の和
template<typename T>inline T gcd(T a,T b){if(b == 0)return a;return gcd(b,a%b);} // 最大公約数
template<typename T>inline T lcm(T a, T b){T g = gcd(a,b);return a/g*b;} // 最小公倍数
template<typename T>inline T power(T a,T b){T tmp=1;rep(i,b){tmp*=a;}return tmp;} // 累乗
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; }
int ctoi(char c){return c-'0';}


// TODO: write
int main() {
  #define int ll
  int n;cin>>n;
  vector<int> a(n);rep(i,n)cin>>a[i];
  map<int,int> l,r;
  rep(i,n){
    l[i+a[i]]++;
    r[i-a[i]]++;
  }
  
  int ans = 0;
  rep(i,n){
    ans += l[i]*r[i];
  }

  print(ans);
  return 0; 
}


Measured memory_bytes: 47376
S = input()

bef = int(S[:2])
aft = int(S[2:])

ansb = ''
ansa = ''

if bef == 0:
    if aft > 31:
        ans = 'NA'
    elif 12 < aft <= 31:
        ans = 'NA'
    elif 0 < aft <= 12:
        ans = 'YYMM'
    elif aft == 0:
        ans = 'NA'
elif bef > 31:
    if aft > 31:
        ans = 'NA'
    elif 12 < aft <= 31:
        ans = 'YYMM'
    elif 0 < aft <= 12:
        ans = 'YYMM'
    elif aft == 0:
        ans = 'NA'
elif 12 < bef <= 31:
    if aft > 31:
        ans = 'MMYY'
    elif 12 < aft <= 31:
        ans = 'AMBIGUOUS'
    elif 0 < aft <= 12:
        ans = 'YYMM'
    elif aft == 0:
        ans = 'NA'
elif bef <= 12:
    if aft > 31:
        ans = 'MMYY'
    elif 12 < aft <= 31:
        ans = 'AMBIGUOUS'
    elif 0 < aft <= 12:
        ans = 'AMBIGUOUS'
    elif aft == 0:
        ans = 'MMYY'
print(ans)

Measured memory_bytes: 3064
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <cmath>
#include <vector>
#include <queue>
#include <algorithm>
#include <functional>
#include <set>
#include <map>
#include <list>
#define debug(x) cout << #x << ": " << (x) << endl
using namespace std;

const double PI  = 3.141592653589793238463;
const int INF = 1000000007;

using ull = unsigned long long;
using ll = long long;

using Int = int;
using Double = double;

using P = pair<Int, Int>;
using V = vector<Int>;
using M = vector<V>;

ll solve(ll x){
    return x / 11 * 2 + (x % 11 > 0) + (x % 11 > 6);
}

int main(int argc, char* argv[]){
    cin.tie(0);
    ios::sync_with_stdio(false);

    ll x;
    cin >> x;

    cout << solve(x) << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
int main()
{
   long long int n,ct=0,r=0;
   string str;
   cin>>n>>str;
   for(long long int i=0;i<str.length();i++)
   { 
     if(str[i]=='R')
       ct++;
   }
   for(long long int i=0;i<ct;i++)
     if(str[i]=='W')
        r++;
  cout<<r<<endl;
}

Measured memory_bytes: 3752
use std::collections::HashSet;



fn main() {
    let n: usize = read();
    let an: Vec<i64> = read_vec();
    let _q: usize = read();
    let queries: Vec<i64>=  read_vec();

    let mut ans: HashSet<i64> = HashSet::new();
    for i in 0..(1<<n) {
        let mut temp_sum = 0;
        for j in 0..n {
            if i & (1 << j) == (1 << j) {
                temp_sum += an[j];
            }
        }
        ans.insert(temp_sum);
    }

    for qu in queries.iter() {
        if ans.contains(qu) {
            println!("yes");
        } else {
            println!("no");
        }
    }
}

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

fn read_vec<T: std::str::FromStr>() -> Vec<T> {
    let mut s = String::new();
    std::io::stdin().read_line(&mut s).ok();
    s.trim().split_whitespace()
        .map(|e| e.parse().ok().unwrap()).collect()
}



Measured memory_bytes: 5044
#include <iostream>

using namespace std;

#define MOD 1000000007
typedef long long ll;

ll GCD(ll a, ll b)
{
    while (b > 0)
    {
        ll c = a % b;
        a = b;
        b = c;
    }
    return a;
}

ll LCM(ll a, ll b)
{
    return a*b/GCD(a, b);
}

int main()
{
    int n, x, res = 1;
    cin>>n;
    for (int i = 0; i < n; ++i)
    {
        cin>>x;
        res = LCM(res, x);
    }
    cout<<res<<"\n";
    return 0;
}

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

using namespace std;

void solve(){

    int n, k; cin >> n >> k;
    int arr[n];
    for(int i = 0; i < n; ++i) cin  >> arr[i];
    sort(arr, arr+n);
    cout << accumulate(arr, arr+k, 0);

}


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

	return 0;
}



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

int main() {
	int N; cin >> N;
	double M; cin >> M;
	vector<double> A(N);
	long long cnt = 0,sum=0;
	for (int i = 0; i < N; i++)
	{
		cin >> A[i];
		sum += A[i];
	}
	for (int i = 0; i < N; i++)
	{
		if (A[i] >= sum/ (4 * M))cnt++;
	}
	if (cnt >= M)cout << "Yes";
	else cout << "No";
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
#define rep(i, n) for(int i = 0; i < (n); i++)
#define rep1(i, n) for(int i = 1; i <= (n); i++)
#define co(x) cout << (x) << "\n"
#define cosp(x) cout << (x) << " "
#define ce(x) cerr << (x) << "\n"
#define cesp(x) cerr << (x) << " "
#define pb push_back
#define mp make_pair
#define Would
#define you
#define please

bool D1[200001], D2[200001];
int K, saidai1, saidai2;
pair<int, int> E[400001];
int H[200001];
void dfs1(int A, int B) {
	if (*(D1 + A) == false) {
		*(D1 + A) = true;
		if (B > saidai1) {
			saidai1 = B;
			K = A;
		}
		for (int k = *(H + A); k; k = (*(E + k)).second) {
			dfs1((*(E + k)).first, B + 1);
		}
	}
}
void dfs2(int A, int B) {
	if (*(D2 + A) == false) {
		*(D2 + A) = true;
		saidai2 = max(saidai2, B);
		for (int k = *(H + A); k; k = (*(E + k)).second) {
			dfs2((*(E + k)).first, B + 1);
		}
	}
}

const int cm = 1 << 17;
char cn[cm], *ci = cn + cm, ct;
inline char getcha() {
	if (ci - cn == cm) { fread_unlocked(cn, 1, cm, stdin); ci = cn; }
	return *ci++;
}
inline int getint() {
	int A = 0;
	if (ci - cn + 16 > cm) while ((ct = getcha()) >= '0') A = A * 10 + ct - '0';
	else while ((ct = *ci++) >= '0') A = A * 10 + ct - '0';
	return A;
}

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


	int N = getint();
	int k = 1;
	rep(i, N - 1) {
		int a = getint(), b = getint();
		*(E + k) = mp(a, *(H + b));
		*(H + b) = k++;
		*(E + k) = mp(b, *(H + a));
		*(H + a) = k++;
	}

	dfs1(1, 1);
	dfs2(K, 1);
	saidai2++;

	if (saidai2 % 3 == 0) co("Second");
	else co("First");

	Would you please return 0;
}

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

int main() {
  string s;
  int N;
  int flag = 1;
  cin >> s;
  N = s.size();
  for (int i = 0; i < N; i++){
    if (s[i] != s[N-1 - i]){
      flag = 0;
    }
  }
  for (int i = 0; i < (N - 1)/2 ; i++){
    if (s[i] != s[(N - 1)/2 - i - 1]){
      flag = 0;
    }
  }
  for (int i = (N + 3)/2 - 1; i < N ; i++){
    if (s[i] != s[N - i - 1]){
      flag = 0;
    }
  }
  if (flag) cout << "Yes" << endl;
  else cout << "No" << endl;
}


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

int main()
{
    int x,y,z;
    cin >> x >> y >> z;

    int temp;
    temp = x;
    x = y;
    y = temp;

    temp = x;
    x = z;
    z = temp;
    
    
    cout << x << " " << y << " " << z<< endl;
    return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <stdlib.h>
#include <vector> //vector
#include <cmath>

#define rep(i, n) for(int i=0; i<(int)(n);i++)
#define all(x) (x).begin(), (x).end()
#define debug(a) if(flagdebug){cout << "debug (" #a "):" << endl << (a) << endl;}

typedef uint64_t ulint;
typedef int64_t lint;

using namespace std;



lint a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z;

bool flagdebug = false;

int main(){
//////////////////////////////////////////////////////
    // flagdebug = true;

    string s;
    string t;

    lint ans = 0;

    cin >> s;
    cin >> t;

    rep(i,3)
    {
        if(s[i] == t[i])ans++;
    }


    cout <<  ans   << endl;


//////////////////////////////////////////////////////
// Ctrl + Opt + N to make
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
#define int long long
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
using namespace std;
const int MOD = 1000000007;
const int INF = numeric_limits<int>::max() / 2;
typedef pair<int,int> P;
using Graph = vector<vector<int>>;

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

  string S;
  cin >> S;
  int N = S.size();
  map<char, int> mp;
  rep(i,N){
    mp[S[i]]++;
  }
  bool ok = true;
  for(auto T : mp){
    if(T.second % 2 == 1) ok = false;
  }
  cout << (ok ? "Yes" : "No") << endl;
}

Measured memory_bytes: 256
h,w=map(int,input().split())
def f(h,w):
    if h%3==0:
        return 0
    rt=h*w
    for i in range(1,h):
        rt=min(rt,max(i*w,(h-i)*(w//2),(h-i)*(w-(w//2))) - min(i*w,(h-i)*(w//2),(h-i)*(w-(w//2))))
        rt=min(rt,max(i*w,((h-i)//2)*w,(h-i-((h-i)//2))*w) - min(i*w,((h-i)//2)*w,(h-i-((h-i)//2))*w))
    return rt

print(min(f(h,w),f(w,h)))

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

using ll = long long;
using ld = long double;
using vi = vector<int>;
using vll = vector<ll>;
using P = pair<int, int>;

const int INF = 1e9;
const ll INFLL = 1e18;
const int MOD = 1e9 + 7;
const int NIL = -1;
const ld PI = acosl(-1);

#define rep(i,n) for(int i=0; i<(n); ++i)
#define all(n) n.begin(),n.end()

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

int main()
{
	ios::sync_with_stdio(false); cin.tie(nullptr);
	//cout << fixed << setprecision(6);
	int a, b, k;
	cin >> a >> b >> k;
	for(int i = a; i < min(a+k, b+1); i++)
		cout << i << endl;
	for(int i = max(b-k+1, a+k); i <= b; i++)
		cout << i << endl;
	return 0;
}

Measured memory_bytes: 256