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

using ll = long long;

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

	ll x;
	cin >> x;

	for (ll i = -1000; i < 1000; i++) {
		for (ll j = -1000; j < 1000; j++) {
			if (i*i*i*i*i - j*j*j*j*j == x) {
				cout << i << " " << j << "\n";
				return 0;
			}
		}
	}
	return 0;
}

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

int main(void){
    int H,W;
    cin>>H>>W;
    char a[H+2][W+2];

    for(int i=0;i<H+2;i++){
        for(int j=0;j<W+2;j++){
            if(j==0||j==W+1||i==0||i==H+1)
                a[i][j]='#';
            else
                cin>>a[i][j];
        }
    }
    for(int i=0;i<H+2;i++){
        for(int j=0;j<W+2;j++)
            cout<<a[i][j];
        cout<<endl;
    }
    return 0;
}


Measured memory_bytes: 256
#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i=0; i<n; i++)
#define REP(i,m,n) for(ll i=(ll)(m);i<(ll)(n);i++)
#define fi first
#define se second
long long mo = 1000000007;
typedef long long ll;
typedef long double ld;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
typedef pair<ll,Pll> PlP;
template<class T, class S> void cmin(T &a, const S &b) { if (a > b)a = b; }
template<class T, class S> void cmax(T &a, const S &b) { if (a < b)a = b; }
template<class A>void PR(A a,ll n){rep(i,n){if(i)cout<<' ';cout<<a[i];}cout << "\n";}
ld PI=3.14159265358979323846;

int main(){
    ll n,m,s,t;
    cin >> n >> m >> s >> t;
    s--;t--;
    vector<ll> v(m), u(m), a(m), b(m), ans(n+1);
    vector<vector<Pll>> G(n), H(n);
    rep(i,m){
        cin >> v[i] >> u[i] >> a[i] >> b[i];
        v[i]--;u[i]--;
        G[v[i]].push_back({a[i], u[i]});
        G[u[i]].push_back({a[i], v[i]});
        H[v[i]].push_back({b[i], u[i]});
        H[u[i]].push_back({b[i], v[i]});
    }
    vector<ll> d1(n,1e18), d2(n,1e18);
    priority_queue<Pll, vector<Pll>, greater<Pll>> que;
    que.push(Pll(0,s));
    while(!que.empty()){
        ll cost = que.top().fi;
        ll v = que.top().se;
        que.pop();
        if(d1[v] <= cost) continue;
        //if(d1[v] != 1e18) continue;
        d1[v] = cost;
        for(auto& p:G[v]){
            ll dd = p.fi;
            ll u = p.se;
            que.push(Pll(cost+dd,u));
        }
    }
    que.push(Pll(0,t));
    while(!que.empty()){
        ll cost = que.top().fi;
        ll v = que.top().se;
        que.pop();
        if(d2[v] <= cost) continue;
        //if(d1[v] != 1e18) continue;
        d2[v] = cost;
        for(auto& p:H[v]){
            ll dd = p.fi;
            ll u = p.se;
            que.push(Pll(cost+dd,u));
        }
    }
    ans[n] = 0;
    for(ll i=n-1;i>=0;i--){
        ans[i] = 1e15 - d1[i] - d2[i];
        cmax(ans[i], ans[i+1]);
    }
    rep(i,n){
        cout << ans[i] << endl;
    }
}

Measured memory_bytes: 24488
#include "bits/stdc++.h"
#include "math.h"
 
using namespace std;
typedef long long ll;
typedef vector<ll> vll;
typedef vector<vll> vvll;
typedef vector<bool> vb;
typedef vector<vb> vvb;
typedef vector<int> vin;
typedef pair<ll,ll> P;
typedef vector<P> vp;
#define rep(i,a,b) for(ll i=(a);i<(b);++i)
#define drep(i,a,b) for(ll i=(a);i>=(b);--i)
#define SIZE(a) int((a).size())
#define out(a) cout<<(a)<<endl;
const int INF=INT_MAX;
const int MAX = 510000;
const ll MOD = 1000000007;

