akhauriyash/Code-Regression huggingface dataset:
#include <iostream>
#include <vector>
#include <cmath>
using namespace std;
int main () {
  int n;
  cin >> n;
  int digit = 0;
  int tmp = n;
  for (digit = 1; digit < 10; digit++) {
    tmp = (tmp - (tmp % 10)) / 10;
    if (tmp <= 0) {
      break;
    }
  }
  int ans = 0;
  for (int i = 3; i <= digit - 1; i++) {
    ans += pow(3, i) - 3 * pow(2, i) + 3;
  }
  vector<int> a(digit, 3);
  bool loop = true;
  while (loop) {
    int a_int = 0;
    bool in3 = false, in5 = false, in7 = false;
    for(int i = 0; i < digit; i++) {
      a_int = a_int * 10 + a.at(i);
      if (a.at(i) == 3) {
        in3 = true;
      } else if (a.at(i) == 5) {
        in5 = true;
      } else {
        in7 = true;
      }
    }
    if (a_int > n) {
      break;
    }
    if (in3 && in5 && in7) {
      ans++;
    }
    for (int i = digit - 1; i >= 0; i--) {
      if (a.at(i) < 7) {
        a.at(i) += 2;
        break;
      } else {
        a.at(i) = 3;
        if (i == 0) {
          loop = false;
        }
      }
    }
  }
  cout << ans << endl;
  return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<math.h>
using namespace std;
int main(){
    double x=0,y=0,a,b,an=90;
    char c;
    while(cin>>a>>c>>b){
        if(a==0&&b==0)break;
        x+=a*cos(an/180.0*M_PI);
        y+=a*sin(an/180.0*M_PI);
        an-=b;
    }
    cout<<(int)x<<endl<<(int)y<<endl;
}

Measured memory_bytes: 1228
#include"bits/stdc++.h"
using namespace std;

int main() {
	int A, B, C;
	cin >> A >> B >> C;
	if (A != B && B != C && C != A) {
		cout << "No" << endl;
	}
	else if (A == B && B == C) {
		cout << "No" << endl;
	}
	else {
		cout << "Yes" << endl;
	}
	return 0;
}

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

#ifdef LOCAL
#define debug(var) cerr << (#var) << " = " << (var) << endl;
#else
#define debug(var)
#endif

void init() {
  ios_base::sync_with_stdio(0);
  cin.tie(0); cout.tie(0);
}

void solve() {
  long long a, b, c; scanf("%lld %lld.%lld", &a, &b, &c);
  printf("%lld", a * (100LL * b + c) / 100LL);
}

int main() {
  int t = 1; //scanf("%d", &t);
  while (t--) {
    solve();
  }
  return 0;
}


Measured memory_bytes: 3784
#include<iostream>
#include<cstring>
#include<algorithm>
using namespace std;
#define INF (1<<26)
int N,ans=INF;
int t[10001];
int dp[2][5001][2];

int main(){
  for(int i=0;i<2;i++){
    for(int j=0;j<5001;j++){
      dp[i][j][true]=dp[i][j][false]=INF;
    }
  }
  cin>>N;
  for(int i=1;i<N;i++)cin>>t[i];

  dp[1][1][true]=0;
  dp[1][0][false]=0;

  for(int i=2;i<=N;i++){
    int ai=i%2,bi=1-ai;
    for(int j=0;j<=N/2;j++){
      dp[ai][j][true]=INF;
      if(j)dp[ai][j][true]=min(dp[ai][j][true],dp[bi][j-1][true]);
      if(j)dp[ai][j][true]=min(dp[ai][j][true],dp[bi][j-1][false]+t[i-1]);

      dp[ai][j][false]=INF;
      dp[ai][j][false]=min(dp[ai][j][false],dp[bi][j][false]);
      dp[ai][j][false]=min(dp[ai][j][false],dp[bi][j][true]+t[i-1]);
    }
  }
  cout<<min(dp[N%2][N/2][true],dp[N%2][N/2][false])<<endl;
  return 0;
}

Measured memory_bytes: 1276
import Data.Maybe
import qualified Data.ByteString.Char8 as B
import qualified Data.Set as S
main = mapM_ (print . solve) . analyze . map readInt . B.words =<< B.getContents
readInt = fst . fromJust . B.readInt
analyze (n:k:cs) = let (as,bs) = splitAt n cs in (n,k,as):analyze bs
analyze _ = []
solve (n,k,as) = fst . foldr f (0,(0,S.empty)) . zip [n,n-1..] $ as where
  f (i,a) (c,(d,s)) = (c+r,(e,t)) where
    e = k-a+d
    t = S.insert (d,i) s
    r = case S.lookupGE (e,0) t of
      Just x  -> i-S.findIndex x t
      Nothing -> 0

Measured memory_bytes: 131452
#define _CRT_SECURE_NO_WARNINGS
#define _USE_MATH_DEFINES
#include <iostream>
#include <cstdio>
#include <vector>
#include <algorithm>
#include <numeric>
#include <set>
#include <unordered_set>
#include <map>
#include <unordered_map>
#include <string>
#include <iterator>
#include <cmath>
#include <deque>
#include <stack>
#include <functional>
#include <queue>
using namespace std;
#define int long long

const int INF = 1e18;


signed main()
{
    {
        if (fopen("input.txt", "r")) {
            freopen("input.txt", "r", stdin);
            freopen("output.txt", "w", stdout);
        }
        ios_base::sync_with_stdio(false);
        cin.tie(NULL);
        cout.tie(NULL);
    }

    pair<int, int> p{ 1, 1000 }, q{ 1, 10001 };

    int n, d, a;
    cin >> n >> d >> a;
    vector< pair<int, int> > x(n);
    for (int i = 0; i != n; ++i)
        cin >> x[i].first >> x[i].second;
    vector<int> y(n);
    sort(x.begin(), x.end());
    int damage = 0, ans = 0;
    for (int i = 0; i != n; ++i) {
        damage -= y[i];
        int k = max(0LL, (x[i].second - damage + a - 1) / a);
        ans += k;
        damage += k * a;
        int j = upper_bound(x.begin(), x.end(), make_pair(x[i].first + 2 * d, INF)) - x.begin();
        if (j < n)
            y[j] += k * a;
    }
    cout << ans;
    return 0;
}

Measured memory_bytes: 4992
#include <bits/stdc++.h>
using namespace std;
long long x;
long long solve (long long x) {
	if (x==1) {return 1;}
	else {return 2*solve(x/2)+1;}
}
int main () {
	scanf("%lld",&x);
	printf("%lld\n",solve(x));
	return 0;
}

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

int main(){
	int a,b,c;
	cin >> a >> b >> c;
	int k,cnt=0;
	cin >> k;
	while(a>=b){
		b*=2;
		cnt++;
	}
	while(b>=c){
		c*=2;
		cnt++;
	}
	if(cnt>k) cout << "No\n";
	else cout << "Yes\n";
}

Measured memory_bytes: 3620
#include <iostream>
#include <vector>
#include <algorithm>
#include <climits>
#include <utility>
#include <cstring>
#include <functional>

using namespace std;

typedef long long LL;

int main() {
    // freopen("1.txt", "r", stdin);
    LL N;
    cin >> N; // N and N - 1 are relatively prime

    int res = 0;
    for(LL i = 2; i * i <= N - 1; ++i) {
        if((N - 1) % i == 0) {
            ++res;
            if(i * i != N - 1) ++res;
        }
    }
    if(N != 2) ++res; // N - 1;

    for(LL i = 2; i * i <= N; ++i) {
        if(N % i == 0) {
            LL n0 = N;
            while(n0 % i == 0) n0 /= i;
            if((n0 - 1) % i == 0) ++res;
        }
    }
    ++res;
    cout << res << endl;

    return 0;
}


Measured memory_bytes: 256
#include<bits/stdc++.h>
using namespace std;
const int N = 101010;
typedef long long ll;
int a[N];ll b[N];
int f[N];
const int B=1<<17;
int tr[B<<1];
int qt[N],ans[N];
typedef pair<int,pair<int,int>> EV;
void upd(int l,int r,int s){
	for(l+=B,r+=B;l/2!=r/2;l/=2,r/=2){
		if(!(l&1))tr[l+1]+=s;
		if(r&1)tr[r-1]+=s;
	}
}
int get(int i){
	int s=0;
	for(i+=B;i;i/=2)s+=tr[i];
	return s;
}
int main(){
	int X;scanf("%d",&X);
	int n;scanf("%d",&n);
	for(int i=1;i<=n;i++)scanf("%d",&a[i]);
	for(int i=1;i<=n;i++){
		if(i&1)b[i]=b[i-1]-a[i]+a[i-1];
		else b[i]=b[i-1]+a[i]-a[i-1];
	}
	priority_queue<pair<int,pair<int,int>>,vector<EV>,greater<EV>> pq;
	int c=0;int R=n+1;
	for(int i=1;i<=n;i++){
		int oc=c;
		if(i&1){
			c-=a[i]-a[i-1];
			if(c<0)c=0;
			f[i]=c;
		}
		else{
			c+=a[i]-a[i-1];
			if(c>X)c=X;
			f[i]=c;
		}
		if(f[i]==X)R=min(R,i);
	}
	pq.push({a[1],{0,1}});
	pq.push({X,{1,0}});
	int Q;scanf("%d",&Q);
	for(int i=0;i<Q;i++){
		int t,a;scanf("%d%d",&t,&a);
		qt[i]=t;
		pq.push({a,{2,i}});
	}
	int nL=1;
	int lastT=0;
	while(!pq.empty()){
		auto E=pq.top();pq.pop();
		int cT=E.first;
		//printf("Event %d %d %d\n",cT,E.second.first,E.second.second);
		upd(-1,min(nL,R),cT-lastT);
		lastT=cT;
		int tp=E.second.first;
		if(tp==0){
			int ii=E.second.second;
			if(ii>=R)continue;
			int c=0;
			nL=n+1;
			for(int j=ii+1;j<=n;j++){
				if(j&1){
					c-=a[j]-a[j-1];
					if(c<0){
						nL=j;
						pq.push({cT-c,{0,j}});
						break;
					}
				}
				else{
					c+=a[j]-a[j-1];
					if(c<X){
						pq.push({cT+X-c,{1,j}});
					}
					else{
						R=min(R,j);
						break;
					}
				}
			}
		}
		else if(tp==1){
			int ii=E.second.second;
			R=min(R,ii);	
		}
		else{
			int qi = E.second.second;
			int tt=qt[qi];
			int j=upper_bound(a,a+n+1,tt)-a-1;
			int cur=get(j)+f[j];
			//printf("EV3 %d %d\n",get(j),f[j]);
			if(j&1){
				ans[qi]=min(cur+tt-a[j],X);
			}
			else{
				ans[qi]=max(0,cur-tt+a[j]);
			}
		}
	}
	for(int i=0;i<Q;i++)printf("%d\n",ans[i]);
}

Measured memory_bytes: 7412
#include <bits/stdc++.h>
using namespace std;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define rrep(i, n) for(int i = n-1; i >= 0; i--)
#define  all(x) (x).begin(),(x).end()     // 昇順ソート
#define  rall(v) (v).rbegin(), (v).rend() // 降順ソート
#define  FastIO ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0)
typedef long long ll;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;
using VL = vector<ll>;
using VVL = vector<vector<ll>>;
using VP = vector<P>;
template<class T> bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (a>b) { a=b; return true; } return false; }

