akhauriyash/Code-Regression huggingface dataset:
#include <bits/stdc++.h>
#define rep(i,n) for (ll i = 0; i < n; ++i)
using namespace std;
using ll = long long;
using ull = long long unsigned;
using P = pair<ll,ll>;
//const int 1001001001;
const int NMAX=8;
const ll MOD=1000000007;
const int dbase=80*160;

const int mod = 998244353;
struct mint {
  ll x; // typedef long long ll;
  mint(ll x=0):x((x%mod+mod)%mod){}
  mint operator-() const { return mint(-x);}
  mint& operator+=(const mint a) {
    if ((x += a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator-=(const mint a) {
    if ((x += mod-a.x) >= mod) x -= mod;
    return *this;
  }
  mint& operator*=(const mint a) { (x *= a.x) %= mod; return *this;}
  mint operator+(const mint a) const { return mint(*this) += a;}
  mint operator-(const mint a) const { return mint(*this) -= a;}
  mint operator*(const mint a) const { return mint(*this) *= a;}
    //a^tを求める
    //例：d[i] = mint(k/i).pow(n);
  mint pow(ll t) const {
    if (!t) return 1;
    mint a = pow(t>>1);
    a *= a;
    if (t&1) a *= *this;
    return a;
  }

  // for prime mod
  mint inv() const { return pow(mod-2);}
  mint& operator/=(const mint a) { return *this *= a.inv();}
  mint operator/(const mint a) const { return mint(*this) /= a;}
};
istream& operator>>(istream& is, const mint& a) { return is >> a.x;}
ostream& operator<<(ostream& os, const mint& a) { return os << a.x;}


template<typename T>
struct BIT {
  int n;
  vector<T> d;
  BIT(int n=0):n(n),d(n+1) {}
    //末尾の要素(i&-i)をたす→一つ上の階層なので、要素の更新の時に使える
  void add(int i, T x=1) {
    for (i++; i <= n; i += i&-i) {
      d[i] += x;
    }
  }
     //末尾の要素(i&-i)を引く→一つ上の一つ左の階層なので、要素の総和をとる時に使える
  T sum(int i) {
    T x = 0;
    for (i++; i; i -= i&-i) {
      x += d[i];
    }
    return x;
  }
	T sum(int l, int r) {
    return sum(r-1) - sum(l-1);
  }
};

mint calc(ll a, ll b, ll c, ll d){
	mint ans=0;

	mint a1=mint(2).pow(a);
	mint b1=mint(2).pow(b);
	mint c1=mint(2).pow(c);
	mint d1=mint(2).pow(d);

	ans+=(a1-1)*b1*(c1-1)*d1;
	ans+=a1*(b1-1)*c1*(d1-1);
	ans-=(a1-1)*(b1-1)*(c1-1)*(d1-1);
	ans+=a1*b1*c1*d1;

	return ans;
}

int main(){
	ll n;
	cin>>n;

	vector<P> g;
	map<ll,ll>mpx;
	map<ll,ll>mpy;

	rep(i,n){
		ll x1,y1;
		cin>>x1>>y1;
		g.push_back(make_pair(x1,y1));
		mpx[x1]=0;
		mpy[y1]=0;
	}
	ll cnt=0;

	for (auto&& i:mpx){
		i.second=cnt++;;
	}
	cnt=0;
	for (auto&& i:mpy){
		i.second=cnt++;;
	}

	rep(i,n){
		g[i].first=mpx[g[i].first];
		g[i].second=mpy[g[i].second];
	}
	vector<ll> a1(n);
	vector<ll> a2(n);
	vector<ll> a3(n);
	vector<ll> a4(n);

	BIT<ll> bi(n);
	sort(g.begin(),g.end());

	rep(i,n){
		ll a1now=bi.sum(g[i].second);
		a1[i]=a1now;
		a2[i]=i-a1now;
		bi.add(g[i].second,1);
			//cout<<a1now<<endl;
	}

	BIT<ll> bi2(n);
	for(ll i=n-1;i>=0;i--){
		ll a4now=bi2.sum(g[i].second);
		a4[i]=a4now;
		a3[i]=n-1-i-a4now;
		bi2.add(g[i].second,1);
	//	cout<<a4now<<endl;
	}
	mint ans=0;

	rep(i,n){
//		cout<<a1[i]<<' '<<a2[i]<<' '<<a3[i]<<' '<<a4[i]<<endl;

		ans+=calc(a1[i],a2[i],a3[i],a4[i]);


	}

cout<<ans.x;

}


Measured memory_bytes: 38636
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;

int main(void)
{
    int n,m;
    cin >> n >> m;
    vector<int> a(n);
    vector<pair<int,int>> b(m);
    for (int i=0;i<n;i++){
        cin >> a.at(i);
    }
    for (int i=0;i<m;i++){
        cin >> b[i].second >> b[i].first;
    }
    sort(a.begin(),a.end());
    sort(b.begin(),b.end(),greater<pair<int,int>>());
    int i=0;
    for(int j=0;j<m;j++){
        while(b[j].second){
            if(a[i]<b[j].first){
                a[i]=b[j].first;
            }
            else i=n;//a[i]の方が大きくなった時点でbreak;
            b[j].second--;
            if(i>n) b[j].second =0;
            if(b[j].second!=0) i++;
        }
        i++;
        if(i>n) break;
    }
    ll sum=0;
    for (int i=0;i<n;i++){
        sum+=a[i];
    }
    cout << sum << endl;
    return 0;
}

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

int main() {
  int N;
  cin >> N;
  int A[100010];
  for (int i = 0; i < N; i++) cin >> A[i];

  sort(A, A + N, greater<int>());

  long long length = 0, width = 0;
  set<int> st;
  for (int i = 0; i < N; i++) {
    if (st.count(A[i]) == 1) {
      if (length > 0) {
        width = A[i];
        break;
      }
      length = A[i];
      st.erase(A[i]);
    } else {
      st.insert(A[i]);      
    }
  }

  cout << length * width << endl;
}

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

// clang-format off
#define  range(i, l, r) for (int i = (int)(l); i < (int)(r); ++(i))
#define rrange(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); --(i))

#define  whole(f, x, ...) ([&](decltype((x)) container) { return (f)(  begin(container),  end(container), ## __VA_ARGS__); })(x)
#define rwhole(f, x, ...) ([&](decltype((x)) container) { return (f)( rbegin(container), rend(container), ## __VA_ARGS__); })(x)

#define endl '\n'
#define debug(x) cerr << "(" << __LINE__ << ")" << #x << ": " << (x) << endl

using i32 = int;
using u32 = unsigned int;
using i64 = long long;
using u64 = unsigned long long;

constexpr i32 mod   = 1e9 + 7;
constexpr i32 inf   = 1001001001;
constexpr i64 infll = 1001001001001001001ll;

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

struct IoSetup { IoSetup(int x = 15){ cin.tie(0); ios::sync_with_stdio(0); cout << fixed << setprecision(x); cerr << fixed << setprecision(x); } } iosetup;

template <typename T = i64> T input() { T x; cin >> x; return x; }

template <typename T> ostream &operator<<(ostream &os, vector<T> &v) { range(i, 0, v.size()) { os << v[i] << (i + 1 != v.size() ? " " : ""); } return os; } 
template <typename T> istream &operator>>(istream &is, vector<T> &v) { for (T &in : v) is >> in; return is; }

template <typename T1, typename T2> ostream &operator<<(ostream &os, pair<T1, T2> p) { os << "(" << p.first << ", " << p.second << ")"; return os; }
template <typename T1, typename T2> istream &operator>>(istream &is, pair<T1, T2> &p) { is >> p.first >> p.second; return is; }

template <typename T> vector<T> make_vector(size_t a, T b) { return vector<T>(a, b); }
template <typename... Ts> auto make_vector(size_t a, Ts... ts) { return vector<decltype(make_v(ts...))>(a, make_v(ts...)); }

template <typename T1, typename T2> inline bool chmax(T1 &a, T2 b) { return a < b && (a = b, true); }
template <typename T1, typename T2> inline bool chmin(T1 &a, T2 b) { return a > b && (a = b, true); }
// clang-format on

void solver() {
  i32 N = input(), P = input();
  string S = input<string>();

  if (P == 2 || P == 5) {
    i64 ans = 0;
    range(i, 0, N) {
      if ((S[i] - '0') % P == 0) ans += (i + 1);
    }

    cout << ans << endl;
    return;
  }

  auto dp = make_vector(N + 1, 0);
  map< i32, i64 > mp;
  mp[0]++;
  i64 k = 1;
  rrange(i, 0, N) {
    dp[i] = (dp[i + 1] + k * (S[i] - '0') % P) % P;
    (k *= 10) %= P;
    mp[dp[i]]++;
  }

  i64 ans = 0;
  for (auto p : mp) {
      i64 m = p.second;
      ans += m * (m - 1) / 2;
  }

  cout << ans << endl;
}

signed main(int argc, char *argv[]) { solver(); }

Measured memory_bytes: 1812
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef vector<long long> vll;

int main()
{
	ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0);
    string s;
    cin>>s;
    for(ll i=0;i<s.length();i++)
    {
        if(s[i]==',')
            cout<<" ";
        else
        {
            cout<<s[i];
        }
    }

  return 0;
}



Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
#include<cstdio>
#include<cmath>
#include<cstring>
using namespace std;
#define ll long long
#define FOR(i,a,b) for(int i=a;i<=b;i++)
#define FORD(i,a,b) for(int i=a;i>=b;i--)
#define FORL(i,x) for(int i=head[x];i;i=nxt[i])
#define clr(x,y) memset(x,y,sizeof(x))
#define in(a) a=read()
#define out(a) printf("%d\n",a)
inline ll read(){
    char c=getchar();ll f=1,x=0;
    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;
}
#define mod 998244353
void MOD(int &x){if(x>=mod)x-=mod;}
#define maxn 200010
#define inf (1<<30)
struct node{
	int x,Y,y;
}a[maxn];
bool cmp(node a,node b){return a.Y<b.Y;}
bool cmp2(node a,node b){return a.x<b.x;}
int f[maxn],s[maxn];
int n;
void add(int x){
	for(;x<=n;x+=x&(-x))s[x]++;
}
int cx(int x){
	int ans=0;
	for(;x;x-=-x&x)ans+=s[x];
	return ans;
}
int c1[maxn],c2[maxn],d1[maxn],d2[maxn];
int power(int a,int b){
	int ans=1;
	while(b){
		if(b&1)ans=1ll*ans*a%mod;
		a=1ll*a*a%mod;
		b>>=1;
	}
	return ans;
}
int main(){
	in(n);
	FOR(i,1,n)in(a[i].x),in(a[i].Y);
	sort(a+1,a+n+1,cmp);
	FOR(i,1,n)a[i].y=i;
	sort(a+1,a+n+1,cmp2);
	FOR(i,1,n){
		c1[i]=cx(a[i].y);
		c2[i]=i-1-c1[i];
		add(a[i].y);
	}
	clr(s,0);
	FORD(i,n,1){
		d1[i]=cx(a[i].y);
		d2[i]=n-i-d1[i];
		add(a[i].y);
	}
	f[0]=1;FOR(i,1,n)f[i]=power(2,i);
	int ans=0;
	FOR(i,1,n)MOD(ans+=f[n-1]);
	FOR(i,1,n){
		int y=a[i].y;
		MOD(ans+=1ll*(f[y-1]-1)*(f[n-y]-1)%mod);
		MOD(ans+=mod-1ll*(f[c1[i]]-1)*(f[c2[i]]-1)%mod);
		MOD(ans+=mod-1ll*(f[d1[i]]-1)*(f[d2[i]]-1)%mod);
	}
	out(ans);
}


Measured memory_bytes: 7296
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {
	public static void main(String[] a) throws IOException {
		InputStreamReader is = new InputStreamReader(System.in);
		BufferedReader br = new BufferedReader(is);
		String str;
		while ((str = br.readLine()) !=null) {

			String num_str[] = new String[2];
			num_str = str.split(" ");
			int sum = Integer.parseInt(num_str[0]) + Integer.parseInt(num_str[1]);
			System.out.println(Integer.toString(sum).length());
		}
	}
}

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

int main() {
  
  string digit;
  
  cin >> digit;
  
  if(digit.at(0) == digit.at(2)) {
    
    cout << "Yes" << endl;
    
  } else if(digit.at(0) != digit.at(2)) {
    
    cout << "No" << endl;
    
  }
  
  return 0;
  
}

Measured memory_bytes: 256
D,N = list(map(int,input().split()))
 
if D == 0:
    if N != 100:
        print(N)
    else:
        print(N+1)
elif D == 1:
    if N != 100:
        print(N * 100)
    else:
        print(N * 100 + 100)
else:
    if N != 100:
        print(N * 100 ** 2)
    else:
        print(N * 100 ** 2 + 10000)

Measured memory_bytes: 3064
def main():
    S = input()
    while len(S):
        if S[:7] == 'dreamer':
            if S[5:11] == 'eraser':
                S = S[5:]
            elif S[5:10] == 'erase':
                S = S[5:]
            else:
                S = S[7:]
        elif S[:5] == 'dream':
            S = S[5:]
        elif S[:6] == 'eraser':
            S = S[6:]
        elif S[:5] == 'erase':
            S = S[5:]
        else:
            print('NO')
            exit()
    print('YES')


if __name__ == '__main__':
    main()


Measured memory_bytes: 135276
import heapq

n,m=map(int,input().split())
a=list(map(int,input().split()))
for i in range(n):
    a[i]*=-1

#print(a)

#for i in range(n):
#    a.append(int(input())*(-1))

heapq.heapify(a)

for i in range(m):
    #heapq.heappush(a,heapq.heappop(a)*(-1)//2*(-1))
    t=heapq.heappop(a)
    t=t*(-1)//2*(-1)
    heapq.heappush(a,t)

print(sum(a)*(-1))

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

using Weight = int;
using Capacity = int;
struct Edge {
    int src, dst; Weight weight;
    Edge(int s, int d, int w) : src(s), dst(d), weight(w) {}
};
using Edges = vector<Edge>;
using Graph = vector<Edges>;
using Array = vector<Weight>;
using Matrix = vector<Array>;

struct UndirectionalCompare {
    bool operator() (const Edge& e, const Edge& f) const {
        if (min(e.src,e.dst) != min(f.src,f.dst))
            return min(e.src,e.dst) < min(f.src,f.dst);
        return max(e.src,e.dst) < max(f.src,f.dst);
    }
};
typedef set<Edge, UndirectionalCompare> Edgeset;
void visit(const Graph &g, int v, int u,
           vector<int>& art, vector<Edgeset>& bcomp,
           stack<Edge>& S, vector<int>& num, vector<int>& low, int& time) {
    low[v] = num[v] = ++time;
    for(auto &e : g[v]){
        int w = e.dst;
        if (num[w] == 0) {
            visit(g, w, v, art, bcomp, S, num, low, time);
            low[v] = min(low[v], low[w]);
            if ((num[v] == 1 && num[w] != 2) ||         // for arts
                (num[v] != 1 && low[w] >= num[v])) art.push_back(v);
        } else low[v] = min(low[v], num[w]);
    }
}
void articulationPoint(const Graph& g,
                       vector<int>& art, vector<Edgeset>& bcomp) {
    const int n = g.size();
    vector<int> low(n), num(n);
    stack<Edge> S;
    for(int u = 0; u < n; u++){
        if (num[u] == 0) {
            int time = 0;
            visit(g, u, -1, art, bcomp, S, num, low, time);
        }
    }
}

int main(){
    ios::sync_with_stdio(0);
    cin.tie(0);
    int n,m;
    while(cin >> n >> m){
        Graph g(n);
        rep(i,m){
            int a,b;
            cin >> a >> b;
            g[a].emplace_back(a,b,0);
            g[b].emplace_back(b,a,0);
        }
        vector<int> arts;
        vector<Edgeset> es;
        articulationPoint(g,arts,es);
        sort(all(arts));
        auto last = unique(all(arts));
        for(auto it = arts.begin(); it != last; ++it) cout << *it << '\n';
    }
}

Measured memory_bytes: 6372