int main(){
  ll n,k;cin>>n>>k;
  vvll g(n);vll cnt(n,0);vb visited(n,false);
  rep(i,0,n-1){
    ll a,b;cin>>a>>b;
    a--;b--;
    g[a].push_back(b);
    g[b].push_back(a);
  }
  rep(i,0,k){
    ll a,b;cin>>a>>b;
    cnt[a-1]+=b;
  }
  queue<ll> q;
  q.push(0);
  visited[0]=true;
  while(!q.empty()){
    ll tmp=q.front();
    q.pop();
    visited[tmp]=true;
    for(auto u:g[tmp]){
      if(visited[u])continue;
      cnt[u]+=cnt[tmp];
      q.push(u);
    }
  }
  rep(i,0,n){
    cout<<cnt[i]<<" ";
  }
  cout<<endl;
}



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

using namespace std;
int _w;

int n;
char s[10];

int main() {
	_w = scanf( "%s", s );
	n = strlen(s);
	for( int i = 0; i < n-1; ++i )
		if( s[i] == 'A' && s[i+1] == 'C' )
			return puts("Yes"), 0;
	return puts("No"), 0;
}


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

int main()
{
    int N;
    cin >> N;
    int a[100010][3];
    int prev = 0;
    long long dp[100010][3];

    memset(dp, 0, sizeof(dp));

    for (int i = 0; i < N; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            /* code */
            cin >> a[i][j];
        }
    }

    dp[0][0] = max(a[0][1], a[0][2]);
    dp[0][1] = max(a[0][0], a[0][2]);
    dp[0][2] = max(a[0][0], a[0][1]);

    for (int i = 1; i < N; i++)
    {
        for (int j = 0; j < 3; j++)
        {
            for (int k = 0; k < 3; k++)
            {
                /* code */
                if (j == k)
                    continue;
                dp[i][j] = max(dp[i][j], dp[i - 1][k] + a[i][k]);
            }
        }
    }

    cout << max(dp[N - 1][0], max(dp[N - 1][1], dp[N - 1][2])) << endl;

    return 0;
}

Measured memory_bytes: 3712
///------------------------------------------
/// あらゆる成功へのスタート地点は『願望』だ
///
/// - ナポレオン・ヒル -
///------------------------------------------
# include <bits/stdc++.h>
# define rep(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
# define reps(i, n) for(int i=1, i##_len=(n); i<=i##_len; ++i)
# define rrep(i, n) for(int i=((int)(n)-1); i>=0; --i)
# define rreps(i, n) for(int i=((int)(n)); i>0; --i)
# define ALL(x) (x).begin(), (x).end()
# define RALL(x) (x).rbegin(), (x).rend()
# define SZ(x) ((int)(x).size())
# define pb push_back
# define optimize_cin() cin.tie(0); ios::sync_with_stdio(false)
# define debug(x) std::cerr<<#x<<": "<<(x)<<endl;
using namespace std;
using lint = long long;
template<class T> using grid = vector<vector<T>>;
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; }
static const lint MOD = (lint)1e9+7;

int main()
{
    int a;
    cin >> a;
    string s;
    cin >> s;

    if (a >= 3200)
    {
        cout << s << "\n";
    }
    else
    {
        cout << "red" << "\n";
    }

    return 0;
}


Measured memory_bytes: 256
#!/usr/bin/ruby
n=gets.to_i
a=gets.split.map(&:to_i)
x=a[a.length-1]
i=-1
0.step(a.length-2){|j|
	if a[j]<=x
		i=i+1
		a[i],a[j]=a[j],a[i]
	end
}
a[i+1],a[a.length-1]=a[a.length-1],a[i+1]
puts a.each_with_index.map{|e,z|(z==i+1?'[%d]':'%d')%e}*' '

Measured memory_bytes: 22296
<?php
//error_reporting(0);
$s = trim(fgets(STDIN));
$K = trim(fgets(STDIN));
//list($A,$B,$C,$D) = explode(" ",trim(fgets(STDIN)));
//$A  = explode(" ",trim(fgets(STDIN)));

$sary = array_unique(str_split($s,1));
//文字ごとに昇順に並べる
sort($sary);
$res = array();
if ($K == 1) {
  //一番目ならソートした最初の文字
  printf("%s\n",$sary[0]);
  exit;
}
foreach($sary as $v) {
  $pos = 0;
  $res[$v]=1;
  while(1) {
    $len = min(strlen($s)-$pos,5);
    $pos = strpos($s,$v,$pos);
    if ($pos === false) break;
    //2文字以上の$vから始まる文字列を作成
    for($i=2;$i<=$len;$i++) {
      $key = substr($s,$pos,$i);
      //なければキーにセット
      if (isset($res[$key])==false) {
        $res[$key]=1;
      }
    }
    $pos++;
  }
  //K個以上たまってればこの中にあるはず
  if (count($res)>$K) break;
}
ksort($res);
printf("%s\n",key(array_slice($res,$K-1,1,true)));