int main(){
    int n;
    cin >> n;
    VI d(n);
    rep(i,n) cin >> d[i];
    int m;
    cin >> m;
    VI t(m);
    rep(i,m) cin >> t[i];

    sort(all(d));
    sort(all(t));
    int left = 0;
    rep(i,m){
        while (left < n) {
            if (t[i] == d[left]) break;
            left++;
        }
        if (left >= n){
            cout << "NO" << endl;
            return 0;
        }
        left++;
    }
    cout << "YES" << endl;
    return 0;
}

Measured memory_bytes: 4816
import java.util.*;

public class Main {

	private static final long MOD = 100_000_000_7;

	public static void main(String[] args) {
		new Main().execute();
	}

	public void execute() {
		Scanner sc = new Scanner(System.in);
		final int N = sc.nextInt();
		final int M = sc.nextInt();
		long[] x = new long[N];
		long[] y = new long[M];

		for (int i = 0; i < N; i++) {
			x[i] = sc.nextLong();
		}

		for (int i = 0; i < M; i++) {
			y[i] = sc.nextLong();
		}
		// bruteForce(x, y);

		long xSum = 0;

		for (int i = 0; i < N; i++) {
			xSum = (xSum + i * x[i] - (N - i - 1) * x[i]) % MOD;
		}

		long ySum = 0;
		for (int j = 0; j < M; j++) {
			ySum = (ySum + j * y[j] - (M - j - 1) * y[j]) % MOD;
		}
		System.out.println((xSum * ySum) % MOD);
		// System.out.println(area(x, y, 0, x.length - 1, 0, y.length - 1));
		sc.close();

	}

	private void bruteForce(long[] x, long[] y) {
		int n = x.length;
		int m = y.length;
//		int[][] count = new int[n][m];
		long S = 0;
		for (int i = 0; i < n; i++) {
			for (int j = i + 1; j < n; j++) {
				for (int k = 0; k < m; k++) {
					for (int l = k + 1; l < m; l++) {

						/*
						 * for (int a = i; a < j; a++) { for (int b = k; b < l; b++) { count[a][b]++; }
						 * }
						 */
						S = (S + (x[j] - x[i]) * (y[l] - y[k])) % MOD;
					}
				}
			}
		}

		/*
		 * for (int j = m - 1; j >= 0; j--) { for (int i = 0; i < n; i++) {
		 * System.out.print(count[i][j] + " "); } System.out.println(); }
		 */
		System.out.println(S);
	}
}

Measured memory_bytes: 93208
#include<bits/stdc++.h>
using namespace std;
#define int long long
#define sz(x) (int)(x.size())
#define fi first
#define se second
#define pii pair<int, int>

signed main() {
    ios::sync_with_stdio(false); cin.tie(nullptr); 
    int n, m;
    cin >> n >> m;
    int ans = 0;
    int a[n];
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        ans += a[i];
    }
    sort(a, a + n);
    vector<pii> p(m);
    for (int i = 0; i < m; i++) {
        cin >> p[i].se >> p[i].fi;
    }
    sort(p.rbegin(), p.rend());
    int ptr = 0;
    for (int i = 0; i < m && ptr < n; i++) {
        int cnt = 0;
        while(ptr < n && a[ptr] < p[i].fi && cnt < p[i].se) {
            ans += p[i].fi - a[ptr];
            ptr++;
            cnt++;
        }
    }
    cout << ans << "\n";
}

Measured memory_bytes: 2560
#include <iostream>
#include <cmath>
#include <algorithm>
using namespace std;

int main(void) {
  int N, T, A;
  int H[1010];
  cin >> N >> T >> A;

  double ans = 1e18;
  for (int i = 0; i < N; ++i) {
    cin >> H[i];
    ans = min(ans, abs(A - (T - H[i] * 0.006))); 
  }
  
  for (int i = 0; i < N; ++i) {
    if (ans == abs(A - (T - H[i] * 0.006))) {
      cout << i + 1 << endl;
    }
  }

  return 0;
}

Measured memory_bytes: 256
X,Y=map(int,input().split())

S={X,Y}

S1={1,3,5,7,8,10,12}
S2={4,6,9,11}
S3={2}

if len(S1)==len(S1|S):
    print("Yes")
elif len(S2)==len(S2|S):
    print("Yes")
elif len(S3)==len(S3|S):
    print("Yes")
else:
    print("No")

Measured memory_bytes: 3064
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> pp;
typedef pair<ll,ll> pll;
void read(int& x){ scanf("%d",&x); }
void read(ll& x){ scanf("%lld",&x); }
template<typename T,typename... Args>
void read(T& a,Args&... b){ read(a); read(b...); }
#define all(x) (x).begin(),(x).end()
#define pb push_back
#define eb emplace_back
#define x first
#define y second

int n;
vector<int> e[100010];

int par[100010];

int X;

int dfs(int a){
	vector<int> v;
	for(int b:e[a]){
		if(par[a] == b) continue;
		par[b]=a;
		v.pb(dfs(b)+1);
	}
	sort(all(v));
	int cc = v.size();
	if(a == 1){
		if(cc % 2){
			if(v[cc-1] > X) throw 1;
			for(int l=0,r=cc-2; l<r; ++l,--r) if(v[l]+v[r]>X) throw 1;
			return 0;
		} else {
			for(int l=0,r=cc-1; l<r; ++l,--r) if(v[l]+v[r]>X) throw 1;
			return 0;
		}
	} else if(e[a].size() % 2){
		bool just = true;
		for(int l=0, r=cc-1; l<r; ++l, --r){
			if(v[l] + v[r] > X){
				just = false;
				break;
			}
		}
		if(just){
			return 0;
		}
		if(v[cc-1] > X) throw 1;
		for(int l=1, r=cc-2; l<r; ++l, --r){
			if(v[l] + v[r] > X){
				just = false;
				break;
			}
		}
		return v[0];
	} else {
		for(int l=0, r=cc-2; l<r; ++l, --r) if(v[l] + v[r] > X) throw 1;
		int l=-1, r=cc-1;
		while(l+1 < r){
			int mid = (l+r)/2;
			bool fok = 1;
			for(int pl=0, pr=cc-1; pl<pr;){
				if(pl == mid){ ++pl; continue; }
				if(pr == mid){ --pr; continue; }
				if(v[pl] + v[pr] > X){
					fok = 0;
					break;
				}
				++pl; --pr;
			}
			if(fok) r=mid;
			else l=mid;
		}
		return v[r];
	}
}

bool check(int x){
	X = x;
	fill(par+1, par+n+1, 0);
	try {
		dfs(1);
		return 1;
	} catch(int t){ return 0; }
}

int main()
{
	read(n);
	for(int i=1; i<n; ++i){
		int a, b; read(a, b);
		e[a].pb(b); e[b].pb(a);
	}
	int oc = count_if(e+1, e+n+1, [](auto& v){ return v.size()%2; });
	printf("%d ", oc/2);
	
	int L = 0, R = n-1;
	while(L+1 < R){
		int mid = (L+R)/2;
		if(check(mid)) R = mid; else L = mid;
	}
	
	printf("%d\n", R);
	return 0;
}


Measured memory_bytes: 14080
n, x = gets.chop.split.map(&:to_i)
a = gets.chop.split.map(&:to_i)
child = 0
a.sort!
i = 0
while a.length > 0 do
    x -= a[0] if a[0] != nil
    a.shift
    #p "x:#{x}, a:#{a}"
    break if x < 0
    i += 1 if a.length >= 1
    i += 1 if a.length == 0 && x == 0
end
puts i

Measured memory_bytes: 1788
#include<iostream>
#include<string>
using namespace std;
int main()
{
  int n,i;
  string s,t,u;
  cin >> n;
  cin >> s;
  if(n%2==1){
    cout << "No" << endl;
    return 0;
  }
  n/=2;
  t=s.substr(0,n);
  u=s.substr(n,n);
  if(t==u)
    cout << "Yes" << endl;
  else
    cout << "No" << endl;
  return 0;
}

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

bool pal(string s) {
  string t = s;
  reverse(t.begin(), t.end());
  return s == t;
}

int main() {
  string S;
  cin >> S;
  int N = S.size();
  cout << ((pal(S) && pal(S.substr(0, N / 2))) ? "Yes" : "No") << "\n";
}

Measured memory_bytes: 256
#define _USE_MATH_DEFINES
#include <math.h>
#include <iostream>
#include <iomanip>
#include <cstdlib>
#include <algorithm>
#include <numeric>
#include <stdio.h>
#include <vector>

using namespace std;
typedef long long ll;

#define rep(i, n) for(ll i = 0; i < (ll)(n); i++)

int main() {

    ll lim = 200000;
    ll N;
    cin >> N;
    ll L[lim];
    ll R[lim];
    rep(i,lim){
        L[i] = 0;
        R[i] = 0;
    }
    rep(i,N){
        ll A = 0;
        cin >> A;
        if(i+A<lim) L[i+A]++;
        if(i-A>0) R[i-A]++;
    }
    ll out = 0;
    rep(i,lim){
        out += L[i]*R[i];
    }
    cout << out << endl;
    return 0;
}


Measured memory_bytes: 6708
#include <cmath>
#include <cstdio>
#include <string>
#include <iomanip>
#include <iostream>
#include <algorithm>
#include <functional>
#pragma warning(disable : 4996)
using namespace std;
const int mod = 1000000007;
int N, c[1009];
int main() {
	cin >> N;
	for (int i = 1; i <= N; i++) {
		int t = i;
		for (int j = 2; j * j <= N; j++) {
			while (t % j == 0) t /= j, c[j]++;
		}
		if (t != 1) c[t]++;
	}
	int ret = 1;
	for (int i = 1; i <= N; i++) ret = 1LL * ret * (c[i] + 1) % mod;
	cout << ret << endl;
	return 0;
}

Measured memory_bytes: 764
//Author - Rahil Malhotra
#include <bits/stdc++.h>
using namespace std;
 