Measured memory_bytes: 5108
#pragma GCC optimize("Ofast")
#pragma GCC target ("avx")
#include <bits/stdc++.h>

constexpr int INF = 2147483647;
constexpr long long int INF_LL = 9223372036854775807;
constexpr int MOD = 1000000007;
using namespace std;
typedef long long int ll;
typedef unsigned long long int ull;

int main() {
	int N;
	cin >> N;
	vector<int> A(N), B;
	for (int i = 0; i < N; i++)cin >> A[i];
	B = A;
	sort(B.begin(), B.end(), greater<>());
	for (int i = 0; i < N; i++) {
		if (A[i] == B[0]) {
			cout << B[1] << endl;
		}
		else {
			cout << B[0] << endl;
		}
	}
}

Measured memory_bytes: 3200
import java.util.*;
import java.math.*;
public class Main{
	public static void main(String[] args){
		Scanner sc=new Scanner(System.in);
		int h=sc.nextInt();
		int w=sc.nextInt();
		int n=sc.nextInt();
		int k=0;
		if(w>h){
			if(n%w>0){
				k=1;
			}
			System.out.println(n/w+k);
		}else{
			if(n%h>0){
				k=1;
			}
			System.out.println(n/h+k);
		}
	}
}


Measured memory_bytes: 23252
#include <iostream>
using namespace std;
int main() {
    int n;
    cin >> n;
    int b[n+1];
    for (int i=1; i<n; i++) {
        cin >> b[i];
    }
    b[0] = b[1];
    b[n] = b[n-1];
    int result = 0;
    for (int i=0; i<n; i++) {
        result += min(b[i], b[i+1]);
    }
    cout << result << endl;
}

Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
#define ALL(x) (x).begin(),(x).end()
#define uniq(x) (x).erase(unique(ALL(x)),(x).end())
#define SORT(x) sort(ALL(x))
#define REV(x) reverse(ALL(x))
#define foreach(it,x) for(__typeof((x).begin()) it=(x).begin();it!=(x).end();it++)
#define debug(x) cerr<<#x<<"="<<(x)<<endl
#define gett() cerr<<"Time:"<<clock()<<"ms."<<endl
#define ri(x) scanf("%d",&x);
#define rl(x) scanf("%I64d",&x);
#define pi(x) printf("%d",x);
#define pl(x) printf("%I64d",x);
#define lfd() printf("\n");
#define sp() printf(" ");
int a,b,c,d;
string s;
map<int,char> mp;
int main(){
	//freopen("input.txt","r",stdin);
	//freopen("output.txt","w",stdout);
	ios::sync_with_stdio(false);
	cin.tie(NULL);
	cout.tie(NULL);
	cin>>s;
	a=s[0]-'0';
	b=s[1]-'0';
	c=s[2]-'0';
	d=s[3]-'0';
	mp[0]='+';
	mp[1]='-';
	for(int i=0;i<8;i++){
		int tmp=a;
		if(i%2==0)
			tmp+=b;
		else
			tmp-=b;
		if((i/2)%2==0)
			tmp+=c;
		else
			tmp-=c;
		if((i/4)%2==0)
			tmp+=d;
		else
			tmp-=d;
		if(tmp==7){
			cout<<a<<mp[i%2]<<b<<mp[(i/2)%2]<<c<<mp[(i/4)%2]<<d<<"=7"<<endl;
			return 0;
		}
	}
	return 0;
}


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

int main() {
  int l,r;
  cin >> l >> r;
  for(int i = l; i < r; i++) {
    if (i%2019==0) {
      cout << 0;
      return 0;
    }
  }
  int l_2 = l%2019, r_2 = r%2019, ans = 2019;
  for (int i = l_2; i < r_2; i++) {
    for (int j = i+1; j <= r_2; j++) {
      ans = min(ans, (i*j)%2019);
    }
  }
  cout << ans;
}