template <typename T> void print(T t) { cout<<t<<endl; }
template<typename T, typename... Args> void print(T t, Args... args) { cout<<t<<" "; print(args...); }
 
#define IOS ios::sync_with_stdio(0); cin.tie(0); cout.tie(0);
#define endl '\n'
#define int long long
#define double long double

void start() {
	#ifndef ONLINE_JUDGE 
		freopen("in", "r", stdin); 
		freopen("out", "w", stdout); 
	#endif
}

int n, m;

int32_t main() {
    IOS;
    start();

    int n;
    cin >> n;
    if(n % 2 == 1) {
        return cout<< 0, 0;
    }
    n /= 2;
    int ans = 0;
    int cur = 5;
    while(true) {
        int val = n / cur;
        if(!val)
            break;
        ans += val;
        cur *= 5l;
    }
    print(ans);
}   

Measured memory_bytes: 3660
#import sys
MOD = 10 ** 9 + 7
INFI = 10**10
#input = sys.stdin.readline
import math
from collections import deque
import itertools
import heapq
#import bisect
from fractions import Fraction
import copy
from functools import lru_cache
from collections import defaultdict
import pprint

#oo=list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")
# ko=list("abcdefghijklmnopqrstuvwxyz")

def sosuhante(n):
    for k in range(2, int(math.sqrt(n))+1):
        if n% k ==0:
            return False
    return True
def cmb(n, r):
    if n - r < r: r = n - r
    if r == 0: return 1
    if r == 1: return n

    numerator = [n - r + k + 1 for k in range(r)]
    denominator = [k + 1 for k in range(r)]

    for p in range(2,r+1):
        pivot = denominator[p - 1]
        if pivot > 1:
            offset = (n - r) % p
            for k in range(p-1,r,p):
                numerator[k - offset] /= pivot
                denominator[k] /= pivot

    result = 1
    for k in range(r):
        if numerator[k] > 1:
            result *= int(numerator[k])

    return result

def kingaku(a,b,n):
    keta=len(str(n))
    return a*n+b*keta

def my_index(l, x, default=False):
    if x in l:
        return l.index(x)
    else:
        return default

#    h,w,a,b = map(int, input().split())
#    c = [[0 for j in range(n)] for i in range(n)]

def ret(a):
    c=[None]*(len(a)-1)
    if len(a)==1:
        return a[0]
    elif len(a)==0:
        return 0
    for i in range(1,len(a)):
        c[i-1]=abs(a[i]-a[i-1])
    return ret(c)

def soinsubunkai(n):
    a = []
    i = 1
    while i*i <= n:
        if n % i == 0 and i!=1:
            a.append(i)
            n=n//i

        if n% i !=0 or i==1:
            i += 1
    nokori=[n]
    return a + nokori

def make_divisors(n):
    lower_divisors , upper_divisors = [], []
    i = 1
    while i*i <= n:
        if n % i == 0:
            lower_divisors.append(i)
            if i != n // i:
                upper_divisors.append(n//i)
        i += 1
    return lower_divisors + upper_divisors[::-1]

def main():
    n=int(input())
    a=[0 for i in range(10**7+1)]
    total=0
    for i in range(1,n+1):
        for j in range(i,n+1,i):
            a[j]+=1
        total+=i*a[i]
    print(total)


if __name__ == "__main__":

    main()

Measured memory_bytes: 224576
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
int main(){
  // 標準入力高速化のおまじない
  // scanfとの同期を切る。以降紛らわしいのでscanf使用不可。
  ios::sync_with_stdio(false);
  // // cin前の自動flashをやめる
  cin.tie(nullptr);
  int N,K;
  cin >> N >> K;
  vector<int> fruits(N);

  for(int i = 0; i < N; i++) cin >> fruits[i];

  std::sort(fruits.begin(), fruits.end());
  int result = 0;

  for(int i = 0; i < K; i++) result += fruits[i]; 

  cout << result << endl;
  return 0;
}

Measured memory_bytes: 3632
#include <iostream>
#include <algorithm>
#include <bitset>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <cstring>
#include <utility>
#include <vector>
#include <complex>
#include <valarray>
#include <fstream>
#include <cassert>
#include <cmath>
#include <functional>
#include <iomanip>
#include <numeric>
#include <climits>
#include <random>

#define _overload(a, b, c, d, ...) d
#define _rep1(X, A, Y) for (int (X) = (A);(X) <= (Y);++(X))
#define _rep2(X, Y) for (int (X) = 0;(X) < (Y);++(X))
#define rep(...) _overload(__VA_ARGS__, _rep1, _rep2)(__VA_ARGS__)
#define rrep(X,Y) for (int (X) = Y-1;(X) >= 0;--(X))
#define all(X) (X).begin(),(X).end()
#define len(X) ((int)(X).size())
#define mod(n, m) (((n)%(m)+(m))%m)
#define fi first
#define sc second
using namespace std;
typedef long long ll;
typedef unsigned long long ull;
typedef pair<int,int> Pii;
typedef pair<ll,ll> Pll;
const int INFINT = 1 << 30;                          // 1.07x10^ 9
const ll INFLL = 1LL << 60;                          // 1.15x10^18
const double EPS = 1e-10;
const int MOD = 1000000007;
const int dx[4] = {1, 0, -1, 0}, dy[4] = {0, 1, 0, -1};

const int MAX_N = 100000;
int H[MAX_N];
int N;

int dp[MAX_N];

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

  cin >> N;
  rep(i, N) cin >> H[i];

  int ans = 0;
  for (int i = N-2; i >= 0; --i) {
    if (H[i] >= H[i+1]) {
      dp[i] = dp[i+1] + 1;
    } else {
      dp[i] = 0;
    }
    ans = max(ans, dp[i]);
  }

  cout << ans << endl;

  return 0;
}


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

int main() {
  char c;
  string flag;
  cin >> c;
  flag = "consonant";
  if (c == 'a' || c == 'i') {
    flag = "vowel";
  }
  if (c == 'u' || c == 'e') {
    flag = "vowel";
  }
  if (c == 'o') {
    flag = "vowel";
  }
  
  cout << flag << endl;
}


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

#define ld long double
#define ll long long int
#define ull unsigned long long int
#define vi vector<int>
#define vl vector<ll>
#define vvi vector< vector<int> >
#define vvl vector< vector<ll> >
#define repd(i, a, b) for (int i=(a);i<(b);i++)
#define rep(i, n) repd(i,0,n)
#define ALL(v) v.begin(), v.end()
#define INF 1e9

using namespace std;

/**
 * calculate GCD(greatest common divisor)
 * @param a
 * @param b
 * @return
 */
unsigned euclidean_gcd(unsigned a, unsigned b) {
    if (a < b) return euclidean_gcd(b, a);
    unsigned r;
    while ((r = a % b)) {
        a = b;
        b = r;
    }
    return b;
}

/**
 * change minimum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T>
inline bool changeMinimum(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * change maximum
 * @tparam T
 * @param a
 * @param b
 * @return bool
 */
template<class T>
inline bool changeMaximum(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
}

/**
 * output answer
 * @tparam T
 * @param answer
 * @return
 */
template<typename T>
T output(T answer) {
    cout << answer << endl;
    return 0;
}

/** ----from here ---------------------------------------------------------- */

int main() {

    int N;
    int K;
    cin >> N >> K;
    vector<int> w(N);
    long long h[100010];


    // 無限大の値
    //const long long INF = 1LL << 60;

    for (int i = 0; i < N; ++i) cin >> h[i];

    // DP テーブル
    long long dp[100010];

    // DP テーブル全体を初期化 (最小化問題なので INF に初期化)
    for (int i = 0; i < 100010; ++i) dp[i] = INF;

    // 初期条件
    dp[0] = 0;

    for (int i = 1; i < N; ++i) {
        int k = 1;
        while (k <= K) {
            if (i < k) {
                break;
            }
            changeMinimum(dp[i], dp[i - k] + abs(h[i] - h[i - k]));
            k++;
        }
    }

    cout << dp[N - 1] << endl;

}

Measured memory_bytes: 2176
#include<bits/stdc++.h>
#define ll long long
#define ALL(v) (v).begin(),(v).end()
#define REP(i,p,n) for(int i=p;i<(int)(n);++i)
#define rep(i,n) REP(i,0,n)
#define dump(a) (cerr << #a << "=" << (a) << endl)
#define DUMP(list) cout << "{ "; for(auto nth : list){ cout << nth << " "; } cout << "}" << endl;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return true; } return false; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return true; } return false; }


using namespace std;

int main(){
    ll A, B, K;
    cin >> A >> B >> K;
    if (A >= K) {
        cout << A - K << " " << B << endl;
    } else {
        if (B >= (K - A)) {
            cout << 0 << " " << B - (K - A) << endl;
        } else {
            cout << 0 << " " << 0 << endl;
        }
    }
}

Measured memory_bytes: 256
#include"bits/stdc++.h"
using namespace std;
#define LL long long
#define PB push_back
#define MP make_pair

int main(){
	int N, L;
	cin >> N >> L;
	int sum = 0;
	for(int i=0; i<N; i++) sum += L+i;
	int ans = INT_MAX;
	int tmp = INT_MAX;
	for(int i=0; i<N; i++){
		if(abs(L+i) < tmp){
			tmp = abs(L+i);
			ans = sum-(L+i);
		}
	}
	cout << ans << endl;
}


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

int main(){
	string a,b,c;
	cin>>a>>b>>c;
	if(a[a.length()-1]==b[0]&&b[b.length()-1]==c[0]) cout<<"YES"<<endl;
	else cout<<"NO"<<endl;
	return 0;
}


Measured memory_bytes: 256
#include <iostream>
#include <string>
#include <map>
#include <sstream>
#include <algorithm>
using namespace std;

int l;

inline int toInt(string str){
    istringstream iss(str);
    int tmp;
    iss >> tmp;
    return tmp;
}

inline string toString(int arg){
    char ret[l];
    int base = 1;
    string res;
    for(int i=0;i<l;i++){
        ret[i] = (arg%(base*10)) / base + '0';
        base *= 10;
    }

    for(int i=l-1;i>=0;i--){
        res += ret[i];
    }
    return res;
}

int main(){
    int a;

    while(cin >> a >> l){
        if((a|l) == 0) break;
        map<int,int> m;
        string tmp;
        int mini, maxi;
        int cnt = 0;
        m[a] = 0;
        
        while(1){
            tmp = toString(a);
            for(int i=0;i<l;i++){
                for(int j=i+1;j<l;j++){
                    if(tmp[i] > tmp[j]){
                        swap(tmp[i],tmp[j]);
                    }
                }
            }
            mini = toInt(tmp);
            for(int i=0;i<l;i++){
                for(int j=i+1;j<l;j++){
                    if(tmp[i] < tmp[j]){
                        swap(tmp[i],tmp[j]);
                    }
                }
            }
            maxi = toInt(tmp);

            a = maxi - mini;
            cnt++;
            if(m.find(a) != m.end()){
                break;
            }else{
                m[a] = cnt;
            }
        }
        cout << m[a] << " " << a << " " << cnt - m[a] << endl;
    }
}

Measured memory_bytes: 1224
#include <bits/stdc++.h>
using namespace std;
#define fi first
#define se second
#define pb push_back
#define mp make_pair
#define inf 1000000005
#define all(a) (a).begin(), (a).end()
#define ms(a,x) memset(a, x, sizeof(a))
#define mod 1000000007
#define sz(a) ((ll)(a).size())

template<class T> int getbit(T s, int i) { return (s >> i) & 1; }
template<class T> T onbit(T s, int i) { return s | (T(1) << i); }
template<class T> T offbit(T s, int i) { return s & (~(T(1) << i)); }
template<class T> int cntbit(T s) { return __builtin_popcnt(s);}
#define Rep(i,n) for(int i = 0; i < (n); ++i)
#define Repd(i,n) for(int i = (n)-1; i >= 0; --i)
#define For(i,a,b) for(int i = (a); i <= (b); ++i)
#define Ford(i,a,b) for(int i = (a); i >= (b); --i)

typedef unsigned long long ull;
typedef long long ll;
typedef double ld;
#define eps 1e-12
typedef pair<int, int> II;
typedef pair<ll, ll> LL;
template<class T> T gcd(T a, T b){ T r; while (b != 0) { r = a % b; a = b; b = r; } return a;}
template<class T> T lcm(T a, T b) { return a / gcd(a, b) * b; }
#define PI (2 * acos((ld)0))
#define linf (1ll << 60)
#define y1 y32432
#define y0 y435346

#define maxn 5005

string s;

int main()
{
//	freopen("in.txt", "r", stdin);

	ios::sync_with_stdio(0);
	cin.tie(0);

	cin >> s;
	int n = sz(s);
	int res = inf;
	for(char ch = 'a'; ch <= 'z'; ch++){
		int last = -1;
		int ret = 0;
		for(int i = 0; i < n; i++) if(s[i] == ch){
			ret = max(ret, i - last - 1);
			last = i;
		}
		ret = max(ret, n - last - 1);
		res = min(res, ret);
	}
	cout << res << endl;

	return 0;
}


Measured memory_bytes: 256
N, M, K = map(int, input().split())
A = list(map(int, input().split()))
B = list(map(int, input().split()))

SA = 0
SB = sum(B)
Bn = len(B)
ans = 0
for An in range(len(A)+1):
  if An>0:
    SA += A[An-1]
  if SA>K:
    break
  while SA+SB>K:
    Bn -= 1
    SB -= B[Bn]
  ans = max(ans, An+Bn)
print(ans)


Measured memory_bytes: 40608
#include<bits/stdc++.h>
using namespace std;
 
#define rep(i,m,n) for(int i = (m); i < (int)(n); i++)
#define rrep(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define vsort(v) sort(v.begin(), v.end());
#define rvsort(v) sort(v.begin(), v.end(),greater<int>());
#define YES cout<<"YES"<< endl
#define NO cout<<"NO"<<endl
#define Yes cout<<"Yes"<<endl
#define No cout<<"No"<<endl  
#define yes cout<<"yes"<<endl
#define no cout<<"no"<<endl
#define ret return
#define lb(v,n) lower_bound(v.begin(),v.end(),n)
#define ub(v,n) upper_bound(v.begin(),v.end(),n)
#define mae(v) max_element(v.begin(),v.end())
#define mie(v) min_element(v.begin(),v.end())
#define INF 0x7FFFFFFF
#define mod 1000000007
#define fir first
#define sec second
typedef long long ll;
////////////////////////////////////////////////////////////