Measured memory_bytes: 256
#include <iostream>

using namespace std;

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

    int r = 0, b = 0;
    char c;

    for (int i = 0; i < N; i++)
    {
        cin >> c;
        if (c == 'R')
            r++;
        else
            b++;
    }

    if (r>b)
        cout << "Yes" <<endl;
    else
        cout << "No" << endl;

    return 0;
}


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

using namespace std;
typedef long long ll;

#define rep(i, N) for (int i = 0; i < (int)N; i++)
const ll MOD = pow(10,9)+7;
const ll LLINF = pow(2,61)-1;
const int INF = pow(2,30)-1;


int main() {
  int N; cin >> N;
  int H[N]; rep(i,N) cin >> H[i];
  int result = 0, now = 0;
  rep(i,N) {
    if (i==0) continue;
    now = (H[i]<=H[i-1]) ? now+1 : 0;
    result = max(result, now);
  }
  cout << result << endl;
  return 0;
}

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

int main(){
    int N; cin >> N;
    int minA=1e9;
    int maxA=-1e9;
    rep(i,N){
        int A; cin >> A;
        minA=min(A,minA);
        maxA=max(A,maxA);
    }
    cout << maxA-minA;
}

Measured memory_bytes: 256
while true
    h,w=gets.split.map{|x| x.to_i}
    break if h==0 && w==0

    h.times{|a|
       w.times{|b|
          if(a+b)%2==0
             print"#"
          else
             print"."
          end
       }
       puts""
    }
    puts""
end

Measured memory_bytes: 6108
import sys
n = int(input())
p = list(map(int, sys.stdin.readline().rstrip().split()))

cnt = 0
for i in range(n-2):
    if (p[i] < p[i+1] < p[i+2]) or (p[i+2] < p[i+1] < p[i]):
        cnt += 1

print(cnt)

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

using namespace std;

int main (void) {
    string S;
    cin >> S;

    int n_boundary = 0;
    for ( int i = 1; i < S.size(); i++ ) {
        if ( S.at(i) != S.at(i-1) )
            n_boundary++;
    }

    cout << n_boundary << endl;
    return 0;
}


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

#define int long long
#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 rep11(i,n) for(int i=1;i<(int)(n);++i)
#define repo(i,o,n) for(int i=o;i<(int)(n);++i)
#define repm(i,n) for(int i=(int)(n)-1;i>=0;--i)
#define all(v) (v).begin(),(v).end()
#define rall(v) (v).rbegin(),(v).rend()
#define pb(n) push_back(n)
#define mp make_pair
#define MOD 1000000007
#define INF LONG_LONG_MAX

int x;
vector<int> v;

signed main() {
    v.pb(2);
    cin >> x;
    if (x == 2) {
        cout << 2 << endl;
        return 0;
    }
    for(int i=3;;i+=2) {
        bool f=true;
        int b = sqrt(i)+1;
        for(auto j : v) {
            if (i%j == 0) f = false;
            if (j > b) break;
        }
        if (f) v.pb(i);
        if (i >= x && f) {
            cout << i << endl;
            return 0;
        }
    }
}


Measured memory_bytes: 512
#include <bits/stdc++.h>
#define rep(i, n) for (int i = 0; i < (n); ++i)
#define sz(x) int(x.size())
using namespace std;
typedef long long ll;
typedef pair<int, int> P;

const ll INF = 1LL << 60;

ll N;
ll dp[100100];

int main() {
    cin >> N;
    vector<ll> v;
    v.push_back(1);

    int tmp = 6;
    while (tmp <= N) {
        v.push_back(tmp);
        tmp *= 6;
    }

    tmp = 9;
    while (tmp <= N) {
        v.push_back(tmp);
        tmp *= 9;
    }
    // rep(i, v.size()) cout << v[i] << " ";

    sort(v.begin(), v.end());
    rep(i, 100100) dp[i] = INF;

    dp[0] = 0;
    rep(i, v.size()) {
        for (int j = v[i]; j <= N; j++) {
            dp[j] = min(dp[j], dp[j - v[i]] + 1);
        }
    }
    cout << dp[N] << endl;
    // rep(i, v.size()) {
    //     cout << v[i] << " ";
    // }

}

Measured memory_bytes: 1532