int main(){
	string s;
	cin >> s;
	if( s.size() == 2 ) cout << s << endl;
	else{
		rrep(i , s.size()-1 , 0 ) cout << s[i];
		cout << endl;
	}
	ret 0;
}

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

int main () {
  int N;
  cin >> N;
  vector<int>a(N);
  for (int i = 0; i < N; i++) {
    cin >> a.at(i);
  }
  bitset<30>C;
  bitset<30>A(a.at(0));
  for (int i = 1; i < N; i++) {
    bitset<30>B(a.at(i));
    C = A ^ B;
    A = C;
  }
  
  for (int i = 0; i < N; i++) {
    bitset<30>D(a.at(i));
    D ^= C;
    int E = D.to_ullong();
    cout << E << endl;
  }
}

Measured memory_bytes: 3932
#include<stdio.h>
int main(){
	int a,b;
	scanf("%d %d",&a,&b);
	if(a<b){
		printf("a < b\n");
	}
	else if(a>b){
		printf("a > b\n");
	}
	else{
	printf("a == b\n");
	}
	return 0;
}


Measured memory_bytes: 2048
<?php
  fscanf(STDIN, "%d %d", $n, $k);
    //1行入力
$single_line_input = trim(fgets(STDIN));
//不要な改行コードを取り除く
$single_line_input = str_replace(array("\r\n","\r","\n"), '', $single_line_input);
//スペースで分解して配列に格納
$h = explode(" ", $single_line_input);
    
    rsort($h);
    $cnt = 0;
   for($i=0; $i<$n; $i++){
        if($i>=$k){
            $cnt += $h[$i];
        }
    }
    
    echo($cnt);
    
?>

Measured memory_bytes: 23284
def main():
    num = input().split()
    A = int(num[0])
    B = int(num[1])
    C = int(num[2])
    D = int(num[3])
    count = 0
    while A > 0 and C > 0:
        if count % 2 == 0:
            C = C - B
            count += 1
        elif count % 2 == 1:
            A = A - D
            count += 1

    if A <= 0:
        print("No")
    elif C <= 0:
        print("Yes")

if __name__ == "__main__":
    main()

Measured memory_bytes: 9048
n, m = map(int, input().split())

from collections import defaultdict

G = defaultdict(list)

for i in range(n):
    ll = list(map(int, input().split()))[1:]
    for l in ll:
        G[l + n - 1].append(i)
        G[i].append(l + n - 1)
# G[v]: 頂点vに隣接する頂点list
# N: 頂点数

from collections import deque

dist = [-1] * (n + m + 1)
que = deque([0])
dist[0] = 0
while que:
    v = que.popleft()
    d = dist[v]
    for w in G[v]:
        if dist[w] > -1:
            continue
        dist[w] = d + 1
        que.append(w)

if -1 in dist[:n]:
    print("NO")
else:
    print("YES")

Measured memory_bytes: 36188
#include <bits/stdc++.h>
#define pi 3.14159
using namespace std;
typedef long long LL;
const LL MOD = 1e9 + 7;
const int N = 1e5 + 7, M = 1e7, OO = 0x3f3f3f3f;
#define AC ios::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin.sync_with_stdio(0);
int main()
{
int i,j,k,sum,counter=0;
scanf("%d %d",&k,&sum);
for(i=0;i<=k;++i){
    for(j=0;j<=k;++j){
        if((sum-(i+j))<=k&&(sum-(i+j))>=0){
            counter++;
        }
    }
}
printf("%d",counter);

    return 0;
}


Measured memory_bytes: 3784
#include <bits/stdc++.h>
#define Phuong_ ios_base::sync_with_stdio(0); cin.tie(0);

/// easy access -------------
using namespace std;
using ll = long long;
using ull = unsigned long long;
using ld = long double;
typedef pair<int,int> pi;
///-------------------------

int main()
{
    Phuong_; /// <3333
    string s;
    cin >> s;
    string t;
    cin >> t;
    int ans=0;
    for(int i=0; i<(int) s.length(); ++i){
        if (t[i]!=s[i]) ans++;
    }
    cout << ans;
    return 0;
}


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

#include <iostream>
//#include <algorithm>
// #include <iomanip>
#define ll long long
#define map unordered_map
#define set unordered_set
#define pll pair<ll, ll>
#define vll vector<ll>

using namespace std;

const ll MOD = 1000000007;
const ll INF = (1LL << 62);

//-------------------------
// ダイクストラ
//-------------------------
struct edge {
  ll to;
  ll cost;
};

const ll MAX_N = 510;
ll N, M;
vector<edge> edges[MAX_N];
ll d[MAX_N];  // startからの最短距離
ll pv[MAX_N];

ll used[MAX_N][MAX_N];

void dijkstra(ll start) {
  // 距離が最小のものから処理するためのキュー
  priority_queue<pll, vector<pll>, greater<pll>> que;

  fill(d, d + MAX_N, INF);
  fill(pv, pv + MAX_N, -1);

  d[start] = 0;
  que.push(pll(0, start));

  while (!que.empty()) {
    pll p = que.top();
    que.pop();

    ll from = p.second;  // 頂点番号

    ll p_cost = p.first;
    if (d[from] < p_cost) {
      // 試す価値なし
      continue;
    }

    for (ll i = 0; i < edges[from].size(); i++) {
      edge e = edges[from][i];

      ll next_cost = d[from] + e.cost;
      if (d[e.to] > next_cost) {
        d[e.to] = next_cost;
        que.push(pll(d[e.to], e.to));

        //
        pv[e.to] = from;
      }
    }
  }
}

void calc() {
  scanf("%lld %lld", &N, &M);

  for (ll i = 0; i < M; i++) {
    ll from, to, cost;
    scanf("%lld %lld %lld", &from, &to, &cost);

    edges[from].emplace_back(edge{to, cost});
    edges[to].emplace_back(edge{from, cost});
  }

  for (ll start = 1; start <= N; start++) {
    dijkstra(start);

    for (ll goal = start + 1; goal <= N; goal++) {
      if (start == goal) {
        continue;
      }

      ll current = goal;
      // vll path;
      for (;;) {
        // path.emplace_back(current);
        if (current == start) {
          break;
        }
        ll next = pv[current];
        if (next == -1) {
          break;
        }

        used[current][next] = 1;
        used[next][current] = 1;

        // cout << current << " " << next << endl;

        current = next;
        // cout << "current:" << current << endl;
      }
    }
  }

  ll ans = 0;

  for (ll from = 1; from <= N; from++) {
    for (ll j = 0; j < edges[from].size(); j++) {
      auto e = edges[from][j];
      if (from >= e.to) {
        continue;
      }
      if (!used[from][e.to]) {
        ans++;
        // cout << from << " " << e.to << endl;
      }
    }
  }
  cout << ans << endl;
}

int main() { calc(); }


Measured memory_bytes: 768
#include <iostream>
#include <algorithm>
#include <vector>
#include <stdio.h>
#include <cstring>

using namespace std;

int main()
{
    int n;
    cin>>n;
    int arr[n];
    int cnt=0;
    for(int i=0;i<n;i++)
    {
        cin>>arr[i];
        if(arr[i]%2!=0)
            return cout<<0,0;
    }
    while(1)
    {
        cnt++;
        for(int i=0;i<n;i++)
        {
            arr[i] /= 2;
            if(arr[i] % 2!=0)
                return cout<<cnt,0;
        }

    }
    return 0;
}


Measured memory_bytes: 256
#include<iostream>
#include<algorithm>
using namespace std;
#define MAX 1000000
int main(){
	int n, m, a, b, cost, ti, k, p, q, r, point = 0;
	int cost_[101][101], time_[101][101];
	while ( cin >> n >> m && (n != 0 && m != 0)){
		for (int i = 0; i < m; i++)
		for (int j = 0; j < m; j++) { cost_[i][j] = time_[i][j] = MAX; }
		for (int i = 0; i < n; i++){
			cin >> a >> b >> cost >> ti;
			cost_[a-1][b-1] = cost;
			cost_[b-1][a-1] = cost;
			time_[a-1][b-1] = ti;
			time_[b-1][a-1] = ti;
		}
		for (int i = 0; i < m; i++){
			for (int j = 0; j < m; j++){
				for (int o = 0; o < m; o++){
						cost_[j][o] = min(cost_[j][o], cost_[j][i] + cost_[i][o]);
						time_[j][o] = min(time_[j][o], time_[j][i] + time_[i][o]);
				}
			}
		}cin >> k;
		for (int i = 0; i < k; i++){
			cin >> p >> q >> r;
			if (r != 1) cout << cost_[p-1][q-1] << endl;
			else cout << time_[p-1][q-1] << endl;
		}
	}
	return 0;
}

Measured memory_bytes: 1236
#include "bits/stdc++.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
using pll = pair<ll, ll>;
using vi = vector<int>;
using vl = vector<ll>;
using vvi = vector<vi>;
using vvl = vector<vl>;
const int INF = 1 << 28;
const ll MOD = 1000000007;
template <class T>
bool chmax(T &a, const T &b) {
    return (a < b) ? (a = b, 1) : 0;
}
template <class T>
bool chmin(T &a, const T &b) {
    return (b < a) ? (a = b, 1) : 0;
}

int main() {
    int n;
    cin >> n;
    vl t(n);
    ll sum = 0;
    for (int i = 0; i < n; ++i) {
        cin >> t[i];
        sum += t[i];
    }
    int m;
    cin >> m;
    vl ret(m, sum);
    for (int i = 0; i < m; ++i) {
        ll p, x;
        cin >> p >> x;
        ret[i] += x - t[p - 1];
    }
    for (int i = 0; i < m; ++i) {
        cout << ret[i] << "\n";
    }

    return 0;
}

Measured memory_bytes: 256
#include <bits/stdc++.h>
#include<set>
#define ll long long 
#include <string>
#define pb push_back
#define mp make_pair
# define pi 3.14159265358979323846
#define mod 1000000007
using namespace std;
int main()
{  
string s;
cin>>s;
ll int i;
ll int ans=0;
for(i=0;i<s.size();i++)

{

ll int c=0;
while(s[i]=='R')
{
	c++;
	i++;
}
ans=max(ans,c);
  
}
cout<<ans<<endl;
}

	
		
	
	
	
	




Measured memory_bytes: 3624
//#include "bits/stdc++.h"

#define _USE_MATH_DEFINES
#include<cstdio>
#include <cstring>
#include <cmath>
#include <cstdlib>
#include <deque>
#include <algorithm>
#include <functional>
#include <iostream>
#include <list>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <sstream>
#include <stack>
#include <string>
#include <utility>
#include <vector>
#include <iterator>
#include<iomanip>
#include<unordered_set>
#include<bitset>

using namespace std;

#define rep(i,a,b) for(int i=(a), i##_len=(b);i<i##_len;i++)
#define rrep(i,a,b) for(int i=(b)-1;i>=(a);i--)
#define all(c) begin(c),end(c)

#define int ll
#define SZ(x) ((int)(x).size())
#define pb push_back
#define mp make_pair

//typedef unsigned long long ull;
typedef long long ll;
typedef pair<int, int> pii;
typedef pair<ll, ll> pll;
typedef pair<ll, int> pli;
typedef pair<double, double> pdd;
typedef vector< vector<int> > mat;

template<class T> bool chmax(T &a, const T &b) { if (a < b) { a = b; return true; } return false; }
template<class T> bool chmin(T &a, const T &b) { if (b < a) { a = b; return true; } return false; }

const int INF = sizeof(int) == sizeof(long long) ? 0x3f3f3f3f3f3f3f3fLL : 0x3f3f3f3f;
const int MOD = (int)1e9 + 7;
const double EPS = 1e-9;

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

	int N;

	cin >> N;
	rep(i, 1, 10)
	{
		int syo = N / i;
		if (N%i == 0 && 1 <= syo && syo <= 9)
		{
			cout << "Yes" << endl;
			return 0;
		}
	}

	cout << "No" << endl;

	return 0;
}

Measured memory_bytes: 256
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.UncheckedIOException;
import java.util.StringTokenizer;

public class Main{
	public static void main(String[] args) {
		SC sc = new SC(System.in);
		int N=sc.nextInt();
		int L=sc.nextInt();
		int min=114514;
		for(int i=L; i<=L+N-1; i++) {
			if(Math.abs(min)>Math.abs(i)) {
				min=i;
			}
		}
		int ans=0;
		for(int i=L; i<=L+N-1; i++) {
			if(i!=min) {
				ans+=i;
			}
		}
		pl(ans);
	}
	static class SC {
		private BufferedReader reader = null;
		private StringTokenizer tokenizer = null;
		public SC(InputStream in) {
			reader = new BufferedReader(new InputStreamReader(in));
		}
		public String next() {
			if (tokenizer == null || !tokenizer.hasMoreTokens()) {
				try {
					tokenizer = new StringTokenizer(reader.readLine());
				} catch (IOException e) {
					throw new UncheckedIOException(e);
				}
			}
			return tokenizer.nextToken();
		}
		public int nextInt() {
			return Integer.parseInt(next());
		}
		public long nextLong() {
			return Long.parseLong(next());
		}
		public double nextDouble() {
			return Double.parseDouble(next());
		}
		public String nextLine() {
			try {
				return reader.readLine();
			} catch (IOException e) {
				throw new UncheckedIOException(e);
			}
		}
	}
	public static void pl(Object o) {
		System.out.println(o);
	}
	public static void pl() {
		System.out.println();
	}
	public static void p(Object o) {
		System.out.print(o);
	}
}

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

int main(){
  
  
  int N;
  cin >> N;
  
  vector<int> a(N);
  for(int i = 0; i < N; ++i){
  
    cin >> a.at(i);
  
  }
  
  int check = 1,count = 0;
  
  while(true){
    
    ++count;
    
    if(a.at(check-1) == 2){
    
      cout << count << endl;
      break;
    
    }else if(count > N){
    
      cout << -1 << endl;
      break;
    
    }else{
    
      check = a.at(check-1);
    
    }
  
  }
  
  return 0;

}

Measured memory_bytes: 640
#include<stdio.h>
#include<string.h>

int head=0,tail=0,n;
typedef struct{
	char pr[10];
	int time;
}pro;
pro que[100001],test;
void enqu(pro);
pro dequ(void);

int main(){
	pro p;
	int i,a,b,q,sum=0;
	test.time=0;
	scanf("%d%d",&n,&q);
	for(i=0;i<n;i++){
		scanf("%s%d",p.pr,&p.time);
		enqu(p);
	}
	while(1){
		p=dequ();
		if(p.time==test.time)break;
		p.time=p.time-q;
		if(p.time<=0){
			sum+=q+p.time;
			printf("%s %d\n",p.pr,sum);
		}else{
			sum+=q;
			enqu(p);
		}
	}
	return 0;
}

void enqu(pro a){
	if(tail==n+1)tail=0;
	strcpy(que[tail].pr,a.pr);
	que[tail].time=a.time;
	tail++;
}
pro dequ(){
	if(head==tail){
		test.time=-1;
		return test;
	}
	if(head==n+1)head=0;
	head++;
	return que[head-1];
}



Measured memory_bytes: 2496
package main

import "fmt"

func main() {
	var N int
	fmt.Scan(&N)
	a := make([]int, N)
	for i := 0; i < N; i++ {
		fmt.Scan(&a[i])
	}
	cnt := 0
	for i := 0; i < N; i++ {
		for {
			if a[i]%2 == 0 {
				a[i] /= 2
				cnt++
			} else {
				break
			}
		}
	}
	fmt.Println(cnt)
}


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

int main () {
    string S;
    cin >> S;
    int count = 0;
    bool  A = false;
    for (char i = 'a'; i <= 'z'; i++) {
        count = 0;
        for (int j = 0; j < S.size(); j++) {
            if (i != S.at(j)) {
                count++;
            }
        }
        if (count == S.size()) {
            cout << i << endl;
            A = true;
            break;
        }
    }
    if (A == false) {
        cout << "None" << endl;
    }
}

Measured memory_bytes: 512
#include <bits/stdc++.h>
#define FOR(i, begin, end) for(int i=(begin);i<(end);i++)
#define REP(i, n) FOR(i,0,n)
#define SORT(a) sort(a.begin(), a.end())
#define int long long
using namespace std;

typedef pair<int, int> Pii;

template<typename T>
void readvec(vector<T> &a);
void readindex(vector<int> &a);

#define MAX_V 100000
struct edge {int to, cap;};
vector<edge> G[MAX_V];
void add_edge(int from, int to, int cap){
    G[from].push_back((edge({to, cap})));
}

#define INF 10000000000
bool calc_x(int i, vector<int> &x){
    REP(j, G[i].size()){
        if(x[G[i][j].to] < INF){
            if(x[i] + G[i][j].cap != x[G[i][j].to]) return false;
        }else{
            x[G[i][j].to] = x[i] + G[i][j].cap;
            if(!calc_x(G[i][j].to, x)) return false;
        }
    }
    return true;
}

signed main(){

    int N, M;
    cin >> N >> M;
    int L, R, D;
    REP(i, M){
        cin >> L >> R >> D;
        L--;
        R--;
        add_edge(L, R, D);
        add_edge(R, L, -1 * D);
    }

    vector<int> x(N, INF); 
    
    string ans = "Yes";
    REP(i, N){
        if(x[i] == INF){
            x[i] = 0;
            if(!calc_x(i, x)){
                ans = "No";
                break;
            }
        }
    }

    cout << ans;

    return 0;
}


template<typename T>
void readvec(vector<T> &a){
    REP(i, a.size()){
        cin >> a[i];
    }
}
void readindex(vector<int> &a){
    REP(i, a.size()){
        cin >> a[i];
        a[i]--;
    }
}

Measured memory_bytes: 16512
/*
********************
Author : Sahil Kundu
********************
*/
//#pragma GCC optimize("O3")
#include<bits/stdc++.h>
using namespace std;
#define ll long long int
#define mod 1000000007
#define pb(i) push_back(i)
#define pp() pop_back()
#define f first
#define s second
#define mk(l,r) make_pair(l,r)
#define all(vc) vc.begin(),vc.end()
#define bg(vc) vc.begin()
#define ed(vc) vc.end()
#define ms(i,j) memset(i,j,sizeof i)
#define w(t) while(t--)
const ll MAX=1e5+5;
const ll INF=2e18;

int main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(NULL);
    int t;
    t=1;
    //cin>>t;
    w(t)
    {
        int n;
        cin>>n;
        int mp[n+1]={0};
        for(int i=1;i<n;i++)
        {
            int l;
            cin>>l;
            mp[l]++;
        }
        for(int i=1;i<=n;i++)
            cout<<mp[i]<<"\n";
    }
}
/*ll msb(ll x)
{
	ll k=(ll)log2(x);
	return (ll)(pow(2,k));
}
#define gc getchar_unlocked
void scanint(int &x)
{
    register int c = gc();
    x = 0;
    int neg = 0;
    for(;((c<48 || c>57) && c != '-');c = gc());
    if(c=='-') {neg=1;c=gc();}
    for(;c>47 && c<58;c = gc()) {x = (x<<1) + (x<<3) + c - 48;}
    if(neg) x=-x;
}*/

Measured memory_bytes: 4372
#include <bits/stdc++.h>
#define all(vec) vec.begin(), vec.end()
using namespace std;
using ll = long long;
using P = pair<ll, ll>;
constexpr ll INF = (1LL << 30) - 1LL;
constexpr ll LINF = (1LL << 60) - 1LL;
constexpr double eps = 1e-9;
constexpr ll MOD = 1000000007LL;
template <typename T> bool chmin(T &a, T b) {
    if (a > b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T> bool chmax(T &a, T b) {
    if (a < b) {
        a = b;
        return true;
    }
    return false;
};
template <typename T> ostream &operator<<(ostream &os, vector<T> v) {
    for (int i = 0; i < v.size(); i++) {
        os << v[i] << (i + 1 == v.size() ? "\n" : " ");
    }
    return os;
}
template <typename T> vector<T> make_v(size_t a) { return vector<T>(a); }
template <typename T, typename... Ts> auto make_v(size_t a, Ts... ts) {
    return vector<decltype(make_v<T>(ts...))>(a, make_v<T>(ts...));
}
template <typename T, typename V>
typename enable_if<is_class<T>::value == 0>::type fill_v(T &t, const V &v) {
    t = v;
}
template <typename T, typename V>
typename enable_if<is_class<T>::value != 0>::type fill_v(T &t, const V &v) {
    for (auto &e : t) {
        fill_v(e, v);
    }
};
int main() {
    cin.tie(0);
    ios::sync_with_stdio(false);
    ll n;
    cin >> n;
    cout << (n - 1LL) * n / 2LL << endl;
}


Measured memory_bytes: 256